bwag
Posts: 5
Joined: Wed Mar 11, 2015 5:02 pm

High Amp Motors with the Pi

Wed Mar 11, 2015 5:08 pm

Hey guys, I have a quick question.
How can I run a dc motor off of the pi? The motors stall current is 85 amps, I'd like to be able to run it to atleast 60 amps.

I was thinking I could just have the batteries directly wired to the motors (there are 4).

I found 40 amp motor controllers but they are seriously expensive, is there any low end way to actually do this?

RaspISteve
Posts: 98
Joined: Wed Oct 24, 2012 9:15 pm
Location: Cheltenham, UK

Re: High Amp Motors with the Pi

Wed Mar 11, 2015 10:46 pm

Bwag, not sure you're in the right place here. Those motors represent some serious power and together with the currents involved your system represents a major risk to health if things get out of control. If you skimp on any aspect of the control system a failure could present a huge risk of injury.

I would suggest you'll need some very exotic embedded control system that can fully focus on the motor control and not on the needs of any user. To this you attach your user interface which could be the Pi. You might also consider decoupling the motor system and the user interfacing system with opto-isolators.

If you intend controlling the motors from something like a Pi you have to consider what happens to the motor system while the system is booting up. An embedded controller will be on the case in a few milli-seconds against the multi-second boot time of the Pi or similar full operating system.

With those currents you will be well inside needing safety certification for your system.
Share and Enjoy.

User avatar
aTao
Posts: 1087
Joined: Wed Dec 12, 2012 10:41 am
Location: Howlin Eigg

Re: High Amp Motors with the Pi

Wed Mar 11, 2015 11:03 pm

>)))'><'(((<

User avatar
Tage
Posts: 287
Joined: Fri May 24, 2013 2:29 am
Location: St Thomas, Ontario Canada

Re: High Amp Motors with the Pi

Thu Mar 12, 2015 1:25 am

without knowing anything about the motors it is impossible to give a useful answer, but if you only need to run the motor in one direction you can just use a MOSFET gate driver, a suitable MOSFET and a Schottky diode that provides a path for the motor current when the MOSFET is off. you connect the gate driver IC input to a GPIO and apply a PWM signal and you are off to the races.

bwag
Posts: 5
Joined: Wed Mar 11, 2015 5:02 pm

Re: High Amp Motors with the Pi

Thu Mar 12, 2015 1:35 am

Thanks for the replies guys, keep em coming if you think of anything.

The motors are the drive system, since it's a tank drive I need reverse too. I also looked into systems that are 120 amp dual channel and just roughly splitting the current between the left and right, 2x 2x60 is cheaper.

So a few more solutions I thought of through my day of research is...
1) I could control the variable amp input from the usual low 0 to 2A, but then run it through an OP AMP set up before it hits the motor.
2) I could buy one of those cheap Chinese 2x60 off of ebay and hope it's not too much of a scam.
3) I just found out about ESC used in remote controlled cars. I don't really get how they work yet though.

I'll study opto-isolators tomorrow, thanks for the reply!

Ummm... About the health risks... Our cars run on it, it's just the draw of the unit, no different than any other electronics from tv's, stoves, etc. Anything can cause high amp flows if something breaks. Exercise should always be practiced with electricity. Don't leave batteries exposed and connected, wear plastic gloves when you work, make sure everything is discharged after you disconnect. It's really no different than working with any other potentially dangerous object (everything)

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: Korea

Re: High Amp Motors with the Pi

Thu Mar 12, 2015 1:42 am

Actually, if you can find a big enough MOSFET you can use it for the speed control (with PWM), then use a DPDT relay for the direction control. The key is to turn the MOSFET off and then switch the relay over. That way there is no current through the contacts when they change, so no spark and no contact welding.

Mark_T
Posts: 149
Joined: Sat Dec 27, 2014 10:54 am

Re: High Amp Motors with the Pi

Thu Mar 12, 2015 1:53 am

85A stall current probably means about 10A at nominal load, and if your supply is current limited you
can reduce the maximum current the motor controller has to deal with. With careful ramping up of
PWM and current monitoring (always wise to have current monitoring), you could keep the
working current under much tighter control.

Still, fairly hefty motors...

bwag
Posts: 5
Joined: Wed Mar 11, 2015 5:02 pm

Re: High Amp Motors with the Pi

Thu Mar 12, 2015 2:08 am

Wow Mark, you're actually spot on! Peak Amp Efficiency is 13A, I'm not too worried if I end up getting something that will run 40A continuous. Thanks for your input!

Ame, I have no clue what you're talking about, and that's fantastic! I came hear to learn about ways that I don't know about, I'll have a busy day tomorrow!

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: Korea

