So I'm in the process of building my robot and it has encoders on every wheel measuring speed and position and a compass sensor measuring heading.
I have 3 seperate PID loops at the moment, I can either control the robots speed or I can control the robots position or I can make it follow a heading using a line following type algorithm.
Now I am completely stuck on how to merge these control loops, how do I control the robots heading AND its speed. So I can say to it, "go at 20 degrees at 3m/s" or "go at 45degrees for 5 metres then stop"
Really I would like to be able to control all 3, heading speed and position so I could say "go at 20 degrees for 10 metres at a speed of 5m/s" however I have no idea how to merge the loops.
At the end of the day there are 3 inputs (heading, speed and position) and 1 output (PWM to motors) so do I need to use some kind of MISO control scheme, if so which one?
I've looked at cascaded control but that only accepts 1 set point where I want to set 3 different set points. Maybe some kind of state machine? I'm so stuck!!