Hi all ,
Recently i bought a motor controller from pololu Pololu 3A Motor Controller with Feedback
I want to connect a hobby servo motor to this and control it.controlling in the sense that i should be able to rotate it forward and backwards as a first step .
Is any microcontroller board is needed to control it? (Like arduino board,, because i have it)
This is the link to the user guidehttp://www.pololu.com/file/0J61/smc03a_guide.pdf
can you give me the connection diagram to connect the RC hobby servo to the controller through Arduino?
I have used the following link to get going http://printarduino.blogspot.in/2010/02/arduino-and-pololu-motor-controller.html
I have tried the code and with following connections:
controller pin3 (Serial input ) is given to Arduino digital pin1(TX pin)
controller pin5(Reset pin) is given to Arduino digital pin7
RC Hobby servo is connected to controller's motor positive and negative inputs (PWM input is left out)
controllers pin1 and pin2 & motor power and ground (Motor controller) are supplied from Arduino 5v
Jumper J1 is removed to select the serial interface.
I have used the following code and uploaded successfully.
int resetPin = 7; //need to have a reset pin so you can control motors
void setup()
{
delay(1000); //delay for 1 second
Serial.begin(9600); //Serial set to 9600 baud
pinMode(resetPin,OUTPUT); //set the reset pin to HIGH to program
delay(1000); //delay for 1 second
//move motor(s)
}
void loop()
{
digitalWrite(resetPin,LOW); //reset the motorcontroller
delay(100); //delay for 1 msec
digitalWrite(resetPin,HIGH); //intitiate motorcontroller
delay(1000); //delay 1 second
//Serial.print(0x80,BYTE); //command motorcontroller
//Serial.print(0x00,BYTE); //move parameter
//**motors are configured as motors 2 and 3 by default 2 is right side and 3 is left side
//Serial.print(0x05,BYTE); //right side motor move forward
//Serial.print(0x04,BYTE); //right side motor move backward
//Serial.print(0x07,BYTE); //left side motor move forward
//Serial.print(0x06,BYTE); //left side motor move backward
//Serial.print(0x3F,BYTE); //speed setting command 0x7F = full speed; 0x3F half speed; 0x00 speed off
//both motors in sequence allowing both motors to move
Serial.print(0x80,BYTE); //command motorcontroller
Serial.print(0x00,BYTE); //move parameter
Serial.print(0x05,BYTE); //right side motor move forward
Serial.print(0x3F,BYTE); //speed setting command 0x7F = full speed; 0x3F half speed; 0x00 speed off
Serial.print(0x80,BYTE); //command motorcontroller
Serial.print(0x00,BYTE); //move parameter
Serial.print(0x07,BYTE); //left side motor move forward
Serial.print(0x3F,BYTE); //speed setting command 0x7F = full speed; 0x3F half speed; 0x00 speed off
delay(3000); //let it run for 3 seconds
}
Thanx