positioning a linear actuator using a board

I am new to programing and my question may seem basic to you. For a project I need to control a linear actuator to drive an exact position (let say target 1) and wait (delay) and drive again to a new position (target 2) and keeps moving between these two set points for a certain amount of times. I am using an Arduino UNO, LAC board (Firgelli) to control a p-series linear actuator from Actuanix (L12-P Micro Linear Actuator - Stroke: 100 mm- force/speed combinations : 50:1 & 6 vdc). The LAC board (H-bridge circuit) has 4 built-in potentiometer that control the speed, accuracy, retract and extend status of the actuator and it is directly getting the power from a DC power supply. The PWM pin of my Arduino; pin 9, is connected to RC pin (Hobby Servo input signal) of the LAC board.
I modified the servo sweeping code, however I noticed random movement of the actuator. It seems I can't correlates each angle to a certain distance which is a fraction of full stroke.
I don't know how to get position feedback from the board to make command to the Arduino. I appreciate your input.

#include <Servo.h>

Servo myservo;  // create servo object to control a servo
// twelve servo objects can be created on most boards
float x = 0.4;
//float pos;    // variable to store the servo position
bool done = false;
float full_length = 100;
float pos = x * full_length;

void setup()
{
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object
}



int counter = 0;

void loop() {
  if (counter < 2) {
    for (pos = 0  ; pos <= x * full_length; pos += 1) // goes from 0 degrees to 180 degrees
    { // in steps of 1 degree
      myservo.write(pos);              // tell servo to go to position in variable 'pos'
      delay(30);                       // waits 15ms for the servo to reach the position
    }
    done = true;
    for (pos = x * full_length; pos >= 0;  pos -= 1) // goes from 180 degrees to 0 degrees
    {
      myservo.write(pos);              // tell servo to go to position in variable 'pos'
      delay(30);                       // waits 15ms for the servo to reach the position
    }
    done = true;
    counter = counter + 1;
  }
}

Did you connect the Arduino and LAC board grounds?

Please post a link to the user documentation for the LAC board.

Yes, they are sharing the same ground (gnd of Arduino connected to LAC ground).
Here's the link:

That is a fairly complex and flexible industrial control board. It is not designed for use with Arduino, although according to this very skimpy blog article, limited control by Arduino is possible. The data sheet I looked at leaves a lot to be desired (well, atrocious) so this is not a beginner project, and I don't see much to recommend.

Position feedback comes from the linear actuator, so consult its data sheet.

It would be a good idea to provide a lot more information about your setup, e.g. how the board and actuator have been wired, configured and powered and what instructions you have been following so far.

Hi,
Can you post a picture of your project please?

Can you post a circuit diagram of your project please?

Thanks.. Tom.. :slight_smile:

Just included a circuit diagram of my setup.
Let me know if this is what you want.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.