UNO R3 car wheel calibration

I am trying to understand if car wheel calibration is a common issue. Ran inito car wheel alignment issue:

Tested wheels moving forward and backward fine using digitalWrite ( High and Low settings)

Car can move in straight line forward and backward.

However, in moving left or right, one motor seems to have higher friction to overcome, when both motors set at the same speed to move forward the car ends up in a circle due to that fact.

If the speed of the overpowering motor is reduced, the other motor would stop moving

Swap left and right motors, seems to improve a bit, forward is still veering due to the same overpowering motor, backward can go straight.

Would appreciate any advice to overcome this issue before perhaps exchanging the weak motor, or later on the micro-controller chip.

Pleasae read and use this link: How to get the best out of this forum - Projects / General Guidance - Arduino Forum

Schematics and code are requested.

It is common for DC motors to run at different speeds when powered from the same source and they may run at different speeds again when running in different directions. To complicate things further the wheel diameters and hence circumferences may also be different

The classic way to deal with these problems is to have some feedback of wheel position and to adjust the motor speeds using a PID controller to keep the wheels synchronised. You may also have to incorporate a correction for the different wheel circumferences

Even with all of this the wheels may slip on the running surface particularly when accelerating and/or be running in different surfaces depending on the environment

An alternative method would be to use a compass to measure the absolute angle of the robot so that deviations can be measured and corrected for. This is also helpful if/when you want to turn the robot through a fixed angle such as when turning a corner

As you can see, things can get very complicated

The kit is SunFounder 3-on-1 Ultimate Kit for Arduino Uno R3. The controller board is R3 board. The motor is TT motor (2 pc). I am in the process of completing the car assembly, successfully move the car forward and backward (no veering) with no speed parameters. When trying to the do the "follow the line" exercise which requires speed control, I found out one motor has very high friction to overcome, it would not move at speed under 200, even at speed 300 it still gets overcome by the stronger motor causing the car to veer. I tried the calibration routine provided but it did not rectify the issue. When swapping motors, the problem persists although the car can at least move backward without veering. My assessment is that the weaker motor needs to be replaced (your advice might change that of course). However, one disturbing observation is that when I tried to reduce the speed of the stronger motor it would adversely impact the weaker motor causing it to stop even at high speed. This could be a controller board current leaking issue? Is the wheel differential a common problem? Your advice would be much appreciated.

From my testing and calibration, it is obvious one motor is weaker than the other causing the veering. Arduino does provide calibration routine but it did not help. Thanks for your input, any further insight would be great!

It sounds like you may have a hardware problem in addition to all of the factors that I mentioned

If you mean the differences in circumference between wheels, then yes, but it is usually quite small and only causes problems when the motors are run for a relatively long time, during which the difference accumulates until it causes a problem

The need to run in a straight line is only a problem when doing dead reckoning in an open space. Often a robot will be following a line or a wall so slight differences in wheel speed do not actually matter, but the performances of the motors must be at least close to being the same and it sounds like yours aren't

One other thing not to be ignored is that motors can take a large current which in turn affects the supply voltage which then affects motor performance. Where are your motors getting their power from ?

Not common. Inevitable.

Expensive motors will have less difference between them, cheap motors will have more difference. From your description, one of the motors might indeed be considered faulty.

Even with expensive motors, encoder feedback is needed to adjust for the difference between motors, and even that cannot guarantee moving in a straight line because of wheel slip.

This is very common, and explains why wheel encoders and PWM speed control are used for accurate steering.

As mentioned above, you may also have a mechanical problem with one wheel, but there in not enough information in your posts for anyone to be sure.

Its just a kit sold under $100. : )

I tried all the debugging and calibration, the weaker motor I am concluding is the issue. Thanks!

I don't really need a perfect straight line, just no severe veering so I can complete the "follow the line" exercise. : )

Does your kit have wheel or motor encoders?

They are required and not difficult to add. If there is room, use motors with encoders like these instead.

One of the motors may indeed be faulty but I can guarantee that without feedback you will not be able to ensure that they rotate at the same speed given the same input voltage or PWM signal

How are the motors powered ?

Powered from GND and Vin from the controller board. I don't need a perfect straight line, just no significant veering so the car can move following a line.

Where does Vin on the controller board get its power from ?

Its a mid-range kit, no encoders included. No perfect straight line needed if I can minimize the veering which is significant.

The usual solution has been described several times now. Have fun!

Motors with brushes have a spin direction preference.
Make sure you power both motors with the same polarity.
Flip the yellow gearbox if the motor spins the wrong way (assuming you have a yellow bi-axial motor). Also connect the driver to PWM pins with the same base frequency.
Google "arduino uno pwm frequency"
Leo..

  • Mark a start point.
  • Mark a preferred end point ("straight" in front of the car)
  • Mark a perpendicular "finish" line along the end point.
  • Set your code to start going "forward" five seconds after you release it.
  • Point your car toward the end point
  • (car goes)
  • Mark where the car crosses the finish line
  • Measure "mark" to "preferred end point"
  • Measure "start" to "preferred end point"
  • Use the ratio of "mark" to "end" versus "start" to "end"
  • Apply that ratio to the "strong" (outside) motor.
  • In this image, LEFT motor should be driven at VALUE
  • RIGHT motor should be driven at VALUE * (YEL / BLU)