PDA

View Full Version : Motor Drivers



Avinash Nagaraj
06-06-2011, 11:03 PM
I wrote a suitable program for a motor test in which the motor will rotate clockwise and anticlockwise and burnt successfully into the MCU.I used 12V 2A DC adaptor to power the board.But the motor is not rotating.But when the same motor is connected to 12V battery,it is rotating.Please hint what went wrong?

maddy_nish
06-07-2011, 08:40 AM
Please post your code as well as your circuit. L293D motor driver has 2 VCC pins.. 5V and a 12V. check if you have connected both the pins...

roopakjada
06-07-2011, 11:40 AM
Hi,
a micro controller doesn't supply enough current to drive a motor you'll need additional driving circuitry like a IC motor driver or a h-Bridge out of transistors google for H-Bridge and you'll understand :) (here i gues ur not using a Motor driver ic)
if ur using one
Post the code and your connections we will help you out !

Avinash Nagaraj
06-07-2011, 04:44 PM
#include <avr/io.h>
#include <util/delay.h>

void Wait()
{
uint8_t i;
for(i=0;i<80;i++)
_delay_loop_2(0);
}

void main()
{
//First Set up I/O Ports as OUTPUT
//PC0 and PC1 as output
DDRC|=((1<<PC0)|(1<<PC1));

//Repeat the sequence forever
while(1)
{
//Clockwise Motion
PORTC|=(1<<PC0); //PC0 = HIGH
PORTC&=(~(1<<PC1)); //PC1 = LOW

Wait();


//Stop
PORTC&=(~(1<<PC0)); //PC0 = LOW
PORTC&=(~(1<<PC1)); //PC1 = LOW

Wait();


//Counter Clock Wise Motion
PORTC&=(~(1<<PC0)); //PC0= LOW
PORTC|=(1<<PC1); //PC1= HIGH

Wait();


//Stop
PORTC&=(~(1<<PC0)); //PC0 = LOW
PORTC&=(~(1<<PC1)); //PC1 = LOW

Wait();
}
}
The above is the code.Actually I ordered the Development Board from Extreme Electronics.They provided me with completely soldered PCB in which connection from MCU to motor drivers was provided by them.

roopakjada
06-07-2011, 05:16 PM
hi!
Extreme electronics provides you with online documentation ! have a look there!

this might be ur problem !

NOTE: Make sure that Jumper JP2 is in OFF position. This will configure the board so as to DISABLE speed control of MOTOR-A. Since it is a very basic experiment so to keep it simple we are NOT using PWM speed control. PWM Speed control will be described in next tutorials.

this is specified on the website itself !

http://www.xboard.extremeelectronics.co.in/Motor1.htm

Avinash Nagaraj
06-07-2011, 10:59 PM
I tried with that also.Its not working.

avinash_g
06-08-2011, 12:29 PM
you might be connecting motor to the wrong motor connecter. Connect motor to "motor-a" connecter.

Actually in this doc
http://www.xboard.extremeelectronics.co.in/Motor1.htm

The image shows the wire connected to MOTOR-B (we cannot take separate image for each four motors)

So the motor should be connected to MOTOR-A terminal (labled on PCB)

Also try toggling the position of JP2 and JP3. I mean move the two PIN jumper to the other side so that now they join the enter pin to the other pin. This will change the PWM control to Always on position that means always full speed.

Avinash Nagaraj
06-08-2011, 07:15 PM
I have tried with all the possibilities what you have mentioned above.Still,its not working.