cancel
Showing results for 
Search instead for 
Did you mean: 

powerstep01 - Getting it into fault mode through external input

VRagh.3
Associate II

I am using Powerstep01 and STM32 MCU. I have a requirement where the stepper driver should stop when certain hardware conditions are met. Is there any way that I can implement this?

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @VRagh.3​,

The right answer is the second option (by default with (SW_MODE bit of CONFIG register set to ‘0’): the SW input can manage the SW event internally without the MCU intervention.

The HardStop command (refer to datasheet at page 81) causes an immediate motor stop with infinite deceleration.

Otherwise (SW_MODE bit of CONFIG register set to ‘1’), switch input events do not cause interrupts and the switch status information is at the user’s disposal.

Let me know if my reply fully answered your question, if so please "Select as Best" button.

View solution in original post

7 REPLIES 7
Cristiana SCARAMEL
ST Employee

Hello @VRagh.3​ and welcome to the ST Community.

The first response is: it depends on the type of external event you want to use as a trigger.

Refer to powerSTEP01 datasheet at page 33, the SW pin might be right for you.

The SW input is internally pulled up to VDD and detects if the pin is open or connected to ground.

By default, a switch turn-on event (SW input falling edge) causes a HardStop interrupt.

The SW_EVN flag of the STATUS register is raised when a switch turn-on event is detected. A GetStatus command releases the SW_EVN flag.

Let me know if this info can help you.

VRagh.3
Associate II

Thanks Cristiana.

I have a couple of limit switches which I will use to detect extreme ends of the frame. when either of the limit sw is hit, I want the stepper driver to stop without depending on FW intervention. That brings me to the next questions.. I wasn't clear what will happen when the SW pin is connected to ground & HardStop interrupt? Will the powerSTEP send an interrupt to the MCU and wait for MCU to send stop command or will it stop the stepper motors by itself as soon as SW is grounded?

Hi @VRagh.3​,

The right answer is the second option (by default with (SW_MODE bit of CONFIG register set to ‘0’): the SW input can manage the SW event internally without the MCU intervention.

The HardStop command (refer to datasheet at page 81) causes an immediate motor stop with infinite deceleration.

Otherwise (SW_MODE bit of CONFIG register set to ‘1’), switch input events do not cause interrupts and the switch status information is at the user’s disposal.

Let me know if my reply fully answered your question, if so please "Select as Best" button.

VRagh.3
Associate II

Awesome, thank you Cristiana!

VRagh.3
Associate II

Hi Christina,

I got a question - SW when pulled low should stop the motor irrespective of the command used to drive the motor, correct? In my case, I use a MOVE command and while the motor is moving, I pull down the SW pin, then, my expectation is it should stop the motor. It looks like it doesn't happen. When i went through the datasheet, I found SW is closely associated with GoUntll and ReleaseSW commands. Is it true that I can use SW only for these commands? Pls let me know.

In addition to the above, when the SW is pulled low while in a MOVE command, will the stepper go into busy mode? When the SW pin is pulled low, till the firmware clears it, stepper shouldn't allow further movements, right? I see this mentioned in GoUntill command but not anywhere else.. Would that mean SW can't work with other commands?

VRagh.3
Associate II

Here's what I found. We were using StepClock command. It looks like making SW pin low when in stepclock mode wouldn't work. When we tried MOVE command, making SW low stopped motor as it should.

Hi @VRagh.3​,

when the system is in Step-clock mode the SPEED register is set to zero and motor status is considered stopped regardless of the STCK signal frequency (the MOT_STATUS parameter in the STATUS register equal to “00�?).

So in step-clock the HardStop interrupt due to the SW event cannot be performed because for the device the motor is already stopped.

Please, in the future open a new thread for new question, if necessary you can add the link at previous discussion.

Have a nice day!