Stepper moto contolled acceleration and deceleration
Posted: Thu Jun 21, 2018 9:54 am
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
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