Hi,
I have a simple project using Arduino Uno, L16-P Miniature Linear Actuator with Feedback and the Firgelli Linear Actuator Control Board (LAC), I connected the Arduino to the LAC using pin -9 to "RC / Hobby Servo input signal" as in the image below:

the code is very simple:
#include <Servo.h>
#define PIN_SERVO (9)
#define START_POSITION (20)
#define END_POSITION (35)
Servo myServo;
void setup() {
// set servo
myServo.attach(PIN_SERVO);
//open serial window for log
Serial.begin(9600);
}
void loop()
{
SetStrokePerc(START_POSITION);
Serial.println("START_POSITION");
delay(5000);
SetStrokePerc(END_POSITION);
Serial.println("END_POSITION");
delay(5000);
}
void SetStrokePerc(float strokePercentage)
{
if ( strokePercentage >= 1.0 && strokePercentage <= 99.0 )
{
int usec = 1000 + strokePercentage * ( 2000 - 1000 ) / 100.0 ;
myServo.writeMicroseconds( usec );
}
}
The Problem: when running the project the actuator stroke doesn't fully stop at the START/END points but keeps on moving a millimeter in and out all the time as shown in this clip
What is it I'm missing here??
Thank you all in advance,
Best,
Ram
