Smooth Steering for RC Car

Entering the Sparkfun 2011 and 2012 Autonomous Vehicle Competitions, my mbed-controlled 1:10 scale RC truck needed smooth, predictable steering when navigating from one waypoint to the next or whenever it needed to change heading.

I wanted a way to decouple steering calculations from the underlying vehicle details. The steering calculation is independent of vehicle's track width and steering geometries. I also didn't want to waste a lot of time with trial and error and felt that mathematically modeling the situation might help.

The approach, despite some drawbacks, seemed to work very nicely (the robot placed 3rd in 2012!) and I basically got the steering right the first time and never really needed to think about it again. It just works. Here's the skinny.

Let's say your robot is traveling along a path, and needs to get to a waypoint at a bearing of theta degrees. I define an intercept distance, I, along the line between the robot and the waypoint and solve for a circle of radius r such that the current path is tangential to the circle, and the circle intersects the waypoint path at distance I. The robot then calculates a steering angle to drive along the arc between its current position and I.

https://lh5.googleusercontent.com/_59HHJuZw_Rk/Tbhh9Q7_goI/AAAAAAAACVM/swMnPYiMG0s/AVC_Steering.jpg

By selecting a fixed intercept distance, then the robot has to calculate the front tire steering angles in order to achieve a turn of radius r. Some readers may notice similarities to the Pure Pursuit path following algorithm.

The main difference is that instead of intercepting a point that lies along a path between waypoints at a fixed distance from the robot, instead, the robot choose a point along the path between the robot and the next waypoint. Thus, coding is considerably simpler.

Knowing the track width and by measuring steering angles as related to steering servo pulse widths, one can then translate steering angle into servo pulses very easily. I found that there's a nearly linear relationship at least until about a 20 or 25 degree steering angle. So once I have the calibration constants, I never have to think about vehicle geometry again.

One downside to this algorithm versus Pure Pursuit is that it doesn't correct cross track error. If the robot finds itself off the desired course, well, too bad.

Additionally, most RC vehicles have a small dead band in their steering around the center point due to slop in the steering linkages, resulting in cross track drift on sidehills, or if vehicle steering alignment is off center.

The cross track error shows up as a tiny heading error at long distances and a big heading error at short distances. So the algorithm won't be able to correctly steer to the waypoint until it's very close to it. And if the drift is significant enough, cross track error will grow rapidly, uncorrected.

Adding a steering angle gain around the dead band will help with this issue. Though I haven't tested it, adding waypoints closer together should also improve performance.


Please log in to post comments.