I am not a controls engineer.
I have written a motion controller for a 2 axis commercial actuator.
The controller must respond to two unpredictable user inputs:
DriveOpenLoop(v1, v2)
DriveClosedLoop(x1, x2, v1, v2)
The user-inputs come in via serial at 9600 baud, which is pretty slow.
The speed is not expected to be highly precise, and is never measured with any precision.
The system is very highly mechanically damped
The motors are steppers
The control output is a PWM output through this driver to the stepper motor.
The open loop controller does this
The closed loop controller does this
So everything is great, but I'm going to be making a new system and there is a chance to try to get better.
Question 1:
Should I be clamping jerk?
The trapezoids are theoretically sharp and have theoretically huge jerks. This matters because the units often have cameras mounted on them which want to be smooth, and jerk can affect the likelihood of stepper slip. But it seems to me that just discrete time differentiating the acceleration is misleading, because the real-world, physical jerk is driven by the response time of the PWM output pin and the motor driver. n other words, the dt in da/dt is not really the controller time step, but just the time it takes the PWM and controller system to move from one set frequency to the next
Question 2: Is there a much better way to do this without dramatically increased complexity?
I was pretty excited looking at motion planning using boxcar filters ( Motion Profiling - Technical / Programming - Chief Delphi ). The problem I had with it was that I couldn't figure out how to start one of these profiles from a non-zero speed--just couldn't figure it out. Question 2 is pretty big, but if you could just point me to some literature or some google keywords it'd be helpful.
I have written a motion controller for a 2 axis commercial actuator.
The controller must respond to two unpredictable user inputs:
DriveOpenLoop(v1, v2)
DriveClosedLoop(x1, x2, v1, v2)
The user-inputs come in via serial at 9600 baud, which is pretty slow.
The speed is not expected to be highly precise, and is never measured with any precision.
The system is very highly mechanically damped
The motors are steppers
The control output is a PWM output through this driver to the stepper motor.
The open loop controller does this
- Load target speed
- Clamp acceleration
- Write set speed to PWM out
- Try again on every loop until you reach the target speed
- Deal with cyclic position and position limits
The closed loop controller does this
- Load set point
- Deal with cyclic position
- Calculate error
- Multiply by proportional gain to get set speed
- Clamp velocity
- Clamp acceleration
- Write set speed to PWM out
- Deal with user position limits
So everything is great, but I'm going to be making a new system and there is a chance to try to get better.
Question 1:
Should I be clamping jerk?
The trapezoids are theoretically sharp and have theoretically huge jerks. This matters because the units often have cameras mounted on them which want to be smooth, and jerk can affect the likelihood of stepper slip. But it seems to me that just discrete time differentiating the acceleration is misleading, because the real-world, physical jerk is driven by the response time of the PWM output pin and the motor driver. n other words, the dt in da/dt is not really the controller time step, but just the time it takes the PWM and controller system to move from one set frequency to the next
Question 2: Is there a much better way to do this without dramatically increased complexity?
I was pretty excited looking at motion planning using boxcar filters ( Motion Profiling - Technical / Programming - Chief Delphi ). The problem I had with it was that I couldn't figure out how to start one of these profiles from a non-zero speed--just couldn't figure it out. Question 2 is pretty big, but if you could just point me to some literature or some google keywords it'd be helpful.