Problem with Linear Actuator through a Relay!

PROJECT:

Hello, I am doing a project that involves a extending a boom from a metal housing, once it extends it dwells, then retracts back into the metal housing and the linear actuator extends (closes the door to housing). There are also cameras recording the whole time.

PROBLEM:

The linear actuator doesn't extend even though it is getting 24V (We measured with a Voltmeter and we tried switching polarity). The relay is also working and the lights turn on when we set the pins LOW signifying that it was triggered. We also measured continuity on the relay pins and the wiring was fine.

The odd thing is, if we set the linear actuator pin (actPin = 6) LOW in the setup, it closes properly. But, if we set it LOW after the code for our motor has run, it doesn't close, even though it seems to be getting 24V.

If anyone could help with this problem, thank you in advance! The parts are listed below, along with the code. Let me know if you need more information to help solve my problem. Again, thanks!

PARTS:

Cameras: GoPro Hero 3 (x 2)

Linear Actuator: https://www.amazon.com/gp/product/B01N9BUOSN?pf_rd_p=019ad97c-f176-43be-96b9-991a6dc65763&pf_rd_r=FH183YDP61JMC9JW4FSQ&th=1

Relay:https://www.amazon.com/WINGONEER-level-trigger-4-channel-Module/dp/B077XB9GCQ/ref=sr_1_fkmrnull_3?keywords=WINGONEER+low+level+trigger+4+channel&qid=1558024447&s=gateway&sr=8-3-fkmrnull

Motor: 24Y - High Torque Stepper Motor (MODEL 24Y-308D-LW8)

int pulsePin = 3;
int dirPin = 5;
int enablePin = 4;

int cameraPin = 7;
int actPin = 6; 

int fullIn = 9;
int fullOut = 8;

int timerEvent = 13;
int timerEventCam = 11;
int camOn = 0;

int motorSpeed = 600; //PWM pulse width in microseconds

//int stepsTen = 500; //(10/(motorSpeed*10^(-3)))/1; //number of steps for the for loop to go through to last for 10 secs

void setup() {
  //setting up all output pins
  pinMode(pulsePin, OUTPUT);
  pinMode(dirPin, OUTPUT);
  pinMode(enablePin, OUTPUT);
  pinMode(cameraPin, OUTPUT);
  pinMode(actPin, OUTPUT);

  //Setting up all input pins
  pinMode(fullIn, INPUT);
  pinMode(fullOut, INPUT);
  pinMode(timerEvent, INPUT);

  //The relay is low logic activated so I initialize all of the relay pins to be high to prevent the relays for being tripped on from the start
  //Also disable the motor so it's not taking any current.
  digitalWrite(cameraPin, HIGH);
  digitalWrite(actPin, HIGH);
  digitalWrite(enablePin, HIGH);

 // Serial.begin(9600);
}


void loop() {

//Statement triggers at .01s after launch to turn on the gopro right away
if (digitalRead(timerEventCam) == HIGH && camOn == 0 ){

  //Triggering the GoPro to turn on and start recording
  digitalWrite(cameraPin, LOW);
  delay (500);
  digitalWrite(cameraPin, HIGH);

  //By writing this variable to something other than 0 this insures that this conditional is only true once and doesn't attempt to turn the camera on again
  camOn = 1;

  }

//If statement is checking the timer event line to see if it's time to start
//If timerEvent is LOW it skips the main code to the end and waits 100 mS before checking again
if (digitalRead(timerEvent) == HIGH) {

  //Delay is to allow the main arduino to start collecting data before anything else happens
  delay (5000);

  //Enabling the motor and setting the direction
  digitalWrite(enablePin, LOW);
  digitalWrite(dirPin, HIGH);

  //While loop will continure to pulse the motor until it recives a signal from the main arduino that the boom has fully deployed
  while (digitalRead(fullOut) == LOW){
    digitalWrite(pulsePin, HIGH);
    delayMicroseconds(motorSpeed);
    digitalWrite(pulsePin, LOW);
    delayMicroseconds(motorSpeed);
  }
  Serial.println("out");
  //Disable the motor and let the boom dwell for a period of time before briging it back in.
  digitalWrite(enablePin, HIGH);
  delay(5000);

  digitalWrite(enablePin, LOW);
  digitalWrite(dirPin, LOW);
  
  while (digitalRead(fullIn) == LOW){
    digitalWrite(pulsePin, HIGH);
    delayMicroseconds(motorSpeed);
    digitalWrite(pulsePin, LOW);
    delayMicroseconds(motorSpeed);
    
  }
  Serial.println("in");
  digitalWrite(enablePin, HIGH);
  delay(500);

  //Closes Actuator
  digitalWrite(actPin, LOW);
  delay(5000);
  digitalWrite(actPin, HIGH);

  //Turns camera off
  digitalWrite(cameraPin,LOW);
  delay(3000);
  digitalWrite(cameraPin,HIGH);

  //5 sec delay to allow the camera to save the previous video and save the file
  delay(5000);

  //Turns on cameras to record indefinintely 
  digitalWrite(cameraPin, LOW);
  delay (500);
  digitalWrite(cameraPin, HIGH);

  //End the code
  while(1);
}

}

ahayes24:
The linear actuator doesn't extend even though it is getting 24V

And then from your link to the actuator

:heavy_check_mark:Rated Voltage: 12V DC; Stroke size: 50mm(2 inches);

Why are you using 24V?

Sorry in the same link I needed to choose the 24V version. I corrected it.

Can you trigger the correct behaviour when you remove the arduino and use wires to create the pulses?

Does your 24 volt supply provide enough current to start the motor?

Paul

zwieblum:
Can you trigger the correct behaviour when you remove the arduino and use wires to create the pulses?

Yes, we removed the arduino, and triggered the relay with a different source. The linear actuator extended out (closed the door) like we wanted.

