setup1.jpg (317212Bytes)
setup2.jpg (428338Bytes)
I am currently working on a line following car project.
I am quite new to electronics and it would be no surprise if I miss something basic in the theory side.
I am trying to control 4 motors using my Dagu 4 channel motor controller and Arudino Mega 2560. I am having power problems and after researching and some testing, I am quite clueless about what exaclty is wrong.
I have programmed the arduino mega to set the direction pin to HIGH and the PWM pin to 255. I have 2 setups for testing.
NOTE: I FORGOT to add the motors to the circuit diagram, I am using brushed MM18 (size 260) motors (I am only controlling one motor for this experiment), their nominal voltage is less than 6V but I've ran them at 9.6v (which obviously shortens their lifetime)
Setup 1 (the ideal setup), both boards are powered from one battery:
FINDINGS
-powering just the arduino mega 2560 alone (nothing connected to it at all) and the board gets quite hot around the USB port area
-eventually after connecting the dagu motor controller and turning on the arudino and then the dagu motor controller, the arduino's 5V voltage regulator died.
-Leads me to think that my battery is too powerful? (It did say in the manual to use for RC applications only, although I've seen other people use NiMH batteries and I thought that a device would only draw as much current as it needs. Maybe it's to do with the regulator not coping with the battery?).
Anyways....
Setup 2 (because the arduino 5v regulator got fried from setup 1) Arduino is powered through USB, and the 9.6v NiMH only powers the dagu motor controller's external power supply connections:
The process is that I would power the arduino and then the dagu motor contorller's logic. Then plug power to the dagu controller's external power supply pins.
FINDINGS:
-I tried running all 4 motors and it took 2 seconds before one of the motors started moving slowly... when it did one of the dagu controller's chips started smoking
-now, I am only trying to ruen one motor: the motor would run for a few seconds, the motor would stop and one of the chips on the board starts smoking. I've repeated this step a few times and the chip smokes everytime.
-When I set the arduino's PWM output to 10 (arduino accepts 0-255), I hear a high pitch noise from hear motor.
-I changed the Dagu controller's external power supply to 6AA alkaline batteries, I ran the motors for quite a while (liek 10 seconds) and no smoke, but that same chip was getting very hot.
Here's the code, just incase the program might have errors:
//*********NOTE******** KEEP motor naming in this order for everything
//rear right motor [1]
#define dirMotRR 22
#define pwmMotRR 4
//rear left motor [2]
#define dirMotRL 24
#define pwmMotRL 5
//front right motor [3]
#define dirMotFR 26
#define pwmMotFR 6
//front left motor [4]
#define dirMotFL 28
#define pwmMotFL 7
void setup() {
//setup motor pins
pinMode(dirMotRR, OUTPUT);
pinMode(dirMotRL, OUTPUT);
pinMode(dirMotFR, OUTPUT);
pinMode(dirMotFL, OUTPUT);
}
void loop() {
digitalWrite(dirMotFL, 1);
analogWrite(pwmMotFL, 255);
}
I have bought another Dagu 4 motor controller and am hoping I dont fry this one.
Any help would be greatly appreciated!