cancel
Showing results for 
Search instead for 
Did you mean: 

Question about speed profiles for a L6470

Muscle Man
Associate III

Hi,

I'm here to try to solve a problem that I have on a L6470 device.

I have a stepper motor whose step angle is 1.8 degree (200 steps in 360 degrees)

and with a 128 microstep mode selected I want to move the motor's rotor to make

a 60 degrees angle.

I set MIN_SPEED to the integer value corresponding to its maximum value (4096,

corresponding to 976.3 step/sec) and I set the MAX_SPEED to an integer value

corresponding to the same min speed (976.3 * 250 nsec / 2^-18 = 64) so that

minimum and maximum speed are about the same (no acceleration/deceleration

phase).

Then I set a MOVE command with steps = 4267 (the 128 microsteps corresponding

to an angle of 60 degrees = (200 * 128) * 60 / 360 ). I would have expected the time

it takes to make that angle to be about 4.73 seconds (4267 / 976.3 = 4.37 sec) but

the time that I measured is almost instantaneous.

Where am I wrong?

1 ACCEPTED SOLUTION

Accepted Solutions
Cristiana SCARAMEL
ST Employee

Hello @Muscle Man​,

your reasoning is correct, only one detail is missing in the last step.

The speed is expressed in step/s, in your case the expected time must be divided by 128 (microstep).

-->  (4267/128)/976.3 = almost instantaneous 😉

View solution in original post

5 REPLIES 5
Cristiana SCARAMEL
ST Employee

Hello @Muscle Man​,

your reasoning is correct, only one detail is missing in the last step.

The speed is expressed in step/s, in your case the expected time must be divided by 128 (microstep).

-->  (4267/128)/976.3 = almost instantaneous 😉

Muscle Man
Associate III

Or in another way, this means that instead of using the number of microsteps

present in a certain angle, I have to consider the full steps corresponding to it

(full_steps = 200 * 60 / 360 = 33.333) so that (4267/128)/976.3 = 33.333 / 976.3

@Muscle Man​ I agree.

Please click on the 'Select as Best' label (in the proper reply) if I answered to your question.

Muscle Man
Associate III

Episode 2..

I realized that I wrote in the MIN_SPEED register the 4096 integer value, that

corresponds to 0x1000 in hex, i.e I actually wrote a minimum speed equal to 0,

also enabling the Low Speed Optimization (bit 12).

With this error:

 1. the rotor spins "drawing" an angle of 60 degrees in about 64 msec

   (I got this time measuring with an oscilloscope the time between

    the falling edge and the rising edge of BUSY pin);

 2. there is also an acceleration phase and a deceleration phase because

   of the minimum speed is 0 and maximum speed is 976.3

I fixed the error writing the right value into MIN_SPEED register (4095).

When I again ran the test sending again a MOVE command with STEPS = 4267,

the rotors did not draw an angle of 60 degrees, but a smaller one (no more

than a 1-2 degrees)...

I also measured the time needed to perform the movement, displaying the

BUSY signal on the oscilloscope: the time between the falling and the

rising edge of that signal is about 34 msec...

Here the settings I made via SETPAR commands before to run MOVE command:

{ .addtr = REG_ACC,        .val =  2062U, }, /* 30006.05 step/sec^2           */
{ .par = REG_DEC,        .val =  2062U, }, /* 30006.05 step/sec^2           */
{ .par = REG_MAX_SPEED,  .val =    64U, }, /*    796.3 step/sec             */
{ .par = REG_MIN_SPEED,  .val =  4095U, }, /*    796.3 step/sec             */
{ .par = REG_KVAL_HOLD,  .val =    14U, }, /*     0.0546                    */
{ .par = REG_KVAL_RUN,   .val =    78U, }, /*     0.3046                    */
{ .par = REG_KVAL_ACC,   .val =    69U, }, /*     0.2695                    */
{ .par = REG_KVAL_DEC,   .val =    69U, }, /*     0.2695                    */
{ .par = REG_INT_SPEED,  .val = 10285U, }, /*   613.033 step/sec            */
{ .par = REG_ST_SLP,     .val =    42U, }, /*     0.000641 sec/step         */
{ .par = REG_FN_SLP_ACC, .val =    71U, }, /*     0.00108 sec/step          */
{ .par = REG_FN_SLP_DEC, .val =    71U, }, /*     0.00108 sec/step          */
{ .par = REG_K_TERM,     .val =     3U, }, /*     0.09375                   */
{ .par = REG_OCD_TH,     .val =     2U, }, /*     0.947 A                   */
{ .par = REG_STALL_TH,   .val =    28U, }, /*     0.900 A                   */
{ .par = REG_FULL_SPEED, .val =  1023U, }, /* Max value = no full-step      */
{ .par = REG_STEPMODE,   .val =     7U, }, /* 128 microstep, no sync en/sel */
{ .par = REG_ALARM_EN,   .val =   255U, }, /* All alarms enabled            */
{ .par = REG_CONFIG,     .val = 11424U, }, /* No ext clk. internal 16 Mhz   */

I'm a little bit confused..

Hi @Muscle Man​,

setting the MIN_SPEED register to 4095, you are actually asking the motor to start with infinite acceleration.

I suggest to check you motor characteristics, but probably the motor is in stall condition.

In case of new questions please open new topics 😉 thanks