Re: High Amp Motors with the Pi

Thu Mar 12, 2015 2:38 am

bwag wrote:Wow Mark, you're actually spot on! Peak Amp Efficiency is 13A, I'm not too worried if I end up getting something that will run 40A continuous. Thanks for your input!

Ame, I have no clue what you're talking about, and that's fantastic! I came hear to learn about ways that I don't know about, I'll have a busy day tomorrow!
You do something like this:

Code: Select all

    +V ------+-----------------+
             |                 |
          NO o                /o NC
                 C         C /
       RLA/1     o---|M|---o     RLA/2
               /             
          NC o/                o NO
             |                 |
             +--------+--------+
                      |
   GPIO ------------|[  MOSFET
                      |
    GND --------------+

I don't know if the MOSFET circuit is complete, but you get the general idea.

You also need a transistor buffer to drive the relay coil (which I have not shown), so for one motor you use two GPIO pins (one for the relay, one for the MOSFET). The MOSFET can be turned on or off, which will allow current to flow through the motor. The direction of current through the motor is set by the position of the relay contacts. You can use PWM to drive the MOSFET to alter the speed of the motor.

You should wire the motor up so that when the relay is not energised the motor runs forward. To reverse the motor, turn the MOSFET off, then turn the relay on. Wait a short while (a few ms for the contacts to move) then you can turn the MOSFET on again. If you change the relay state when the MOSFET is on, then you will get a spark from the relay contacts, which you don't want.

Duplicate everything to control two motors. So you will use four GPIOs to control your vehicle:
  • Left motor on/off
    Left motor direction
    Right motor on/off
    Right motor direction

User avatar
aTao
Posts: 1087
Joined: Wed Dec 12, 2012 10:41 am
Location: Howlin Eigg

Re: High Amp Motors with the Pi

Thu Mar 12, 2015 6:50 am

You'll be wanting a back emf protection diode for the mosfet in there, otherwise its bye bye mosfet rely quick. In this case a 1n4001 isnt going to cut the mustard. You will also want a few capacitors so you arent wasting a whole bunch of energy with the back emf suppression.
>)))'><'(((<

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: Korea

Re: High Amp Motors with the Pi

Thu Mar 12, 2015 7:11 am

aTao wrote:You'll be wanting a back emf protection diode for the mosfet in there, otherwise its bye bye mosfet rely quick. In this case a 1n4001 isnt going to cut the mustard. You will also want a few capacitors so you arent wasting a whole bunch of energy with the back emf suppression.
Feel free to contribute a schematic and parts list.

User avatar
aTao
Posts: 1087
Joined: Wed Dec 12, 2012 10:41 am
Location: Howlin Eigg

Re: High Amp Motors with the Pi

Thu Mar 12, 2015 11:07 am

ame wrote:
aTao wrote:You'll be wanting a back emf protection diode for the mosfet in there, otherwise its bye bye mosfet rely quick. In this case a 1n4001 isnt going to cut the mustard. You will also want a few capacitors so you arent wasting a whole bunch of energy with the back emf suppression.
Feel free to contribute a schematic and parts list.
Diode: STTH6012W placed across source/drain of mosfet
Capacitor: combination 100nF, 10uF and 10,000uF across power supply.

Principal:When the current through a coil (motor winding) is changed the coil creates a voltage to oppose the change.
V(t)=L*di(t)/dt or voltage =- inductance * rate of change of current.
In a PWM control the current is cut almost instantly many times a second, which causes a large (huge) voltage to appear across the coil, this can exceed the ratings of the PWM power stage.. One way to deal with it is a transient suppressor across the motor (anything above a certain voltage is short circuited),quite wasteful. Another way is to push it back to the power supply and save it for later (like when the coil is turned on again). Since the power cables and connectors all have resistance then some capacitors place near to the motor circuit are ideal for storing the energy.
>)))'><'(((<

bwag
Posts: 5
Joined: Wed Mar 11, 2015 5:02 pm

Re: High Amp Motors with the Pi

Thu Mar 12, 2015 4:11 pm

Wow thanks for the great help guys and girls!

Since this is my first build I don't want to get bogged down in potential problems both budget and electronics wise. (Trouble shooting online sounds like hell!)

I decided I'm going to use a 6 channel airplane controller and high amp escs to control the robot. But bwag how does the pi come into this? Well my friends, I'll use the pi to send the signals to the rc remote which I'll just haul with my robot!

The advantages of this system is that it's easily expandable, a 320 amp esc is $10, a 40 amp esc is $10, the transmitter and receiver together is $25. Then I can turn the raspberry pi into the transmitter and have any future sensors or non-motor add-ons to the pi, it'll just compute what it has to and react accordingly through the rc controls.

Notes:
Some of the channels are on or off, this can be used for simple swinging motions, fans, arms (latching along the way)
There is a standard bind key so it binds to only one remote
This system allows you to control the robot through the remote alone, the Pi is not necessary.
12v is the native power, the Pi is powered separately from everything else.
This is really flipping cheap, I hope this work around works.
The only thing that I can see not working is if the Pi can't simulate the RC control because of the way it handles multitasking. I read about a work around for running continuous programs, but I'll have to see.

User avatar
aTao
Posts: 1087
Joined: Wed Dec 12, 2012 10:41 am
Location: Howlin Eigg

Re: High Amp Motors with the Pi

Thu Mar 12, 2015 8:32 pm

bwag wrote:, a 320 amp esc is $10, a 40 amp esc is $10,
Be vary very careful when buying this.
$10 for a 320A anything is too good to be true, so, it isnt true.

I am guessing you mean one of these: http://www.ebay.co.uk/itm/HSP-RC-1-10-C ... 4897.l4275 see in the picture the wires are 16awg. see http://www.powerstream.com/Wire_Size.htm for the rating of 16awg wire. At 320A continuous load those wires are fuses.
>)))'><'(((<

User avatar
cyrano
Posts: 714
Joined: Wed Dec 05, 2012 11:48 pm
Location: Belgium

Re: High Amp Motors with the Pi

Thu Mar 12, 2015 11:04 pm

Do you have a type for these motors? Or a link?

See if you can find some serious used golf-cart motor controllers or electric scooter controllers for your DC motors. There are some very good robotics controllers out there, but they are expensive and there are not many of them around second hand.

The RC controllers that get advertised "50 amps" usually can keep up about 40 amps for a minute. That's why they are so cheap. You 'd be lucky to run them at 20 amps for an hour.

I've been building tank drive vehicles for a while and they will stall. Even if you're trying to be careful, it will stall when you least expect it to, with very violent results. RC controllers can and will explode if used out of specs.

I'm just testing a pair of DC motors that draw 15 amps at 24 to 36 V nominally when not working to hard. Haven't been able to stall them because I have no power supply that's able to supply the current. Runs very well on a pair of Curtis 1204. Would eat any RC controller in minutes.

Driving these controllers is very simple because they support PWM, 0 to 5 V and 0 tot 5 Kohm. They are also waterproof, ruggedized and don't need cooling unless you drive them very hard (250 amps continuously). The level of security built in can never be achieved by RC controllers or DIY. These things detect breakage of the control wire, for instance, so the motor never runs off because of a defect. It just stops. And they survive reverse polarity every time.

I've tried building a better controller. I've bought and ruined at least 30 other controllers. Almost all of these RC controllers are designed for airplane motors. High RPM, low torque, hardly any EMF. Tank drive motors are the exact opposite: High torque, low RPM, big EMF.

If you want to experiment with DIY controllers, start with a simple kit like the Velleman K8004
https://www.quasarelectronics.co.uk/Ite ... ulator-kit
It's only 6.5 REAL amps out-of-the-box, but you can easily beef it up to 50 amps with a different FET and some solid copper wire soldered to the board. Coupled to a current limited beefy power supply (24 V, 50 amps?) you can handle any 12 - 36 V DC motor for test purposes.

And maybe get a smaller motor to experiment with.

Another thing: don't expect DC motors to work well when connected in parallel on the same controller. DC motors need to be used in series, or they will lose power because of uneven EMF and they might even destroy the controller. It's something you probably won't notice on the bench, but you'll be amazed how bad it is when running them on terrain.

If you have 12 V motors in series, you obviously need at least a 24 V capable controller. And you can easily boost a series combo to 36 V if you need more power. DC motors are very sturdy.

Use relays for reverse. Full H-bridge controllers lose to much voltage.

bwag
Posts: 5
Joined: Wed Mar 11, 2015 5:02 pm

Re: High Amp Motors with the Pi

Fri Mar 13, 2015 3:50 pm

45 Amp continuous, 10$ for brushed esc, seems like the wires are pretty thick, I'm sure hobbyking would replace it if I blew it performing under their specs.

http://www.hobbyking.com/hobbyking/stor ... r_ESC.html

I'm planning on using the Banebots Rs-550 (55 Gear Ratio), 45 amp (ea.) over 4 motors is plenty.
My transmitter/receiver http://www.hobbyking.com/hobbyking/stor ... de_2_.html
I'll use a training plug from China to control the transmitter through a free program online, then write an outside code to control the program. Worst case I'll bind the program button to keys during operation, I have a mouse with macros.

Considering the amp draw I'm looking at about 6 to 12 minute run times and there isn't any large load applications (not 45 amps cont.)

Thanks for your experience input, now I'll be sure to monitor all the currents and separate the components in their own little containers so nothing spreads and I can tell exactly what went wrong! Do you have any preferred fan cooling method, or do you just control the heat by not drawing so many amps?
The robot's motors are incredibly overdesigned. I can decide to alternate motors during the drive to give a nice cool down time!
(Forward wheels drive a minute, rear wheels drive a minute, repeat.)

Post Scriptum:
You guys drop some serious money on this stuff, and get some seriously nice electronics! I can't imagine that ease of building when you can straight up buy these amazing pieces!

May I ask what motors you use Cyrano? I really appreciate your comprehensive post of knowledge!

User avatar
cyrano
Posts: 714
Joined: Wed Dec 05, 2012 11:48 pm
Location: Belgium

Re: High Amp Motors with the Pi

Mon Mar 16, 2015 1:44 pm

I tend to over dimension the controllers. That way I usually don't need fans.

Most of my motors are second hand. I buy these if I can find them on the cheap. The last pair was 30 €, used. I bought them off a nice guy who builds military scale models big enough to be driven by 6 tot 60 year old kids. Have a look here:

https://www.youtube.com/channel/UC_5cS8 ... x0C_tXvL3w

There are plenty motors out there. Even for free. It's the controllers that are rare. I recently bought 3 Curtis controllers for 20 € at a local flea marker. The seller believed one to be working. All 3 were good, but I stille have to stress test one of them.

These controllers are very expensive new, so there is an important second hand and refurbished market. But these are also expensive. OTOH, if people believe these are defective, you can pick 'em up for peanuts.

If I need new motors, the Chinese permanent magnet scooter motors are very good and quite reasonably priced. Around 60 € will get you a brand new 500W 24-36V motor including chain sprocket, sometimes even including a controller.

I am not as enthusiast about the average Chinese controller. Some are very good, some are bad. YMMV. I have tested a number of these RC controllers, not by Hobbyking, but comparable offerings and they perform well in general. They are not very error-proof, though. If you really block your motor, they will usually fail.

Of course, the scale you're building at is the most important factor. And the best stress test is having kids play with it.

Mark_T
Posts: 149
Joined: Sat Dec 27, 2014 10:54 am

Re: High Amp Motors with the Pi

Mon Mar 16, 2015 2:57 pm

aTao wrote: Diode: STTH6012W placed across source/drain of mosfet
Capacitor: combination 100nF, 10uF and 10,000uF across power supply.
NO! The diode goes across the motor. It provides a path for the current in the motor
windings when the MOSFET switches off. All power MOSFETs already have a built-in diode
as part of their structure, and if using 4 MOSFETs in an H-bridge each diode acts as a
free-wheel diode for its partner, so no extra diodes are needed.

Using a single MOSFET or transistor to switch a motor (or relay) you _must_ place
a diode across the _load_, cathode to positive supply.
Principal:When the current through a coil (motor winding) is changed the coil creates a voltage to oppose the change.
V(t)=L*di(t)/dt or voltage =- inductance * rate of change of current.
In a PWM control the current is cut almost instantly many times a second, which causes a large (huge) voltage to appear across the coil, this can exceed the ratings of the PWM power stage.. One way to deal with it is a transient suppressor across the motor (anything above a certain voltage is short circuited),quite wasteful. Another way is to push it back to the power supply and save it for later (like when the coil is turned on again). Since the power cables and connectors all have resistance then some capacitors place near to the motor circuit are ideal for storing the energy.
Yup, that's why the diode needs to be across the coil where the current is...
This diagram shows the idea (for solenoid read motor, R = 10k)
Image

boyoh
Posts: 1352
Joined: Fri Nov 23, 2012 3:30 pm
Location: Selby. North Yorkshire .UK

Re: High Amp Motors with the Pi

Mon Mar 16, 2015 3:55 pm

bwag wrote:Hey guys, I have a quick question.
How can I run a dc motor off of the pi? The motors stall current is 85 amps, I'd like to be able to run it to atleast 60 amps.

I was thinking I could just have the batteries directly wired to the motors (there are 4).

I found 40 amp motor controllers but they are seriously expensive, is there any low end way to actually do this?
Using the Pi to control high powered motors
Directaly NO , indirectly YES , by using
out/ put Buffer stages to switch high power
relays and contractors,
When writing your control program you must
consider a Fail to Safe system in the Closed
Loop, Isolation must be don in Open Loop..

Closed Loop( Auto )
Open Loop ( Manual For safty reasons)

Sugest using Opto Isolators in the Buffer stages
BoyOh ( Selby, North Yorkshire.UK)
Some Times Right Some Times Wrong

Return to “Beginners”