I want to build a mecanum type robot and instead of using a joystick to control it, I want to send it commands programmatically. In other words, if I calculate a directional angle that I want it to move in, how do I figure out what direction and PWM signals to send to each of the four motors?
Let's say 90 degrees is forward, 0 is right, 180 is left and 270 (or -90) is backwards. Any other angle would move it somewhere between these quadrants. I believe that the PWM signal would vary the speed of the wheel and that by giving the 4 wheels the correct direction and speed, it should move exactly as I want it to.
Do I need to control each wheel separately or do i control them in pairs?
Scott