The setup:
Rectangular platform with two sensors providing pitch and roll angles. Four articulated legs at the corners with actuators controlled by the software. Actuator position feedback is also available.
Using manual actuator control the platform is moved into some random position while standing on flat horizontal surface. The two angles and an average of the actuator positions recorded. Then the contraption is moved onto randomly inclined surface.
The goal:
Given previously recorded triplet of parameters move four actuators to get the platform into position with same attitude and same average altitude, with all four legs firmly on the ground.
The caveat:
The CoG of the platform is offset towards "rear" legs. As you probably already noticed, this makes the goal nondeterministic with four legs. With three legs the distance and two angles exactly define the solution regardless of CoG location. Furthermore, moving one leg changes pitch and roll, which are input values for other legs as well. This creates a crosstalk that potentially can cause oscillations without heavy dampening.
The ideas:
So far I came up with three possible implementations:
- Use four independent PID controllers. For each calculate an error as sum of 3 weighted errors (roll, pitch and height).
- Use three independent PID controllers for roll, pitch and height. Mix their outputs into four control signals.
- Use cascaded controllers for roll, pitch and height with the output of one stage mixed into the error of the next.
The question:
Am I on a right path with any of these, or am I completely off the rails?