I have been trying to control lateral and longitudinal movement of a robot for an autonomous lane keeper project. I have no problem with the lateral movement, however I couldn2t figure out exactly how to control the longitudinal, What I have in my mind is to lower the base speed of the vehicle as the lane angle increases (sharp turns), which can be expressed as
$$ Base_{Speed}=Max_{Speed}-K_1*Lane_{angle} $$
where $K_1$ is a constant that determines how much the vehicle should beslow down.
My question is how can I proceed with this longtidual speed control considering this expression seemed very basic . As of now I have no real speed information coming from sensors (encoders), but you may assume I have.
Thank you!
Your reference speed must be Base_speed and the speed that you read from your encoders will be your output and lets call it Current_speed. You will get an error as,
Base_speed=Max_speed−K1∗Lane_angle
Error = Base_speed - Current_speed
And you need to design a controller which will give a control input to your motors.
Something like this: Control_input = Kp*error+...