Controlling Firgelli linear actuator speed

I have a linear actuator (http://www.firgelli.com/Firgelli_Technologies_PQ12_R_p/pq12-r.htm) that I want to be able to slow down. Right now, the shaft moves too quickly. I’m not sure how to do this. I was looking into varSpeedServo.h library but couldn’t implement it.

//Includes
#include <Servo.h> 

//Defines
#define LINEARACTUATORPIN 9        //Linear Actuator Digital Pin



const int button1Pin = 4;     // the number of the pushbutton pin


// variables will change:
int button1State = 0;         // variable for reading the pushbutton status


Servo LINEARACTUATOR;  // create servo objects to control the linear actuator

int linearValue = 10000;   //current positional value being sent to the linear actuator. 

void setup() 
{ 
  //initialize servo/linear actuator objects
  LINEARACTUATOR.attach(LINEARACTUATORPIN, 1050, 2000);      // attaches/activates the linear actuator as a servo object 

  // initialize the pushbutton pin as an input:
  pinMode(button1Pin, INPUT);   


  //use the writeMicroseconds to set the linear actuators to their default positions
  LINEARACTUATOR.writeMicroseconds(linearValue); 

} 

void loop() 
{ 

  // if the pushbutton is pressed set the linear value
  button1State = digitalRead(button1Pin);
  if (button1State == HIGH) {    
    // set the position value  
    delay(2000);  
    linearValue = 1050; 

  } 

    if (button1State == LOW) {    
    // set the position value  
    linearValue = 2000;  
  } 

  //use the writeMicroseconds to set the actuator to the new position
  LINEARACTUATOR.writeMicroseconds(linearValue); 
delay(3000);  
}

Please don't cross-post.

Hi,

If you don't need to get different speeds in your sketch, and don't need a very specific speed I see an "easy" no code solution.It's the hardware solutions:

  • By providence if you bought the 30:1 version, returning your stuff to change it for the 63:1 or 100:1 version could give you 1/2 or 1/3 speed.

-I saw a board which can also control the speed via one of the build-in potentiometer, it seems to work with -P serie so you have to change your actuator. Check arduino forums to use this board because between theory and reallity there is a world !
here the board : http://www.firgelli.com/LAC_Board_p/lac.htm