# Vehicle with Aurdino, PID control +power

Basically I'm building a vehicle, but I'm a little confused about the power routing I want to make the arduino connected to a motor driver and then the motor connected to that. There will be a separate power source for the motor (obviously), and then a seperate power source for the arduino, which will power a lcd screen and an input for distance.

I'm undecided on what motor I'm going to use, but it has to be small and have a decent res., since ill be adding a PID control onto it.

Is this idea feasible? How should i route power? And is there any place where I can get that type of a motor?

Sorry, I'm just a noobie to the arduino community, so I might not know much, feel free to correct any of my implausible concepts. Thanks So Much!!!

Numbers please, there's no way to guess what size of thing you are talking about. You have to size motors given the mechanical reality of the whole machine, not choose a motor first. Whether the motor is small or not is a consequence of sizing the motor, not something one specifies up front.

Basically its all Newtonian mechanics at this level.

Sorry, my bad. The size of the frame or body will be 9 inches by 12.5, and a height of approx 4 inches maximum, but that depends on components. With all the materials minus the motor, the weight is 1.27 pounds. I think I got your point; I was thinking illogically about motors. Thanks so much!

SI units are always preferred

So I got mass is about 0.5kg, but I don’t see any other useful values there, like
wheel diameter, max desired speed/acceleration, max desired incline climbing ability.
Is rough terrain going to be involved? number of driven wheels?

sorry for the late response and the lack of SI units xD the wheel diameter will be 4cm, no incline or climbing ability i am just aiming for a smooth terrain right now Thanks!!

So mass 0.5kg, wheel radius 2cm, low friction terrain.

Lets go with 10% incline ability to represent friction in the drivetrain, that suggests propulsive force of 0.1 x 9.8 x 0.5 ~= 0.5N, so total torque for all driven wheels of 0.5 x 0.02 = 0.01Nm

Lets assume (as you've not said) a max speed of 2m/s, so 2 / 0.02 = 100 rad/s ~= 1000rpm at the wheels.

Perhaps motor(s) of about 5000rpm max speed and 5:1 gearing. Assume gearing will lose 50% of the power so 4mNm torque at 5000 rpm is the sort of motor rating - that's about 2W mechanical power out of the motor(s) shaft.

Thanks a lot!
I had one more query, what about the resolution of the motor? And what do you mean by the 5:1 gearing ratio?
I forgot to mention before, sorry, only 2 wheels will be powered, and then the remaining 2 will drag along for support, making a total of 4 wheels, like a car. I’m also concerned about stopping the vehicle, which is why I’m trying to incorporate PID into this. Can the motor “lock” the wheels so that the vehicle stops? Or should I go to a more mechanical approach in the sense that I install a brake itself.

arkhazard: Can the motor "lock" the wheels so that the vehicle stops? Or should I go to a more mechanical approach in the sense that I install a brake itself.

Many H-bridges allow you to dynamically brake a motor. I made a little tutorial about using cheap L298N h-bridges. I'm pretty sure I mention how to use the inputs to brake the motor.

Small robots rarely require dynamic braking. There's usually enough friction in the gearbox to slow a motor once power has been cut.

Thanks a bunch! You guys really helped me out on this project!! :)

Hi,

I use servo's as motors. To do that you modify the servo a bit: - Remove what stops the servo from rotating 360°. (Might need some filing) - Replace the potentiometer by two resistors of the same value (to simulate neutral position)

The motor is controlled using "Servo.h". 90 = motor stops (I had to use 95)

90 = forward (small value to go slow) 90 = Backward

Very simple solution, no motor drivers needed.