# Lateral Acceleration to steering controller

Hi, I’m looking for some explanation about the controller that takes lateral acceleration from L1 controller and output command to the steering motors. Is it a PID controller? Is acceleration on the body Y axis the measured variable? is angular velocity the output of that controller?

Thank!

Hi @elgarbe,

The AR_AttitudeController’s get_turn_rate_from_lat_accel function converts a lateral acceleration (and forward speed) into a turn rate. If you search through the code you should find a couple of places where this conversion is used to turn the output from the position or navigation controller into an input that the lower level turn-rate controller can accept.

Oh, ok, so the low level pid controllers are for forward velocity and for angular velocity (turn rate)?

1 Like

yes, that’s right. There is a vague plan to add a lateral velocity controller for omni vehicles but no coding has been done yet.

Ok, understand. And what about linear velocity? is it a PID that try to get the distance to the next desired point equal to 0, outputting a linear velocity to the motors?
how about the mixing of the output of each controller?

Thank!

We have some rover information on the dev wiki here although the page on navigation still talks about the L1 controller which has been replaced by “SCurves” in 4.3.

I guess when you say, “linear velocity” you mean, “how is the vehicle’s forward speed controlled?” and the simple answer is that there are multiple levels.

1. There’s a navigation layer (AR_WPNav) that uses SCurves to calculate the desired position, velocity and acceration at each moment on the journey from the origin to the destination.
2. Then there is a position controller which uses a PID controller which is responsible for calculating the turn rate and forward-back speed to move the vehicle from wherever it actually is to be at the position, velocity and acceleration provided by AR_WPNav.
3. Then there are two low level controllers (one for turn rate, one for forward-back speed) which use PID controllers to convert the desired turn rate and forward-back speed into high level steering and throttle outputs (expressed as percentages).
4. These two outputs are then passed into the low level AR_MotorsUGV class where they are converted into individual motor and servo outputs.

@rmackay9, thank for the information. I would like to take a look at point 2. Is there some theory about the implementation? if not, can you point me out to the code of this controller?
What about scurves, have you got a paper or some other theoretical information?

Thank

Hi @elgarbe,

Here are some links that may help