Sunday, March 17, 2013

Next Step: Motor Control!

The next step after choosing motors (like these) is to select a method of controlling them. I prefer to have something with PWM speed control and current feedback, so that's going to narrow down my list a bit. PWM speed control is easy to do with an Arduino / Atmel chip, and you can do things like slow-start and slow-stop. Current-sensing is important too, because even though the motors have encoders, it's possible that a motor can draw more current than you'd like but still be turning, so with that information it's possible to command less speed and cut down the current drain.

The Requirements

The specs for the motors list about a 1A (amp) rated draw, and a 5A stall current. What's the difference? Motor specs usually list at leat two important numbers; free run speed or rated speed in RPM (rotations per minute), and stall current (at zero RPM). Don't assume that if you need, say, 200 oz-in of force that a motor with a stall torque of 200 oz-in is going to work; it won't! Since 200 oz-in is the stall torque (say at 5A), that means the stall was measured as the force to STOP the motor from turning. And 'stopped' means not turning at all. Even getting close to stall torque means a very slow RPM rate. And be sure to read your spec sheets; some motors can actually damage the gears when totally stalled, so you want to build in a good sized safety factor there.

Some motors list a combination of 'rated speed / rated torque', which is handy to know. Although the small torque is probably too small to even move a 'bot on a level surface, it puts a dot on the torque-speed graph that is useful. Like this:


What does this tell us? That for RPM's (the left numbers) in the 100-200 range, we will have current draw in the 1500-3500 mA range (the numbers on the right). Milliamps are just 1/1000th of an amp, so that's in the 1.5A - 3.5A range for useful RPM ranges. It also says that the torques are going to be 1/12 of those same numbers, I multiplied the torque values by 12 to put in on the same scale as the current. That's roughly 125 oz-in to 200 oz-in of torque, so plenty for normal driving over slightly uneven or low sloping terrain.

Those nominal current values are going to come in handy later for battery sizing, too. Six motors drawing 3A is an 18A draw, which is a relatively high amount for a small-ish robot. But we know we have the torque available to lug around a big enough battery, so we won't worry about that yet.

Controlling up to the 5A stall current per motor, with a 3A nominal draw is the next challenge. Some of the wheels will always turn in the same direction, like the two motors on the front and back of the same side, so it's possible to see if a single controller of 10A max would work. It's also possible to see if using single controllers, one per wheel, would work, but that is going to cause some interesting challenges for a single Arduino to control (once we add steering, which I haven't talked about yet).

The first draft plan would be to have four controllers. This is because for some kinds of turns we don't want the middle wheels to turn at the same rate, or at all, because the rover is going to pivot on them. If they did turn, it would tend to drag the rover around a bit. Here it is spelled out:
  1. Right side, front and rear wheels (10A max)
  2. Right side, middle wheel (5A max)
  3. Left side, front and rear wheels (10A max)
  4. Left side, middle wheel (5A max)
Time for a step back. Remember earlier when I said I liked to have current feedback per wheel? This won't give me that, unless I use separate PCB's for current sense on the motor inputs, which is an option, but it might drive up the price. Or not, as the Cytron 10A controller is only about $15 each. They don't have current sensing, but that could be added for another $10 with the Pololu 30A Current sensor board.

If it sounds like the spec is a little too close for comfort, the 10A controller boards appear to be ok for a 15A peak for 10 seconds; plenty of time to dial back the power in software. This should handle the little bumps from things like motor startup and small obstacles without going up in smoke.

Four of the controller boards is $60, and adding per-motor current sensing is another $60. For $120 that gives far more control than simply driving the left and right side motors at the same speed via a single dual-channel controller.

But since I'm considering a simpler control scheme, this controller from DF Robot is darn near perfect (on paper), and is only $50, and includes current sensing and few other perks like temperature and current limiting.

I wonder - what about using two of them? That gives me all the perks for $101 (instead of $120), and four channels of control, which is exactly what I need. That sounds about right. The tradeoff is that I can't get current feedback per motor, since I'd use two on the same output of each driver for the front and rear wheels. I think for $20 extra it's worth it to have current sensing, so I'm sticking with discrete Cytron controllers and current sensing boards.

If I wasn't such current-hungry control freak I might consider two of these Pololu controllers; they can do 3A continuous / 5A peak (the chip datasheet says 5A continous as an absolute max rating), and at $37 each ($74 total) that's even better. But that wouldn't have per-motor current sensing, and it would be cutting the spec a little too close for comfort. I don't want the magic smoke to get out the chips during the race and possibly melting the rover, just to save $25.

The Battery

24V motors in a small rover are pretty intense. At our 3A draw, plus a few other things like steering, sensors, and electronics, we might have a 4500 mA (4.5A) draw.

SLA (sealed lead-acid) batteries are too heavy (actually, it's that they aren't energy-dense enough), so we are left with other choices. For example, two small 12V SLA's in series (to get 24V) would weigh 5 lbs, and only have about 4500 mAh, or about one hour of run-time.

Luckily the world of R/C racing has some pretty steep power requirements that might work for us. Both NiMH and LiPo batteries are good options, and it's possible to fudge getting near 24V and the right run-time if we combine them creatively.

First off, my preference would be to use as few batteries as possible. A common battery voltage is 11.1V, so two of them connected in series would be close enough to 24V to work. At R/C capacities we also need to connect two more in parallel, to yeild a useful runtime. Just for comparison that would weigh less than 3.5 lbs, so it's in the realm of possibility. It's interesting to note that I'm 150% overbudget on battery weight, but there aren't a lot of options here.

I could go with a 3x2 stack of 8.4V batteries, but the weight penalty gets a little higher for similar performance. And charging that many batteries would be a pain.

I could also choose a single 22.2V pack, but it's harder to adjust the capacity at an affordable price.

So two 11.1V packs to start it is! With charger and a few connectors the total price is $150, right on budget. If I need double the run time, it's under $100 to add two more batteries.




No comments:

Post a Comment