uStepper / uStepper-S-lite

14 stars 4 forks source link

uStepper S-Lite does not return STOP after movement #4

Open Nestilaos opened 4 years ago

Nestilaos commented 4 years ago

The actual release has an issue that moveToEnd() or moveSteps() do not return getMotorState()=STOP after movement in mode = NORMAL.

This is specially the case when the maxAcceleration is set greater than 1000. Instead of STOP, getMotorState() returns several seconds DECEL before STOP is returned.

Any idea to fix this issue?

Thanks in advance. Regards.

Nestilaos commented 4 years ago

Hi, nobody else confirming this observation? Another observation is that the returned angle is always zero in NORMAL mode.

Nestilaos commented 4 years ago

The problem still exists in the newest release. In fact, it only emerges in case of motor hardStop/softStop. There seems to be a problem with the DECEL phase.

The condition in TIMER1_COMPA_vect for switching from DECEL to STOP seems to be met about 10 seconds after the motor has stopped. There seems to be a mismatch in steps of about 50-100 steps.

Unfortunately, I could not find the source for this issue, but hopefully someone else.

chavasse commented 4 years ago

I have the same issue with getMotorState() returning DECEL (8) for several seconds after it has stopped moving, rather than STOP (1) or 0 Have not been able to identify the cause from source

chavasse commented 4 years ago

This seems to happen after longer/faster movements of the motor, short distances seem to return correctly.