Balancing DC motors

Good morning, I am new to electronics and have managed to build a basic bluetooth controlled car with dufferential steering. It works well but pulls to one side as one of the motors is slower. Both motors have sensor rings but I do not know what I need to utilise them. Please could someone point me in the right direction.

Post info on motor and sensor rings...

Hi build_1971,

This is a TT DC Gearbox Motor with a gear ratio of 1:48, and it comes with 2 x 200mm wires with board-friendly 2.54mm(0.1") male connectors.
Perfect for plugging into a board or terminal blocks.
Specification:

Rated Voltage: 3~6V
Continuous No-Load Current: 150mA +/- 10%
Min. Operating Speed (3V): 90+/- 10% RPM
Min. Operating Speed (6V): 200+/- 10% RPM
Torque: 0.15Nm ~0.60Nm
Stall Torque (6V): 0.8kg.cm(Approx.)
Gear Ratio: 1:48
Body Dimensions: 70 x 22 x 18mm(Approx.)
Wires Length: 200mm 28 AWG

The sensor rings look they are intended for use with slotted opto sensors but don't have these fitted. How are your motors driven and from what voltage?

So you need to add something to 'sense' how har the wheel moved. The ring may be used with a led and a phototransistor to produce pulses that are proportional to the movement. In your code you can monitor the pulses and control the wheels accordingly.

= slotted opto interrupter.

The little video seems to show your motor too...

1 Like

A much simpler alternative to sensing wheel or motor RPM is to use a digital compass (magnetometer) for steering. Adjust motor speed so that the heading (direction of travel) is constant.

Magnetometers have to be calibrated in place to be used as compasses.

Thank you, how would I code these? I'm currently usung an arduino uno, 1sheeld and motor shield.

Regardless of whether you use wheel sensors or magnetomoeters, the motors need to be controlled by PID controllers, to be able to effectively control them with any precision whatsoever. The Arduino PID library can to the job, but properly tuning the PID will require some study to understand how to do it properly. Nobody can tell you what the proper coefficients are for your particular hardware.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.