Smashed up Bot leads to some hardware questions ;)

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 :wink: ) mishaps.

setup:

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.

  1. 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?

  2. 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)

  3. 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?

  4. 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.

  5. 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.

  6. Other ideas or suggestions for speed control when an object is detected in its path.

Thanks a bunch!
edit: oops, forgot one

  1. 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?
  1. 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?

YES. Completely or mostly yes, depending on your details.

  1. 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)

NO. You werent drawing 15A anyway. At 24V and no load (torque) your current is low, ideally zero without friction. As you apply more torque the current rises. The motor is not rated to exceed 15A or 250W, whichever comes first. 15A at 16V is ok, 10A at 24V is ok, 15A at 24V is a 44% overload that will eventually burn out your motor.

  1. 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?

For most PWM controlling the PWM is essentially the same as controlling the voltage. IDEALLY Speed is proportional to voltage, current is proportional to torque. Then it gets complicated, and depends on motor. Google "dc motor torque speed voltage current" and learn a lot about DC motors, and study the data sheet for yours.

  1. 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.

Great idea.

  1. 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.

A whole subject unto itself. Let us know how that works out for ya.

  1. Other ideas or suggestions for speed control when an object is detected in its path.

Simple toys use simple and cheap bump switches, if your bot is too heavy and too fast a bump switch is "too little too late". No sensor is perfect, unless you ask the sales rep. Go back to 5. and do your homework thoroughly before buying and integrating.

  1. 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?

Most Arduinos have a voltage regulator built in. Voltage regulators drop some voltage so they need "headroom". A 7805 needs about 2 volts of headroom, so input neeeds at least 7V to put out a good solid 5V over its full range of current and temperature. When you put a 7805 feeding another 7805 the second one has zero headroom and its output will be low.

Great! Thanks so much for all the information.

NO. You werent drawing 15A anyway. At 24V and no load (torque) your current is low, ideally zero without friction. As you apply more torque the current rises. The motor is not rated to exceed 15A or 250W, whichever comes first. 15A at 16V is ok, 10A at 24V is ok, 15A at 24V is a 44% overload that will eventually burn out your motor.

Thank you for explaining about the draw! I had assumed that 15 amps was what it was drawing and 250 was the output, the rest being lost to friction and conversion.

One small point, I would have assumed that I did have quite some draw, since my bot easily weighs over 75lb with batteries.

Most Arduinos have a voltage regulator built in. Voltage regulators drop some voltage so they need "headroom". A 7805 needs about 2 volts of headroom, so input neeeds at least 7V to put out a good solid 5V over its full range of current and temperature. When you put a 7805 feeding another 7805 the second one has zero headroom and its output will be low.

That cleared a ton up for me, thanks!

A bump switch is definitely a little too late.. unless maybe I give it a 3m nose wrapped around a coathanger ;D

Still, I very well may do that as it enables me to work on the code prior to buying any sensors. I found a parallax range finder at radio shack that seemed to have roughly the specs I need, but it was about $30 which is more than I would like to spend, so if anyone has any suggestions or good experiences with range finders they can share, they would be great!

Thanks again AltairLabs.

Right, firstly, you gave me my first good laugh of the day :smiley:
Secondly, I have planned something kinda similar (big ass remote control car/bot platform/UGV with a few powerful motors) but not had the time (or the free cash) to get it done yet.

Thirdly, a few comments based on what you have and what I think you want to do.

For the motors, I would suggest you get a current sensor or two (there are some nice allegro ones which will do up to 200A - I have a few). I would also try and find a spec sheet for the motors, that should show you how RPM, power, torque and efficiency vary - If you can't find one then just contact the manufacturer and see if you can get one.

Re. range sensors: Yes you are correct that IR is not the way to go, perhaps as well as an ultrasonic one though :wink:
Ultrasonic range sensors are expensive, that is a fact. People seem to like the parallax ping))) sensors or the maxbotics sensors.

Re. power: Powering the Arduino from that kind of voltage, you don't really want to be doing it through a voltage regulator. A DC to DC converter would be a better bet but they are expensive (24V to 6V 1.5A - >£20 - as an example, you obviously want to 5V or to 6/7V and then put it through a low dropout regulator).

