Steering Equation - TarkanAl-Kazily/2015-16 GitHub Wiki
November 14, 2015
We had our first meeting discussing what an equation to control how to steer with the articulated steering system chassis team is designing.
We found through geometry and trigonometry that the angular velocity (the radians per time traveling around the circle) is equal to the tangential speed we want at the center of the circle (ds/dt given by the y-axis input) times a large equation:
dθ/dt = ds/dt * sin^2(θ)/[a * (sin(θ) - θ) * (cos(θ) + 1)]
By the definition of radians:
ds/dt = dθ/dt * k
If the distance from the center of the turning circle is k, then the distance from the inner wheels to the center of the turning circle is (k - L/2) where L is the distance between the wheels. The distance from the center of the turning circle to the outer wheels is (k + L/2).
So the speed of the inner wheels can be represented by:
di/dt = dθ/dt * (k - L/2) = ds/dt - (dθ/dt * L/2)
For the outer wheels, it becomes +, not -.
do/dt = dθ/dt * (k + L/2) = ds/dt + (dθ/dt * L/2)
So if we want to turn in a circle with pivot θ, then we can use these equations to find the wheels speeds of the inner and outer wheels. The outer wheels are on the left if θ is positive, and on the right if θ is negative.
Since we have a potentiometer measuring θ at the pivot, we know what the turning radius is at all times. If we want to change our pivot while moving forward, we simply change what our input θ to θ' is to our equations. Since the ratio of the wheel speeds changes the turning radius, this makes our robot turn with a new angle θ'. Using our x-input from the joystick, you increment or decrement θ before inputting into our function. That way, if the x-input is 0, θ will not change and the rover stays in the same turn.
If θ' would be outside of physical bounds for the rover, simply clip the value within a set of safe bounds. If θ' is too close to 0, the calculated radius of curvature increases without bound, so set the wheel speeds equal below a value θ small.