duty_cycle control vs current_control

@b264 why the :-1: reaction?

Ironically i asked the same thing in DM.
was a thumbs down on discord relative to forums.

Because answers are ephemeral. They’re not publicly searchable and don’t further the knowledge pool of the public. It’s like answering a problem in a PM

guess is should have asked publicly. :smiley:

3 Likes

I think I still have some margin. I am still using old Unity app so I can only put 100A max per motor. I am hearing everyone to put there at least 120 so would like to try.

But is it really 30A per motor for you? That seems impossible, it would be super slow.

I think exway advertises battery current? So it would be 30A battery current per motor, with an unknown amount of phase current. Correct me if I am wrong though

1 Like

When changing PID control parameters to gain better acceleration, should throttle be used as “current” control, or duty cycle?

above we are discussing tunig pid for current control.

you likely don’t want the regular duty_cycle control. it seems to be all throttle no brake. and 50% throttle is neutral on our remotes.

1 Like

Just one more question. I’m a beginner im Vesc, and it puzzles me. On tab motor cfg, general, where we choose bldc, foc,…atc., I’m on foc choise. But, if I go to PID control tab, change parameters and hit “write”,…is it still foc in use and all parameters that I setup on foc tab’s,…or is it now on PID control?

the current tab you have selected in vesc tool doesn’t change anything about the configuration you’re writing

1 Like

I considered writing this code some more but came to the same conclusion, that I don’t have the experience or hardware. I have passed this on to the vesc discord. I linked this post and explained how I coded this behavior for onewheels. Hopefully some one else finds this interesting and picks it up.

4 Likes

You can definitely feel more punch on duty cycle as you get more phase amps with less throttle . And it feels like it has very low ramp time. But if you press full throttle with current mode the punch is the same . With duty you get it sooner. But the maximum power/torque is the same on both modes.
I have created a custom control mode that uses duty cycle for acceleration and current control for braking :stuck_out_tongue:… Duty cycle control is very dangerous on esk8 but it might be useful for drag racing

4 Likes

I checked the code today, if you set the ramping time to 0.00 it goes off. Duty cycle mode and current mode use the same ramping time from the ppm tab. I tried duty cycle mode and it felt unrideable tho. Maybe someone with racing experience can ride it :racing_car:

This is another mode in vesc called pid speed control. With this mode you can tune the pid loop from Motor settings->pid controllers->speed controller. You have to pick the max erpm from the ppm tab first. Have you guys tried it?

3 Likes

Here is how to change the pid settings for the current control. First the current controller in vesc has only p and i not d. It is PI not PID.
And the best way to change P and I values is from the vesc foc calculator.
Basically, when you lower the time constant, P and I take higher values. And the controller becomes more responsive!
According to the vesc tuning guide a good value for the time constant is 400us*(stock is 1000us)
*The guide recommends 400us so i don’t think it is wise to go any lower unless you have a dyno and can test it. Lower time constant values might cause oscillations.

Also here is how the vesc foc calculator works
T = time constant (here it is in seconds not μs), L = inductance, R = resistance

 b = 1 / T
 Kp = L * b
 Ki = R * b

So for example change the time constant(T) from 1000us to 400us and then press RL, λ, apply and write like in this video . You will have to do it for both controllers. My Kp went from 0.0200 to 0.0500

2 Likes

love that you’re digging in here.
sad I haven’t had the time to really digest it.

1 Like

@Skyart want to put that dyno to use for science? :grin:

4 Likes

i’ve had wonton and i think all team SKP race boards were detected manually with <500us time constant :wink:

6 Likes

Yes science will be performed

4 Likes

link?

And what has been the result of that?

well

that depends👀
at best we’ve been doing manual detection to run high kv kn hv better?

2 Likes

It is Mxlemming’s vesc guide .Basically for responsiveness there are two things you need to tune, the current control pid(or pi) and the observer gain if you are running ortega original.

You can do a test, if you put a very high time constant on the master controller and a low time constant on the slave. And push the throttle, the difference is clear.

4 Likes