I would also suggest some switches inline with the motors and possibly LEDs on the driver lines so you can switch them on only when the LEDs are not lit - but you can still then have the rest of the system powered...

Any chance we can have some pics? :slight_smile: (of the bot and the hole in the wall/burnt carpet).

Mowcius

RPM, power, torque and efficiency vary - If you can't find one then just contact the manufacturer and see if you can get one.

Re. range sensors: Yes you are correct that IR is not the way to go, perhaps as well as an ultrasonic one though
Ultrasonic range sensors are expensive, that is a fact. People seem to like the parallax ping))) sensors or the maxbotics sensors.

Re. power: Powering the Arduino from that kind of voltage, you don't really want to be doing it through a voltage regulator. A DC to DC converter would be a better bet but they are expensive (24V to 6V 1.5A - >£20 - as an example, you obviously want to 5V or to 6/7V and then put it through a low dropout regulator).

I would also suggest some switches inline with the motors and possibly LEDs on the driver lines so you can switch them on only when the LEDs are not lit - but you can still then have the rest of the system powered...

Any chance we can have some pics? (of the bot and the hole in the wall/burnt carpet).

I added neutral indicator lights and separate switches for the arduino + everything else after the incident. ;D

Why don't I want to use a voltage regulator like that? When I say I started 2 months ago, I mean I knew nothing about electronics except 12v automobile systems (with a little pulsed 5v to ECU here and there) so there are some gaping holes in my knowledge. I just learn best by having a hands on project, so thats how I'm teaching myself.

Thanks for the rangefinder info.

Here are the requested pics. My camera is broken and my camera phone is terrible, so these pics are kind of rubbish but it's best I could do. The carpet is still slowly melting away as I am snowed in and cleaning it with towels just spreads it around, I have to wait until I get some baking soda or vinegar :stuck_out_tongue:

Bot Pre Accident

After accident, batteries removed, notice front axle

I exaggerated slightly about the hole in the wall, because it hit a doorway joust.

I had a heck of a time getting a picture of the carpet, it was the last one, but basically all the black around the outside is just absence of light. everything black inside the green is melting carpet :stuck_out_tongue:

Are you just running this thing forward and back - no turning yet? Because you have a differential drive setup, but your front wheels don't caster; are you intending to replace them with casters in the future?

Ideally, you should be testing the motors and drive system (and control and everything else) off the ground (and ideally outside and/or over concrete). This time only a wall/door was injured and a carpet burned; what will happen next time?

I trust you also keep a fire extinguisher handy...?

:-?

Why don't I want to use a voltage regulator like that? When I say I started 2 months ago, I mean I knew nothing about electronics except 12v automobile systems (with a little pulsed 5v to ECU here and there) so there are some gaping holes in my knowledge. I just learn best by having a hands on project, so thats how I'm teaching myself.

The voltage regulator just turns 19v to heat (simply speaking). The DC to DC converter actually converts it to a lower voltage so much less heat and power loss.

Heh, not so great about the carpet - sounds like a new one is required... or just get a cheap rug :smiley:

Mowcius

Are you just running this thing forward and back - no turning yet? Because you have a differential drive setup, but your front wheels don't caster; are you intending to replace them with casters in the future?

Ideally, you should be testing the motors and drive system (and control and everything else) off the ground (and ideally outside and/or over concrete). This time only a wall/door was injured and a carpet burned; what will happen next time?

I trust you also keep a fire extinguisher handy...?

Good notice. Yes I was originally intending on converting the front to casters OR using 2 more motors in the front for 4wd. As it is, it turns fine with 0 degree turning, it just lifts the front wheels off the ground.

The voltage regulator just turns 19v to heat (simply speaking). The DC to DC converter actually converts it to a lower voltage so much less heat and power loss.

Heh, not so great about the carpet - sounds like a new one is required... or just get a cheap rug

Mowcius

Thanks for the explanation. I have the second ground of the regulator bolted to a sheet of aluminum with the rest of the electronics and they are being cooled by 12v fans, so everything should be OK, right? I realize its not optimal because of all the energy being wasted by converting to heat, but the worst thing that can happen is I blow up a $2 regulator?

