Problem controlling Linear Actuators

New to Arduino so please bear with me.

Let me explain the setup . I am developing a setup which uses linear actuators. The Arduino is connected to a motor driver and it sends a pulse of some duration to a motor driver (IBT_2 PCB, containing[ BTS 7960]). The motor driver then tells the linear actuator to move forward or reverse depending on the input from arduino. The battery I am using is the Build Power 4500mAh Li-Po 11.1V 4500mAh 30C battery.

I obtained a basic actuator LYX LX 600, 200mm, 300N, 100mm/s, unable to find any datasheet for the same) to test. A simple reversing test was used in which the actuators would first extend for some time and then retract for the same time (code attached below). With the actuators, I found some anomalies. Sometimes the actuator would not come back to the same position as the starting position. Also, a difference in lengths extended by the actuator was observed when turning it on for 1 step of 500 milliseconds and 5 steps of 100 milliseconds.

I had concerns as to what was causing the problem. Whether taking a better actuator would solve the problems or I would face the same issues due to some other part of the hardware.
A rough hand-drawn schematic of the setup and the Arduino code being used are attached.

It would be great if any mistakes made could be pointed out and whether the problem is with some of the hardware.

int fwd=11;
int rev=10;

int ren=6;
int len=5;
int tim=3000;

void setup() {
  // put your setup code here, to run once:
  pinMode(fwd,OUTPUT);
  pinMode(rev,OUTPUT);
  pinMode(ren,OUTPUT);pinMode(len,OUTPUT);

  digitalWrite(ren,HIGH); digitalWrite(len,HIGH);
}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(fwd,HIGH);
  digitalWrite(rev,LOW);
  delay(tim);
  digitalWrite(fwd,LOW);
  digitalWrite(rev,LOW);
  delay(750);
  digitalWrite(fwd,LOW);
  digitalWrite(rev,HIGH);
  delay(tim);
  digitalWrite(fwd,LOW);
  digitalWrite(rev,LOW);
  delay(750);
}

We really need numbers to understand your problem. When you say it doesn't "come back to the same position" or "difference in lengths" what are you talking about? How much of a difference?

That said, my guess about the back and forth not returning to the same spot is that it's due to backlash in the geartrain: that's something you need to deal with in all kinds of motion systems. Could also be the same problem taking multiple short steps or one long step: after it pauses, the powertrain "relaxes" a bit and sags.

If you want to avoid this, you can use an actuator with a position feedback potentiometer and then you will always know exactly where it is.

Hi, @doodle_foodle
This is the specs from the technical section of the linked page.

Brand Name: LYX
Certification: CE
Commutation: Brush
Construction: Permanent Magnet
Efficiency: IE 1
Gear Material: Nylon
limit switch: Internal
Model Number: LX600
No-load current: 12V:1-2A 24V:0.5-1A
Output Power: 55W
Protect Feature: No waterproof
Starting current: 12V:3A 24V:2A
Stroke: 100mm
Type: Gear Motor
Usage: Massage chair

A @cedarlakeinstruments has pointed out, get accurate position control you will need an actuator with position feedback, or add some sort of external measurement system.

Tom... :grinning: :+1: :coffee: :australia:

Thanks @cedarlakeinstruments and @TomGeorge for the helpful replies.

To address @cedarlakeinstruments question, when i kept it running for 1 second it would extend 2 inches. But when i would do it in 5 steps it would end moving an average of 1 inch, but it would vary largely below and above this value.

I realised the importance of some sort of feedback so i tried to incorporate some feedback element into it. I am creating this setup for a barebone purely electric steering. So i am getting the position of the two wheels using 2 potentiometers, and comparing to the position of the steering wheel potentiometer. I have 2 actuators for the left and right wheel.

I find out the required position of left and right wheel using the steering angle, compare them to the actual values and then signal the actuators to extend or retract based on that. Below is the code for the same.

int enable = 8;
int right_fwd = 11, right_rev = 10;
int left_fwd = 5, left_rev = 4;
int steer = A0;
int left = A2; int right = A3;

