Linear Actuator is not working with BTS7960

Thread Starter

Muskaan Ahmad

Joined May 22, 2021
4
Hello,
I am trying to run linear actuator with BTS7960 motor driver and Arduino UNO. But, the code seems fine, wiring seems fine but after uploading the code, the linear actuator does not start.
I am using two push buttons to extend and retract the actuator.

The code is shown below:
byte mspeed=0;
C-like:
int RPWM = 5;
byte mspeed=0;
int LPWM = 6;


void setup() {

  // put your setup code here, to run once:

   Serial.begin(9600);

   pinMode(2, INPUT_PULLUP);

   pinMode(4, INPUT_PULLUP);

    pinMode(13, OUTPUT);


   pinMode(RPWM,OUTPUT);

   pinMode(LPWM,OUTPUT);

}


void loop() {

  // put your main code here, to run repeatedly:

  if( digitalRead(2) == LOW & digitalRead(4) == HIGH  ){

    mspeed = 255;

    analogWrite(RPWM,0);

    analogWrite(LPWM, mspeed);

    digitalWrite(13,HIGH);

  }

  else if( digitalRead(2) == HIGH & digitalRead(4) == LOW  ){

    mspeed = 255;

    analogWrite(RPWM,mspeed);

    analogWrite(LPWM, 0);

    digitalWrite(13,LOW);

  }

  else{

     analogWrite(RPWM,0);

    analogWrite(LPWM, 0);

  }


}
I am following the attached circuit diagram and using 12V DC power supply
 

Attachments

Last edited by a moderator:

drc_567

Joined Dec 29, 2008
1,156
... Are you able to turn the actuator spindle by applying 12 volts directly to the motor, maybe switching polarity, just to verify operation?
 

ericgibbs

Joined Jan 29, 2010
18,848
hi Muskaan,
Attached is the datasheet for the IBT2 Bridge driver and some other documents for IBT.

Please edit the PDF by adding the UNO connections to the IBT , also the Vcc and Vs voltage values.

We can the test the project and suggest what is causing the problem.
E
Added a clip of the circuit from the datasheet, so that you enter the above details
 

Attachments

ericgibbs

Joined Jan 29, 2010
18,848
Hi M,

This Sketch will switch Fwd/Rev at 1 second rate.?
Easier for quick testing.
It works OK in a buit project.

C-like:
// Muskaan Alternate 1 second Fwd/Rev 230521.57A

byte mspeed=0;
int RPWM = 5;
int LPWM = 6;

void setup() {
   Serial.begin(9600);
   pinMode(2, INPUT_PULLUP);
   pinMode(4, INPUT_PULLUP);
   pinMode(13, OUTPUT);
   pinMode(RPWM,OUTPUT);
   pinMode(LPWM,OUTPUT);
}
void loop() {
    mspeed = 255;
     Serial.print("Fwd ");
    Serial.println(mspeed);
    analogWrite(RPWM,0);
    analogWrite(LPWM, mspeed);
    digitalWrite(13,HIGH);
delay(1000);
     Serial.print("Rev ");
     Serial.println(mspeed);
    analogWrite(RPWM,mspeed);
    analogWrite(LPWM, 0);
    digitalWrite(13,LOW);
delay(1000);  
}
 

Attachments

Top