Go Down

Topic: 3 motors on an arduino????? (Read 2718 times) previous topic - next topic

amp625

Hello friends!  Im having a lot of trouble figuring this out.  Im building a small rover,   3 WD  with amni wheels, gunna be awesome,  but i cant seems to find a motor shield that will supply 3 DC motors.  I need at around 2 amps out of the motor and around 12 volts, i dont want it going insanely slow.  The adfruit shield is only good for very small motors and the L298 only supports 2 motors.  Can i make my own bridge.  Advice?   thanks for your time!

jaredpi

Quote
Can i make my own bridge.

Yeah,http://library.solarbotics.net/circuits/driver_4varHbridge.html
in the link, use four high current transistors or a bunch of smaller ones attached in parallel. Also, instead of connecting the input to a 7414 ic, just attach it to the arduino.

Or if you have unlimited funds you could get a few of these: http://www.ifirobotics.com/victor-883-speed-controller-robots.shtml 8)

amp625

can you controll speed and direction? with the transistor circuit?

dc42

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

amp625

Is there enough room on the uno to fit three?

dc42

#5
Nov 27, 2012, 01:28 pm Last Edit: Nov 27, 2012, 01:32 pm by dc42 Reason: 1
Yes. To control each bridge you need only the DIR and PWM pins, so that's 2 pins per motor, 6 in total. If you want to set the current limit then you need the SPI pins as well (you may need them anyway to configure the device the way you want it), but the controllers can be daisy chained (see http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/CD00268302.pdf). So that's 4 shared pins. If you also want to power all 3 down, you will need one more output pin to drive either the EN inputs or the DI inputs. Total 3 PWM pins and 7 normal outputs (8 if you want to power the drivers down to save battery). You still have 9 or 10 pins left, also 3 of the SPI pins can be shared with other SPI devices.

BTW I've never used that board so I can't vouch for its quality, however the chip it is built around looks very nice.

[EDIT: by "enough room" I assumed you meant "enough output pins". These are not shields so they do not plug directly on top of a Uno.]
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

amp625

yeah i did mean pins, that clear up a lot thanks. also do you know how many amps those bridges can support per motor?  it wasnt on the description

dc42

The chip (see datasheet I linked to before) has built-in current limiting which you can set (by SPI) to set 4 different current limits: 2.5A, 4A, 6.6A and 8.6A. At the higher end of that range you would probably need a fan to keep the heatsink cool.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

amp625

#8
Nov 27, 2012, 05:05 pm Last Edit: Nov 27, 2012, 05:18 pm by amp625 Reason: 1
But the link on ebay isnt a L9958 (the data sheet you sent me), and how do you daisy chain?  Does all the stuff from the data sheet apply to that bridge?  Thanks for all your time.  Also can you run brushless motors on it?

dc42

Good point. The eBay page says the unit is a SX8847. When I googled "SX8847 datasheet", the first match was the L9958 datasheet I linked to. I don't know why, I can't find any mention of SX8847 in the datasheet.

However, the description of the I/O interface on the eBay page matches the description in the datasheet, so does the block diagram. Also, another item I found on eBay that appears to be a rather similar board has a L9958 chip in the photo, see http://www.ebay.co.uk/itm/Arduino-240W-High-power-H-Bridge-Motor-Driver-Module-Smart-Car-Driver-/330817755465?pt=LH_DefaultDomain_0&hash=item4d06465949.

So I think it very likely that the unit I linked to is based on the L9958.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

amp625

Thanks for all your help!  im starting to really iron out some details, heres a picture of what i drew up on sketchup.  http://s1302.beta.photobucket.com/user/amp6251/media/ScreenShot2012-11-27at60618PM.png.html?sort=3&o=0

thefarmer42

I have a couple of the sx8847 sonxun high power h bridges. Bought on ebay. I have one working with the following code:

/*
  Motor test with Sonxun high power h bridge sx8847 MN 2013
  Motor waits for one second, goes clockwise for 4 seconds, waits for one second,
  anticlockwise for 4 seconds, waits for 1 second, repeats.
  Monitor with serial port updates.

*/

