I'm using the VESC Tool as a controller for a motor that is being used to test flexible drive shafts. I like the feature of picking a desired RPM, but when I get to higher RPMs, I have to manually ramp up the motor speed so I do not break the shaft. Is there a way where I can enter my desired RPM and the motor will accelerate to that speed uniformly over a finite period of time?
We would really love a bit of guidance. Thanks!
I know the PPM input has a ramp time on it, probably wouldn't be that hard to copy that code and add it to UART control or something. I don't think any of the other inputs have ramping on them.
Not sure these ramps should be on the input but rather than the output. If the stick remains at the same position but the motor, due to external factors, did change its rpm - e.g. a lot of load was applied so it almost stopped - you still want to have it ramp up the rpms slowly.
Does that apply to Speed PID only? What about duty mode in above example? I would argue the ramp should work in all cases.
Ramp makes no sense in duty mode as it isn't a control loop.
RPM is a control loop. You can dampen the PID by reducing the P value. Or try to be more clever and improve the algorithm.
I guess you could run in current mode with a duty cycle or erpm limit, then you would have control over how fast the span up.
I don't buy into that one. First because P does not give you a linear acceleration, it just says output = p * current_error. So it is a curve.
But that is beside the point. Let's say you can configure the PID values so that it picks up the speed more slowly. Then the entire control loop would be very sluggish and slow. That's not what you want. It should react quickly to changes in load to keep the current speed constant. And you want it to be slow with input changes. It can't do both.
Don't agree here either. If the current duty is 50% and in the next cycle it is 100% because I cranked up the throttle, can't it increase the duty value slowly?
Of course, in duty mode increasing the stick input slowly and increasing the duty value slowly is the same thing. But that's actually my point: Isn't the ramp logic better placed in the output than filtering the various inputs?
The main difference between the two is that the PID would increase the speed linear, in duty the energy would increase linear. But both would avoid high forces on the shaft due to abrupt changes.
Well, this is what I mean. This is what you can do now with the tools at hand. (Low P value isn't great for the reasons you pointed out)
For the rest, it's opensource. I would start at the rpm control loop. But you could totally add a Δ-t for current or duty filter.
I will take a look and see where you might put the Δ-t. Would be easy to add one purely in firmware, adding it to vesc tool is a bit more difficult.
You got an idea of the ramp time you need?
Ramp time should range between 2 and 5 seconds
It sounds like what you need is a torque limit? Since torque is directly proportional to current, just limit the motor current! Torque [Nm] = Kt ⋅ I [A], where Kt is the motor torque constant. Kt = 1/Kv, if Kv is expressed in SI units [rad⋅s⁻¹⋅V⁻¹].