1

The robot car has 3 motors, the first motor is a stepper motor which controls the 2 wheels in front of the car to tell which direction it is moving. The second and third motor is a dc motor which each motor controls a wheel of the back of the car. The front wheels right now only have 3 values which will tell the car to either turn left, right, or face front.

The dc motor has PWM values but now we are trying to make sure that the robot is moving straight by using both of the PWM values. The whole robot use STM32F1 to control.

Is there a formula or a way to just tell the angle then the car will auto-move that angle?

Zheng Xian
  • 119
  • 3
  • This robot is like a real car whereby the front wheels can turn to a max angle and the rear motor each control the one wheel, therefore, I think when moving left or right the PWM of one of the motor will be less than the other. – Zheng Xian Aug 31 '21 at 04:03
  • Using rear wheels to steer needs the user to see if there is offset in the steering and use that to control an offset in the PWM in the rear motors and the other control to drive both PWM. The rate of change of angle will increase with speed. so for straight correction I might think it just fixed small offset. then more for gentle turns and front wheels for sharp turns. So just use a linear offset in PWM average voltage. – Tony Stewart EE75 Aug 31 '21 at 05:52
  • use the front wheels for steering ... emulate an automotive differential on the back wheels, so that there is no slip when turning – jsotola Aug 31 '21 at 06:12
  • Should I have the back wheel PWM motor one move fast and the other move slow or just both the same as how it moves in a straight line? – Zheng Xian Aug 31 '21 at 06:23

0 Answers0