cancel
Showing results for 
Search instead for 
Did you mean: 

L6480 best driving (from motor motion perspective) strategy question

FF1
Associate III

Hi all,

I'm developing a bipolar stepper motor application by means of a STEVAL-PCC009V2 + EVAL6480H boards coupled together.

My application have to follow a position by means of an incremental encoder that is connected to the encoder quadrature module of the TIM2 timer (PA0_pin3 and PA1_pin4 on the STEVAL-PCC009V2 pin of the J2 connector).

The encoder position is readed every 500 us from an internal interrupt and then an absolute position is calculated by updating an internal counter.

The bipolar stepper motor is a 200 steps and I'm using a 1/128 microstepping to give the best smooth movement. The encoder rotation is slowly, max 40 RPM, and resolution 128 PPR (x4 internally multiplied to achieve 512 pulse every full turn).

Into the main loop application code (so outside the ISR) I've a FSM that perform the movement decoding in order to properly define the stepper motor rotation direction.

Actually the stepper motor positioning is made by using the cSPIN_Move(DIR, DELTA_STEPS) command, where DELTA_STEPS is the difference from the absolute counter (as written above updated under the ISR) and a current position buffer (definited into the main application code) updated every time the MOVE command is executed and finished by waiting for the status of the busy flag, so every time I've to perform a movement, in order to reach the new position, I've to do this sequence of commands:

cSPIN_Move(Motore_Stepper_Status, (uint32_t)(Delta_step_tmp));

while(cSPIN_Busy_HW());

cSPIN_Soft_Stop();

From the L6480 datasheet (DocID023278 Rev 7), concerning this command is stated:

"This command keeps the BUSY flag low until the target number of steps is performed. This

command can only be performed when the motor is stopped. If a motion is in progress the

motor must be stopped and it is then possible to perform a move command.

Any attempt to perform a move command when the motor is running causes the command to be ignored and the CMD_ERROR flag to rise (Section 9.1.24)."

so actually the movement, apparently seems smooth from a macro point of view, but from a motor perspective is made by a sequence of move-stop and then again another move-stop sequence because when the encoder is continuously rotating the absolute position buffer is updated accordling so when the motor reach a position it have to restart again to perform another movement and so on because the Move command (as reported above) require a stop when the movement have reach the programmed target position. I hope to have better explained the concept.

What I try to do or found or to simulate in some way (if not available as single L6480 command) is to perform a continuosly moving of the stepper until the encoder pulses are coming and until the final position is reached so a desiderable behaviour should be a MOVE command able to permit a sort of on the fly updating of the final step inside the L6480 driver in order to avoid to stop the stepper motor, due to the nature of the Move command, and then having to restart it each time.

Someone can suggest a more suitable way how to implement this type of behaviour?

Thank and best regards!

Fabio

0 REPLIES 0