Paul_KD7HB:
Does your 24 volt supply provide enough current to start the motor?

We are using a 28-Volt Power Supply that is going through a buck converter down to 24 V. The stepper motor starts and stops exactly how we want it to.

ahayes24:
Yes, we removed the arduino, and triggered the relay with a different source. The linear actuator extended out (closed the door) like we wanted.

We are using a 28-Volt Power Supply that is going through a buck converter down to 24 V. The stepper motor starts and stops exactly how we want it to.

What stepper motor? Your device uses a plain old DC motor with brushes. Note the answer to one of the questions on your linked site gives a different speed for extending and retracting. Caused by brushes.

Paul

Paul_KD7HB:
What stepper motor? Your device uses a plain old DC motor with brushes. Note the answer to one of the questions on your linked site gives a different speed for extending and retracting. Caused by brushes.

Paul

Sorry Paul, I thought you were talking about our stepper motor used in the project. Not the Linear Actuator's motor.

Right now we are getting 1 mA to the Linear Actuator but I don't know where to find how much it needs.

I think you should probably post the datasheets and your wiring. 1mA will not move anything in that range.

zwieblum:
I think you should probably post the datasheets and your wiring. 1mA will not move anything in that range.

I couldn't find the data sheet online. But we measured how much current it pulls when its working separate form our circuit which was .250 Amps.

Our circuitry is very messy and hard to see with a picture. I can find the schematics later.

This could also contribute to the problem but I don't know. The supply we can use in this project is 28V. We have three 28V supplies. We are using one buck converter to step down to 24V (Motor and Linear Actuator), one to step down to 5V (Two arduinos), and one to step down to 5V for the two GoPros.

From one 28V voltage supply, two buck converters in parallel are stepping that same voltage supply down to 24V and 5V. Could this be part of the problem?

A 24 volt motor works just fine on 28 volts. Vehicles and aircraft that have 24 volt electrical systems ALL get charged with 28 volts from the alternator, and perhaps more. Motors on them run just fine when the battery is charging.

Paul

I am using a voltmeter to check for continuity in my wires. Should the ground and v+ pin be continuous?

Paul_KD7HB:
A 24 volt motor works just fine on 28 volts. Vehicles and aircraft that have 24 volt electrical systems ALL get charged with 28 volts from the alternator, and perhaps more. Motors on them run just fine when the battery is charging.

Paul

Yeah we are going to be getting 28V and can have 3 timer based lines and 3 general lines available to us.

Anyway, I have isolated the power to the Linear Actuator so it is on its own 28V line. A funny thing is happening. If the power to the Linear Actuator is on before the the Relay input pin is LOW. (Low level trigger), the Linear Actuator doesn't get any current. But, if I turn the power supply on after the relay pin goes low, it works just fine. I have no idea why that would be happening.

ahayes24:
Yeah we are going to be getting 28V and can have 3 timer based lines and 3 general lines available to us.

Anyway, I have isolated the power to the Linear Actuator so it is on its own 28V line. A funny thing is happening. If the power to the Linear Actuator is on before the the Relay input pin is LOW. (Low level trigger), the Linear Actuator doesn't get any current. But, if I turn the power supply on after the relay pin goes low, it works just fine. I have no idea why that would be happening.

Without a schematic of how you have all this wired together, it is impossible to help.

Paul

Paul_KD7HB:
Without a schematic of how you have all this wired together, it is impossible to help.

Paul

Okay, I created a schematic of our wiring. I have never made a schematic before so I apologize in advance if it is unorganized and/or doesn't follow any conventions. The code I posted is for the Arduino (control) in the schematic. Also, I may not have it drawn, but assume all the grounds are common. (I already checked this)

I drew it with circuit-diagram.org (I don't know if there is a better option)

Here's a better description and timeline of the power lines of our project:

  1. All of our Arduinos are powered by the GSE1 Line.

  2. Our Linear Actuator is powered by GSE2 Line

  3. TE1, TE2, TE3 are powered on at the same time. TE1 powers the motor, TE2 sends a signal for our project to start, and TE3 sends a signal for the cameras to begin recording and also supplies power to the cameras.

Another note: There are still batteries in the cameras because it won't let us turn the camera on unless they have the batteries in them regardless of us giving them enough power.

EDIT: I updated and organized the schematic.

You have checked the SS Relay input & output, checked with a test program that the arduino can drive the relay, e.g. 3 seconds on, 3 seconds off? Checked the wires?
BTW, if I read the schematics correctly, your liniear actuator can only move in one way.

zwieblum:
You have checked the SS Relay input & output, checked with a test program that the arduino can drive the relay, e.g. 3 seconds on, 3 seconds off? Checked the wires?

Yes, we have tried this and there were no problems.

zwieblum:
BTW, if I read the schematics correctly, your liniear actuator can only move in one way.

You are correct, the Linear Actuator will only go in one direction.

I might have missed it, but how do you retract that thing?

So, at the beginning of the program, our Linear Actuator is already retracted and extends at the end which closes an opening. We retract it manually at the start every time by connecting the power supply directly.

zwieblum:
You have checked the SS Relay input & output, checked with a test program that the arduino can drive the relay, e.g. 3 seconds on, 3 seconds off? Checked the wires?
BTW, if I read the schematics correctly, your liniear actuator can only move in one way.

I actually rechecked to see if the arduino can drive it by itself with the current set up and it cant. I also figured out that the voltage going into the Vin pin needs to be in between 7-12V.

Does the Relay need to be connected to its own power supply? We tried taking our 28V supply and passing it through another buck converter, but still it didn't work. Still though, if we turn the power on after its triggered, it closes. Also the GoPros are being turned on through the relay. We also changed to a different channel on the relay, and still nothing.