I started my "bot" a couple months ago with zero knowledge and a ton of questions in the forum. Im a tinkerer so I made most of my choices based on what I had laying around or what I could buy for cheap, so some of my components are perhaps a little mismatched for a serious project. Still, what I have learned from it has been invaluable and I plan to keep messing with it, since I can't really afford new stuff right now. It's also lead to some "funny" (for others, not me ) mishaps.
2.4g wireless transmitter and reciever running PPM.
Arduino decodes PPM through pulse in and outputs PWM signals to motor controller
Motor controller operates at 6-30vdc and outputs 2x25amp. Each channel runs to 1 motor on either side of the bot.
Motors are from Currie brand scooters, I picked them up for $20 each. They are 15amp draw, 250watt output, and have an 11 tooth gear for #25 chain. They run at 24vdc and 3000RPM.
Chain runs from either motor to a 68 tooth sprocket mounted on either wheel, for an approximately 6.5:1 speed reduction/torque multiplier.
Power comes from 2 12v Lead Acid lawnmower batteries in series. Power to the arduino comes from a 7812 regulator drawing power from 24v.
For the basic frame, I welded up my motors to 2 3.5 foot pieces of 1/4" thick angle iron. After the basic box and axle was welded up, I used the angle iron that has holes in it every half inch or so for horizontal bracing, because I could screw it in instead of welding, and I had not decided on final placement of the rest of the components.
Here is where it gets interesting.
We've had snow here for a week (we NEVER get snow, it shuts down the city) and I finally couldn't resist trying it out inside...
I had been working some tutorial projects on my arduino and forgot to reload my bot code. I popped the arduino into my bot, flipped the power switch, and both motors went full HIGH forward. This launched my bot down my hallway at about 20mph, straight into a wall. The impact bent part of my front axle, put a huge hole in my wall, and threw one of the batteries backwards against a screw, which punctured the battery and threw battery acid all over my carpet! melting carpet sucks!
Now for my questions.
I think I have a good grasp on PWM, but I want to make sure. After this incident, I tried the bot with just one 12v battery and it worked. Since the PWM is going to an analog device (motor), is running both motors at 255 on 12v EXACTLY the same (to the motor) as running 24v at 127?
If I run a 24v, 250watt motor off of a 12v source, am I still drawing 15amps, just at 12v, for a total of 125watt output? ( I realize that 24x15 is not 250 watts, but the data sheet says draw of 15 amps, output of 250watt)
Does torque production of the motor decrease with speed when I decrease speed with PWM? Does it decrease linearly (so that with 12v im at 1/2 torque) or is this different for every DC motor based on manufacturer specs?
While I incorporated failsafes into my code in the event of the transmitter/receiver timing out, this incident made me realize I did not incorporate any failsafes for human error. Ideally, I'd like to add some kind of forward range finder that will override user controls and slow the motors to barely moving in the event it detects an object roughly 3m in front of it. I don't want it to completely stop the motors, just slow them down to the point that a collision will no longer be dangerous to the bot or whatever it hits.
Suggestions on what type of rangefinder would be best to implement what I need. I would assume that one that works on sonar is going to be better than one that works on IR for this particular application (due to the range of most IR modules), but I could be completely wrong.
Other ideas or suggestions for speed control when an object is detected in its path.
Thanks a bunch!
edit: oops, forgot one
- When I run my arduino off of the 5v of a USB connection, it works fine. When I run it off a 7805 chip, it doesn't seem to have enough voltage and gets weird errors. Why?