As for the carpet, It has seen better days, and is already covered in many places by cheap area rugs. I'm saving up for hardwood. :wink:

Heh, cool.

The regulator should be fine but just informing you it aint the best way to do it :wink:

I have the second ground of the regulator bolted to a sheet of aluminum with the rest of the electronics and they are being cooled by 12v fans, so everything should be OK, right? I realize its not optimal because of all the energy being wasted by converting to heat, but the worst thing that can happen is I blow up a $2 regulator?

It looks like you are running @ 24 volts from two 12 volt batteries in series (btw, you should really switch over to SLA batteries when you can afford it - you should -never- use or store liquid lead-acid batteries indoors; also, standard car batteries aren't designed for deep cycling either - so you want to go with a battery that is; SLAs fit the bill, and won't leak, and can be mounted in any orientation) - are you running the regulator off the 24 volt tap, or the center 12 volt tap?

If you are running from the 24 volt tap, switch over to the center 12 volt tap; your regulator will run a little cooler - still not the most efficient, but better than running off the 24 volt tap.

AGM (absorbed glass matt) batteries or Gel batteries would be good for this.

I was looking at AGM for mine as they are cheaper than Gel batteries and the specs are nearly as good (much better than standard lead acid batteries anyway.

It looks like you are running @ 24 volts from two 12 volt batteries in series (btw, you should really switch over to SLA batteries when you can afford it - you should -never- use or store liquid lead-acid batteries indoors; also, standard car batteries aren't designed for deep cycling either - so you want to go with a battery that is; SLAs fit the bill, and won't leak, and can be mounted in any orientation) - are you running the regulator off the 24 volt tap, or the center 12 volt tap?

If you are running from the 24 volt tap, switch over to the center 12 volt tap; your regulator will run a little cooler - still not the most efficient, but better than running off the 24 volt tap

I was running 2 12v in series, I have several lead acid cores from cars and lawnmowers at any given time, so these batteries actually have a real world purpose the rest of the time. I charge all my batteries in parallel off of a 45watt solar setup and never let em discharge more than a quarter at a time.

After clearing some snow and playing with it last night, I found that it actually ran better with just 1 12v battery as opposed to 24v at the current weight. Good thing too, because my motor controller only uses 1 signal wire for each motor, with zero being full reverse, 5v being full forward and 2.5v being neutral, and scaling it down to 50% output while still keeping the failsafes would have been a coding chore for me.

Can you recommend where I should start researching SLAs and looking for deals?

AGM (absorbed glass matt) batteries or Gel batteries would be good for this.

I was looking at AGM for mine as they are cheaper than Gel batteries and the specs are nearly as good (much better than standard lead acid batteries anyway.

Pretty much same thing as with SLA. I'm just not informed on this kind of stuff and have plenty of lead acid stuff sitting around.

I give you full credit for "hole in wall", well done !

I give you full credit for "hole in wall", well done !

Thanks! ;D
I realize it's one of those things some people might not be able to laugh at, but I found it hysterical. I'll take a great story for half an hours fix and $5 in spackle any day :wink:

Now that I've got everything separately switched and it's very controllable with a 12v source, I am putting the parallax idea on hold.

What I would really like to play with next is some sort of stepper motor to control a rotating body after welding a couple of supports across the midsection. After looking at steppers I had a question.

Is there a preferred number of wires? I see some have 4 and some have 6 or more, which would take a lot of I/O pins.

The number of wires on the motor is pretty much immaterial. You can't connect a stepper motor directly to the Arduino. They take WAY too much current to drive. So, you need a motor controller. The motor controller needs to be compatible with the stepper motor, but requires only two pins on the Arduino - one to define direction (HIGH goes one way, LOW goes the other way) and one to cause the motor to step every time the pin goes HIGH.

The voltage regulator just turns 19v to heat (simply speaking). The DC to DC converter actually converts it to a lower voltage so much less heat and power loss.

If the regulator is just supplying the arduino and no other loads, the energy loss should be minimal.

Thank you for the explanations.