float steer_posn = 512;
float left_posn = 512; float right_posn = 512;
float left_req = 512, right_req = 512;

void setup() {
  pinMode(enable, OUTPUT);
  pinMode(right_fwd, OUTPUT); pinMode(right_rev, OUTPUT);
  pinMode(left_fwd, OUTPUT); pinMode(left_rev, OUTPUT);
  pinMode(steer, INPUT);
  pinMode(left, INPUT); pinMode(right, INPUT);
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  float a=analogRead(steer); float b=analogRead(left); float c=analogRead(right);
  steer_posn = a *300/1023; 
  left_posn= b*300/1023;  right_posn= c*300/1023;
  Serial.print("steer:"); Serial.print(steer_posn);
  Serial.print(",   left:"); Serial.print(left_posn);
  Serial.print(",   right:"); Serial.print(right_posn);

  if (steer_posn > 150) {       //converting steering angle to required left and right wheel angles from graph depending on which half steering angle in
    left_req = 0.8 * steer_posn;
    right_req = steer_posn;
  }
  else {
    left_req = steer_posn;
    right_req = 0.8 * steer_posn;
  }

  if (left_req == left_posn || abs(left_req-left_posn)<=1.8)    //conditions for left
    leftStop();
  else if (left_req < left_posn){
    leftRev();
  else if (left_req > left_posn)
    leftFwd();

  if (right_req == right_posn || abs(right_req-right_posn)<=1.8)    //conditions for right
    rightStop();
  else if (right_req < right_posn)
    rightRev();
  else if (right_req > right_posn)
    rightFwd;


  delay(200);
}


void leftStop() {
  
  digitalWrite(left_fwd, LOW);
  digitalWrite(left_rev, LOW);
}
void leftFwd() {
  
  digitalWrite(left_fwd, HIGH);
  digitalWrite(left_rev, LOW);
}
void leftRev() {
  
  digitalWrite(left_fwd, LOW);
  digitalWrite(left_rev, HIGH);
}

void rightStop() {
  digitalWrite(right_fwd, LOW);
  digitalWrite(right_rev, LOW);
}
void rightFwd() {
  digitalWrite(right_fwd, HIGH);
  digitalWrite(right_rev, LOW);
}
void rightRev() {
  digitalWrite(right_fwd, LOW);
  digitalWrite(right_rev, HIGH);
}
  1. I expected this to work, but this ended up causing another problem. Now the motor drivers are not turning on. Using a multimeter i saw that the respective arduino pins are correctly HIGH or LOW. Please suggest some steps for troubleshooting, i have remade and checked the circuit multiple times but may have missed something.

  2. I noticed some weird behaviour when i connected one of the actuators to the motor drivers and turned the motor driver on manually. I expected the potential across the motor terminals to be 12V, and this is obtained when the actuator is not connected. But when the actuator is connected the voltage drops to 6.5V across both the battery terminals and the motor terminals of the motor driver.

Also @TomGeorge could you please share the page from where you found the specifications for the actuator.
TIA

No surprises there. You need an actuator designed for position control for this application. There are many different models available.

But when the actuator is connected the voltage drops to 6.5V across both the battery terminals and the motor terminals of the motor driver.

Wiring or battery problem. Post a link to the actual motor driver board, and a schematic in which you have clearly labeled all the connections, including power and ground.

When you do one big “run” , you accelerate the motor -run a bit -decelerate and stop .

If you do this in short bursts , you have many more accelerate /decelerate occurrences, so the distance covered is less , even if the time adds up to the same amount .

Hi,
Your link to the controller goes to the actual IC, does the controller module have an EN pin?
Can you please post a link to the actual controller module?

Thanks.. Tom... :grinning: :+1: :coffee: :australia:

First of all thanks everyone for the help.
All those explanations really helped me figure out the flaws in my design.

Coming to my problems, I was drawing too much current from the Arduino is what I can fathom. Upon switching the enable pin to constant 5V everything started working like a charm and all components are currently working.

@TomGeorge this is the link to the motor controller if it is any help now.

Again thanks a lot everybody for all the help and explaining the problem in detail.
Cheers.