Page 1 of 1

Stepper moto contolled acceleration and deceleration

Posted: Thu Jun 21, 2018 9:54 am
by pjpac
I'm new to phidgets and I'm modifying a program written in java to control a NEMA-17 Bipolar 32mm Stepper running in continuous mode and connected to a PhidgetStepper Bipolar HC ID: 1067_0B which itself is connected to my laptop running on windows. I'm using NetBeans. So far so good, the sequences "velocity, time" work OK but I also need to control the acceleration (and deceleration).
I use stepperPhidget.setAcceleration(0, double) and the acceleration is under control when the speed increases to a value that has not been reached at an earlier step of the sequence. However when a step n+1 involves a lower speed than step n, instead of decelerating progressively, the stepper jumps to the lower speed. Intriguingly (at least to me), the stepper also jumps to the higher speed if the speed of step n+2 is between the speeds of the steps n and n+1, while if the speed of step n+2 is larger than the speed of the step n, the stepper will jump to the nth speed value and will start to accelerate progressively from then on to reach the targeted speed. For instance,
n1: 0 to 500 rpm is progressive,
n2: 500 to 250 rpm is a jump,
n3: 250 to 750 rmp is completed as a jump from 250 to 500 rpm and progressive from 500 to 750 rpm.
This is reproducible as soon as the stepper is disengaged and next re-engaged.

It seems a bit odd but being new I might be missing something important. Eventually, I plan to set sequences of "velocity, time, ac/de-celeration", but starting to program acceleration and deceleration sounds like trying to reinvent the wheel, and I would definitely welcome any comments and suggestions.

Best wishes

Re: Stepper moto contolled acceleration and deceleration

Posted: Thu Jun 21, 2018 11:50 am
by fraser
This is a known bug in the stepper, and "steps" are being made to correct the problem. Both of your noted scenarios are problems. Additionally, setting n+1 to a lower velocity, and n+2 to a velocity in the opposite direction, it jumps back to n and decelerates down to n+2 (similar to your 2nd scenario). This was a problem introduced with the recent inclusion of Run Mode

I wish I could provide further information than "we are looking into it, please stand by"

Re: Stepper moto contolled acceleration and deceleration

Posted: Thu Jun 21, 2018 11:58 am
by pjpac
Thanks for your quick reply. I'll see to get organize to adjust to the situation and I will keep an eye open for a more definitive option when the bug is eventually fixed.

Best wishes

Re: Stepper moto contolled acceleration and deceleration

Posted: Fri Jun 22, 2018 11:30 am
by Patrick
This will eventually be fixed with a firmware upgrade.

-Patrick