# Algorithim question: 4 wheel steering and power

I am making a prototype drivetrain in which all 4 wheels are (independantly) powered and al four wheels can swivle. The rear 2 wheels will always stay paralell and the front two will always stay paralel. Is there a standard algorithm for a software differential that takes into account the angle of all four wheels, and the desired speed and outputs the indevidual speed needed for each motor?

Are you considering 360° swivelling action on each wheel (i.e. swerve/strafe drive), or something like Quadrasteer (i.e. double-Ackerman, which, I believe, 301 implemented in 2004)?

Actually, true Ackerman steering (i.e. car steering) doesn’t keep the wheels parallel; there’s a small angle between them to compensate for the differing radii of curvature of the paths of the left and right wheels, during a turn. To create this angle, you can either implement a mechanical linkage at either end (like a car), or instead, drive the rotation of each wheel independently (rather hard with only a few motors); if you don’t care about a little bit of wheel slip (which increases with the sharpness of the turn), you can keep the wheels parallel, and just deal with the speed (like a differential).

So, I would guess that the algorithm would involve finding the radius of curvature of the outside wheel’s path, then subtracting the track width, and multiplying the speed of the inside wheel by that ratio (slowing it down, because of the shorter path length in a given turn). I suppose you could derive this from the intended speed and direction, but I don’t pretend to know how.

:edit:

I dont care about a little wheel slip caused by different radius while turning. If i get the algorithm correct the slip should be minimal because the motor will be driving the wheel less in the inner wheel then the outer.

i mean 360 swivel. However, i plan on having these wheels in all sorts of different directions. I need an algorithm that will produce when the front wheels are at 25 degrees and the rear may be at -20 degrees (arbatrary numbers). Or when the front are at 45 degrees and the rear are at 40 (almost a perfect strafe but with ust a touch of turn) The front wheels will be mechanically linkes together as far as turning and so will the rear wheels.