# DonkeyCar Speed

Hello people,

For the donkey car I have a question about the mathematical origin of the formula of the throttle. I am clear all the transformations, but the initial situation unfortunately not. Could you please explain this to me.
Thank you very much =)

# → sin(90 +/- THROTTLE_CUT_OFF_ANGLE) = cos(THROTTLE_CUT_OFF_ANGLE) .

def figure_out_my_throttle(steering): # steering → [0:180]

``````# pow(sin()) of the steering angle is only non-zero when driving straight... e.g. steering ~= 90
t_result = math.pow(math.sin(math.radians(max(min(steering, 179.99), 0.0))), t_power)

return (t_result * THROTTLE_GAIN) + THROTTLE_OFFSET``````

Hi, I don’t remember. I think the idea was to just make a method that had a non-linear response based on the steering angle… which brings the sin() thing in. Then pow() adds the non-linear response.

I just wanted to ask if you have created a model for the rc car with regard to the control technology or have you simply determined the control parameters (PID) optimally by trial and error. So with my car it shows a strong vibration behavior. That’s why I wanted to ask if you have created a model for the controller design .

Thank you very much =)

You have to tune the PID constants yourself through trial and error.