Picking a DC Motor for Obstacle Avoiding Robot

Images link

New here so bear with me. I have one of those DIY robot car chassis from Amazon that comes with a plastic platform mounted on three wheels, two are powered by 3-6V DC gearbox motors, and one of them is free-spinning. I have attached 3 pictures of my robot currently.

A little more detail about my setup: I have mounted the UNO on the top of the chassis, which is connected to three HC-SR04 sensors mounted on the front of the body. The motors are controlled by a L298N dual h-bridge controller. Everything is powered by one 12V 3000 mAh battery, which runs to the L298N board which has a 5V regulator that runs to the VIN pin of the UNO. Let me know if you need more detail.

So now on to my question:

I find that operating the DC gearbox motors at full speed is way too fast, not giving the sensors enough time to get a good measurement. So, my initial solution was to use PWM on the Enable pins for each motor to lower the speed, using the AnalogWrite() function. However, once I lower the value (0-255) to a number that corresponds to a low enough RPM for my purposes, the motors will stall and wont move again until I apply a little torque to the wheels.

I think my solution is to get a different motor that has a lower RPM rating. However, I also need motors that have capabilities for wheel encoding. The ones I have now have a shaft sticking out on both sides so i can mount an encoding disk, which is nice. I have searched and can't find a good website to buy a motor that fills my needs.

Can anyone point me somewhere?

Thanks so much.

You mention 3--6V motors, yet 12V supply, which is part of the problem.

You may have the wrong ratio gearing too - do you know what maximum speed you want at the wheels? If so pick the gear ratio that provides no more than that at 100% motor drive.

Hi, The ops images; |500x375 |500x375 |500x375 Tom... :)

@Tom: Thanks for that! Wasn't sure how to reduce the file size.

@Mark: Well when I bought the DIY chassis (which included wheels/motors/chassis), I didn't know what I was going to do with it yet. Also, they didn't have the specs listed for the motor initially. Someone asked about it in the listing and this is what they provided:

  • Working voltage: 3-6V
  • Reduction ratio: 1:48
  • 3 V no lode: 125 R/M
  • 3 V nolode with 66 mm wheel: 26 m/min
  • 5 V no lode: 208 R/M
  • 5 V nolode with 66 mm wheel: 44 m/min
  • Torque: 0.8 kg/cm
  • Speed: fast

I don't know what RPM I need exactly. I have just been adjusting it "by ear." By that I mean I have been varying the speed to see how accurately the sensors will measure distance while its moving. I think the motor control board I am using requires 7-12V, so thats why I haven't used my 4 x AA battery pack. Do you know of a good way for me to figure out the RPM I want?