Robot with mecanum wheels: what wheels, motors, gear and encoder?

Dear reader,


last year I built my first robot based on Rover 5 platform and controlled by Arduino. I used it as an R & D platform an stacked it with various sensors, boards and electronics. It finally weighed 2.5 kg. Too much for the Rover 5 engines (7.2V DC / load current <160 mA / gearbox ratio: 86.8:1 / speed: 1 km/hr). The thing became annoying slow ;-).


Now I'm considering to make a second robot. One with mecanum wheels and heavier engines. The robot must not make too much noise. Should be relatively fast (+/- 5 km/hr) and should easily be able to accelerate. I expect that the robot will weigh about 3 kg.


I was inspired by and consider buying the following components:



What do you think of this combination? What can you advise me? I am most uncertain about the engines. Proper power, gearbox and encoder chosen?


Kind regards,

Ko van Schaik

The Hague, the Netherlands

**4 channel motor shield & robot control (DX8 or Ipad/Wifi) **

The first decisions are taken. This afternoon I ordered the Nexus Robot mecanum wheels and the motors suggested by Duane ( Pololu 12V DC , 150 rpm , 67:1 metal gearbox and an integrated quadrature encoder ) .

I am going to use an Arduino microcontroller. If I know better what functionality I want to make I decide on the type ( Uno , Due or Mega ). Now I am thinking about the motor shield and the robot controller.

For my first robot (Rover) I  used two 2A Motor Shields of Dfrobot . Worked fine , but two shields . For my new robot I consider the Dagu 4 channel motor controller. Good choice? What can you recommend me?

For my first robot I made a remote ( APC220 + Arduino joystick + Arduino Pro) . For the new robot I doubt between:

  • Spectrum DX8 + AR8000 receiver ( I now use for my quadcopter ) .
  • Ipad using wifi connection

What are your thoughts on this? Or should I keep it simple and start with my current remote and try to master mecanum control first?


Thanks in advance. 

Motor controller & mecanum drive control



Today I looked into motor controllers suitable for my motors (12V, stall current @ 12V: 5A peak). First thing I noticed is that they are quite expensive. Eventually I ended up with the same controller that Duane has mentioned earlier “dual MC33926 motor” ( Relatively compact, relatively inexpensive and able to supply up to almost 3 A continuous current per channel, and able to tolerate peak currents up to 5 A per channel for a few seconds. I plan to use a 3S Lipo battery (3200mA 35C). Since the 11.1 V of the Lipo is slightly lower than the max voltage of the motors (12V) I expect the maximum motor peak current to be less than 5A, the maximum peak level of the driver. Does  this make sense and what do you think my choices (lipo and controller)?

Problem I had with my previous robot was the motor speed resolution. The motor only spinned at PWM-values in the range 220 - 255. What can I expect from the configuration described above? Will I be able to use the full PWM-range?


I started thinking about mecanum motor / drive control. Google provided me with ​​a number of useful links. 

I will start with the links. But what is a good overall strategy? How to use the four different encoder values ​​and then what to do with them? Some guidance would be appreciated. 



**Voltage regulator **

With regard to the 12.6V.

An alternative is to use a 4S lipo and a 12V BEC.

Would 3S lipo in cooperation with a12V step up BEC also work (when the voltage of the Lipo is less than 12V)?


Mecanum control

Today I had contact with a local model racing shop about the 3s LiPo in relation to the 12 V maximum of the motors. They also indicate that a little too high voltage is no real problem for the engines. Therewith also my choice is made for motor controllers and battery​​.

Next point is the mecanum control. I am studying at it at the moment and it is giving me a headache;-) And I have not even thought about converting the algorithm to an actual implementation.




Slowly I start to get a grip. Still no idea however  for the incorporation of the encoder feedback (correct for slippage, measuring the actual speed, PID loop). Some hints would be appreciated.


I expect the first components sometime next week. Then also the physical work can begin.

All 8 encoders necessary?

Is it really necessary to use all 8 encoders?

What do I need the direction for?

I know them already, don’t I?


Why isn’t speed only not enough? 

Quad encoder reading => interrupts and direct post monitoring

The Mega has six external interrupt pins and I want to read 4x2 encoder signals. How can I best handle this? Of each wheel:

  • connect one signal connect to an interrupt pin
  • and the second to a non-interrupt pin,
  • and read both pins in the ISR, using direct port monitoring?

**RC-signals => motor control **


Friday I received the engines and I made a aluminum frame yesterday.




I expect the motor controllers (Dual MC33926) and the micro controller (Mega) in a week. So I already started with the reading of the PWM-values ​​of my Spektrum transmitter / receiver.


The values ​​of all three of the channels arein the range (1100-1500-1900 => resolution = 800). Is that ok? I expected a larger resolution (+ / - 1024).


Idea if course is to combine the channel/joystick-signals to the control-signals for the motors.


I still do not understand the relationships completely (formulas in red rectangles). Could use a little help here.

Thnx in advance.

Sorry about the red

Sorry about the red rectangles.

The translation formulas are:

  1. Vd = sqrt (X^2 + Y^2)
  2. Θd = tan (Y / X)
  3. VΘ = Not used

In the “rotation rectangle” I wrote:

    a.  Other kind of relation. Only used to turn the robot in stationaty state?

Duane addressed #1 and #2. “You want to compute the velocity vector based on the joystick position. The distance the joystick is from the center position is proportional to the speed. The angle the robot will travel is the angle of the joystick”. 

It is my understanding that distance corresponds to Vd and angle to Θd. Correct?
What about
VΘ ?

The assumption herby is that the orientation of the robot remain unchanged if only the translation joystick is used (no turning, only translating). What is the desired behavior if the rotation stick is used (#a)? Is the robot then standing still and turning on its axis (direction and angle => derived from the rotation joystick)? And how is that related to the formulas “behind the link” (or are they not related)?


And what about the desired behavior if both joysticks are used? Is the robot then (a) translating according to the translation joystick and (b) at the same time turning on his “translation path”?


Thanks for the explanation.

Thanks for the explanation. My understanding at this point is as follows.


I thought atan2 was not available in Arduino but I was wrong and now know that it is available via math.h.  The atan2() function computes the principal value of the arc tangent of __y / __x, using the signs of both arguments to determine the quadrant of the return value. The returned value is in the range [-pi, +pi] radians). So we are clear on Θd.

  • Θd = atan2 (y  / x)
  • all three variables of the type double.
  • x and y are the values of the translation joystick (respectively roll and pitch).



Vd is the desired robot speed, proportional to the distance the joystick is from the center position.

  • Vd = sqrt (x^2 + y^2)
  • same x and y as mentioned above



VΘ is the rotation speed of the robot and is controlled by the second joystick (the rotation joystick, yaw).

  • yaw-value < midpoint : turn left
  • yaw-value > midpoint : turn right
  • yaw-value = midpoint : do nothing
  • whereby rotational speed is proportional tot yaw-value



Assumption in the above is that both joysticks operate independently of each other. Is that correct? Are the signals of the rotational joystick (roll, pitch) indeed not mixed with those of the translational joystick (yaw)? And if that is true: what is the desired behavior if both joysticks are used at the same time? 


Ok, that’s enough

Ok, that’s enough preparation on this topic. Next step is to actual convert our analysis into a physical implementation. I’ll start with that after reception (and “installation”) of the motor controller and Mega board. Hopefully this weekend. To be continued.

Great video. Very

Great video. Very informative. I finally understand how the control “is meant” to work. Hopefully I will soon have a similar kind of video online. Still waiting for the missing parts to come in.