2022-09-20 07:32 AM
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?
Solved! Go to Solution.
2022-09-21 11:36 PM
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 ;)
2022-09-21 11:36 PM
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 ;)
2022-09-22 01:20 AM
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
2022-09-22 04:40 AM
@Muscle Man I agree.
Please click on the 'Select as Best' label (in the proper reply) if I answered to your question.
2022-09-22 07:25 AM
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..
2022-10-07 05:31 AM
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