Go Down

Topic: Driving a Linear Actuator with PWM and Pololu Motor Driver (Read 1 time) previous topic - next topic

Treefingers

Mar 08, 2012, 07:13 pm Last Edit: Mar 08, 2012, 07:14 pm by Treefingers Reason: 1
Hey guys,

I'm trying to drive a linear actuator (http://www.framo-morat.com/Mini0.html) with an H-bridge driver (http://www.pololu.com/catalog/product/1212) using PWM. I'd like the actuator to drive 3 inches forward, pause/rest, and reverse direction after a given period.

Presently, I am not yet incorporating feedback.

In pursuit of that, do these inputs seem legitimate? I don't want to break anything!

Driver EN --> Arduino Digital 7
IN1 --> Arduino Digital 4
IN2 --> Arduino Digital 5
D1 --> Arduino GND1
D2 --> Arduino Digital 10
GND --> Arduino GND2
VDD --> 5V

VIN --> Power Source (+)
GND --> Source (-)

OUT1 --> Actuator (+)
OUT2 --> Actuator (-)

-----

I've also seen code written for the dual motor Pololu driver. Is this on the level?

Code: [Select]
#define stby 7
#define motoryon1 4
#define motoryon2 5
#define motorhiz 10

int incoming=0;
int derece;
void setup(){

 pinMode(stby,OUTPUT);
 pinMode(motoryon1,OUTPUT);
 pinMode(motoryon2,OUTPUT);
 digitalWrite(stby,HIGH);
 digitalWrite(motoryon1,HIGH);
 digitalWrite(motoryon2,LOW);
 Serial.begin(9600);
}

void loop(){

 if(Serial.available()>0){
   incoming=Serial.read()-'0';
 }
 derece=map(incoming,0,9,0,255);
 analogWrite(motorhiz,derece);
 Serial.println(derece);
 delay(1000);
}


Thanks.

Go Up