Go Down

Topic: Help needed to interface Pololu 3A Motor Controller (Read 1 time) previous topic - next topic

rajFanOfSachin

Hi all ,
Recently i bought a motor controller from pololu http://www.pololu.com/catalog/product/392

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.
Code: [Select]
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

Grumpy_Mike

Quote
Recently i bought a motor controller from pololu http://www.pololu.com/catalog/product/392
I want to connect a hobby servo motor to this and control it

Why?
You can not control a servo with a motor controller like this.

rajFanOfSachin

I can but as a first step,, later on i want to have PID cotroller with closed loop control

rajFanOfSachin


Grumpy_Mike

Quote
I can

Suite yourself, so you will know how to wire it up then?
I am not sure anyone can show you how to do something only you think can be done.

jraskell


hey just verify my board connections?



This may be futile given Mike's success (lack of), but here goes;

Quote
RC Hobby servo is connected to controller's motor positive and negative inputs (PWM input is left out)


An RC hobby servo will not do anything until you give it a pwm input signal telling it what to do.  With that left out, you have a nonfunctional servo.

AWOL

I'm not even sure what a servo will do if you power it from high frequency PWM instead of DC.
I assume the OP was going just set the PWM to 100%.
Can't think why you'd want to do it though - seems a very expensive way of powering a servo.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Go Up