I have built a 4 legged theo jansen walker similar to the one in this picture.
However instead of servos it uses geared electric motors powered via escs to turn the wheels connected to the legs, each leg is seperatley controlled and has a rotary encoder and limit switch to tell how far/fast the leg is moving.
I want my walker to have a similar gait to the walker in this video...
IE each leg will move slowly while on the ground but quickly step forward when off the ground.
To do this I have made a function that gives an ideal position that the leg should be in at a certain time (basically a timer multiplied by a coefficient to give the angle the geared motor should be at)
What is the best way to ensure that (given the information gleaned from the encoder and the ideal position given by the function) that the leg position matches the ideal position as best it can?
I can't just give a constant figure to the esc as when the leg touches the ground it will slow down so I need feedback from the encoder to adjust the escs power.
My first reaction was to pid the difference between the current position (the input) and the ideal position (the setpoint).
However the setpoint is obviously constantly moving so pid gives it this constant lurching movement, not good..
My next idea is to pid the speed; find the speed the leg should move through the slow section of the leg movement arc and ensure it maintains this via pid.
I would also have a higher and lower setpoint speed to be used if the leg current position didn't match the ideal position; ie if the leg is moving at the correct speed but is behind the ideal position due to a slow start the setpoint will be increased till the leg actual position matches the ideal position at which point the speed setpoint will be reduced to the normal ideal speed for the legs slow movement.
This is my plan so far but I would love opinions on it or suggestions on better ways of doing it.
Any thanks in advance.