//Functions used on h bridge pcbs.
int oneen = 8;             // enable
int onedir = 9;            // direction
int onepwm = 10;           // pulse width modulation
int onedi = 2;             // disable
//also connect GND and VCC obviously

// the setup routine runs once when you press reset:
void setup() {               
  // initialize the digital pins.
  pinMode(onedir, OUTPUT);
  pinMode(onepwm, OUTPUT);
  pinMode(oneen, OUTPUT);
  pinMode(onedi, OUTPUT);
  Serial.begin(9600);   //starts serial port
}

// the loop routine runs over and over again forever:
void loop() {
/* 
  //turn all low
  digitalWrite(oneen, LOW);   // part 1, h bridge activation
  digitalWrite(onedi, LOW);   // part no disable 
  digitalWrite(onedir, LOW);   // high turns forwards, low is reverse
  digitalWrite(onepwm, LOW);   // high runs motor (if h bridge is on)
*/
  Serial.print(" wait1");
  delay(1000);
 
// onedir high, onepwm low, works clockwise
  digitalWrite(oneen, HIGH);   // part 1, h bridge enable
  digitalWrite(onedi, LOW);   // part 2, h bridge no disable
  digitalWrite(onedir, LOW);   // high turns anticlockwise, low is clockwise
  digitalWrite(onepwm, HIGH);   // high runs motor (if h bridge is activen)
  Serial.print(" clockwise");
  delay(4000); 

//turn all low (motor off)
  digitalWrite(oneen, LOW);   
  digitalWrite(onedi, LOW);   
  digitalWrite(onedir, LOW);   
  digitalWrite(onepwm, LOW);   

  Serial.print(" wait2");
  delay(1000);
 

  //onedir high, onepwm high, works anticlockwise
  digitalWrite(oneen, HIGH);   // part 1, h bridge activation
  digitalWrite(onedi, LOW);   // part 2, h bridge no disable 
  digitalWrite(onedir, HIGH);   // high turns anticlockwise, low is clockwise
  digitalWrite(onepwm, HIGH);   // high runs motor (if h bridge is on)
  Serial.print(" anticlockwise");
  delay(4000);               // wait for 1 second

//turn all low (motor off)
  digitalWrite(oneen, LOW);   // part 1, h bridge activation
  digitalWrite(onedi, LOW);   // part no disable
  digitalWrite(onedir, LOW);   // high turns forwards, low is reverse
  digitalWrite(onepwm, LOW);   // high runs motor (if h bridge is on)

 
  Serial.println(" wait3");
  delay(1000);
}

henktronik

Hi thefarmer42, and all other,

I bought the same board from ebay and wait for it now. Do you or anybody else have some expierience with the SPI interface of ths board? I read already the datasheet of the ST - L9958. I found out that it is necessary to enable there the "CL_2" flag in the configuration register to get the highest current limitation(8.6A). The standard is 6.6A.
In fact I look for an open source example for a SPI-communication to this board (sx8847). Or anything what helps to start.

My project is very simple :smiley-roll: Only control the speed of a 12V DC motor with 100W.

Thanks it advance.

Henry_Best


Hello friends!  Im having a lot of trouble figuring this out.  Im building a small rover,   3 WD  with amni wheels, gunna be awesome,  but i cant seems to find a motor shield that will supply 3 DC motors.  I need at around 2 amps out of the motor and around 12 volts, i dont want it going insanely slow.  The adfruit shield is only good for very small motors and the L298 only supports 2 motors.  Can i make my own bridge.  Advice?   thanks for your time!


I have an Adafruit motor shield. It has 2 * L293s and supports up to 4 motors. The L293 can supply up to 1Amp to each motor. To get up to 2Amps, Adafruit suggests 'piggybacking' another L293 on each of the other L293s. Just put one chip on top of the other and solder the legs of the top chip to the top of the legs of the bottom chip. The result resembles two cockroaches mating  :)

henktronik

Thanks for your answer. I calculate approx. 8 to 10A for my motor. So I have to use many of these IC's. That is not my solution. Does anybody have used this motor driver?

Go Up