You are here

Acceleration control to desired RPM

10 posts / 0 new
Last post
bjohns
Offline
Last seen: 6 years 4 months ago
Joined: 2018-07-20 22:03
Posts: 2
Acceleration control to desired RPM

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!

TechAUmNu
Offline
Last seen: 2 months 3 weeks ago
Joined: 2017-09-22 01:27
Posts: 575

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.

wdaehn
Offline
Last seen: 3 years 2 months ago
Joined: 2017-09-12 17:26
Posts: 65

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.

Tilman Baumann
Offline
Last seen: 5 years 3 weeks ago
Joined: 2018-02-12 11:53
Posts: 49

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.

TechAUmNu
Offline
Last seen: 2 months 3 weeks ago
Joined: 2017-09-22 01:27
Posts: 575

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.

wdaehn
Offline
Last seen: 3 years 2 months ago
Joined: 2017-09-12 17:26
Posts: 65

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 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.

 

Ramp makes no sense in duty mode as it isn't a control loop.

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.

 

Tilman Baumann
Offline
Last seen: 5 years 3 weeks ago
Joined: 2018-02-12 11:53
Posts: 49

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.

TechAUmNu
Offline
Last seen: 2 months 3 weeks ago
Joined: 2017-09-22 01:27
Posts: 575

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?

bjohns
Offline
Last seen: 6 years 4 months ago
Joined: 2018-07-20 22:03
Posts: 2

Ramp time should range between 2 and 5 seconds

arvidb
Offline
Last seen: 5 years 5 months ago
Joined: 2018-01-16 23:09
Posts: 77

I have to manually ramp up the motor speed so I do not break the shaft.

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⁻¹].