0
\$\begingroup\$

I need to drive 4 small traction DC motors on a 4WD robotic platform from my C++ code which runs on x86 only. I already use the Tinkerforge Servo Brick (it has C++ API) for one servo and I wonder whether this board is capable of driving the 4 small traction motors of the robot with PWM.

If this is not possible, then Tinkerforge has a dedicated DC Brick that drives a single motor. Could I use 2 of these bricks then - one for the 2 motors on each side of the robot? Alternatively I could only use 2 motors for propulsion (one on each side) which should make things a bit simpler.

\$\endgroup\$
1
\$\begingroup\$

No. Hobby servo control is not the same as the control of a DC motor.
PWM in a hobby servo isn't quite normal PWM. The pulse width determines the POSITION of the servo, and it's relatively low frequency. In a sense, the PWM signal is just a code passed off to the REAL controller, which lives in the hobby servo package. In a DC motor control, the average value of the PWM is going to be linear with how the motor moves (It's highly related to motor velocity under constant load, but it's more likely something like torque). It's really a very different control strategy. You can't drive a DC motor with something designed to produce the signal that drives a hobby servo.

I would advise against Trying to drive two motors with one DC motor controller, as you would need to figure out how to handle any feedback signals. You either average the two motors, or control one motor and have the other run open loop.

You should find a controller designed to handle 4 DC motors, or use 4 controllers designed to handle one motor.

\$\endgroup\$
  • \$\begingroup\$ How does the PWM used by a real motor driver look like then? The Servo Brick has a fully customizable PWM (period + pulse start/end) - thought it is true one would need to take care of the motor acceleration characteristics etc. which a dedicated controller can do by itself probably? \$\endgroup\$ – Kozuch Sep 15 '16 at 14:05
  • \$\begingroup\$ PWM in a hobby servo isn't quite normal PWM. The pulse width determines the POSITION of the servo, and it's relatively low frequency. In a sense, the PWM signal is just a code passed off to the REAL controller, which lives in the hobby servo package. In a DC motor control, the average value of the PWM is going to be linear with how the motor moves (I think it's motor velocity, but it's more likely something like torque). It's really a very different control strategy \$\endgroup\$ – Scott Seidman Sep 15 '16 at 15:24
  • \$\begingroup\$ I understand what you mean, but it seems like the Servo Brick also can output a plain PWM (which may be used for other things than controlling servos). Is the only thing that matters with PWM for DC motors the duty cycle? If so, it seems like the Servo Brick could handle it... \$\endgroup\$ – Kozuch Sep 15 '16 at 19:19
  • \$\begingroup\$ @Kozuch You could certainly try... it actually says brushless with ESC -- but that's not what you have. But, it also says that the PWM freq can go up to 1kHz. I would bet you'd still need a driver stage, though. The PWM signal won't drive a big current all by itself. Have you tried posting to the forum that actually supports those devices, and asking there? \$\endgroup\$ – Scott Seidman Sep 15 '16 at 21:01
  • \$\begingroup\$ Yes the amount of current may be an issue. And yes, I posted to their forums, got no reply yet. Given I will go the dedicated controller route I wonder whether it is better to go with (radio grade) ESCs with that Servo Brick or to go with multiple DC Bricks... the solution with ESCs may be way cheaper than 2 pcs of Servo Bricks actually. I guess both will give the same functionality. \$\endgroup\$ – Kozuch Sep 15 '16 at 21:24
1
\$\begingroup\$

What you need is an ESC (Electronic Speed Controller) for each pair of motors, controlled by servo signals from the Tinkerforge Servo Brick. The two motors on each side of the robot platform should be connected in parallel so they operate together (there is no point having separate control because if the motors aren't going at the same speed in the same direction then the wheels will just skid).

Each ESC needs to have the following specs:-

  1. Designed to operate brushed DC motors.

  2. Controlled by hobby servo signal (1~2ms pulse every 20ms).

  3. Bidirectional control without reverse braking function.

  4. Rated for enough current to drive two of your motors.

This type of ESC is commonly used in RC cars and boats. Car ESC's usually have a brake function in reverse, which can often be turned off by programming the ESC for 'rock crawler' mode.

The ESC has power input wires for connecting to a dedicated motor battery. Many ESC's also have an on-board BEC (Battery Eliminator Circuit) which is a regulator that drops the motor battery voltage down to 5~6V to run a receiver and servos. To prevent this BEC from interfering with the Tinkerforge Servo Brick's own supply voltage, you must disconnect the center (red) wire from each ESC's servo plug.

Here is a suitable ESC that several vendors are selling on eBay:-

RC 10A Brushed ESC Motor Speed Controller No Brake For 1/16-24 Car Boat F05427

enter image description here

\$\endgroup\$
  • \$\begingroup\$ Thanks for nice answer! I cant really find a suitable ESC without the brake function (ordered pair of these - not sure the brake can be turned off). Why do you think is brake a problem with my usecase? \$\endgroup\$ – Kozuch Sep 19 '16 at 9:27
  • \$\begingroup\$ An ESC with brake function brakes the motor when you go in reverse. To go backwards you must first brake, then return to neutral, then reverse again. This process could be automated, but adds a delay when switching from forward to reverse. \$\endgroup\$ – Bruce Abbott Sep 19 '16 at 17:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.