Four micro linear actuators simultaneously control in the opposite direction

hello guys

I am a clumsy person using Arduino.
I want four micro linear actuators simultaneously control in the opposite direction. but micro linear actuators operate individually.
I would like to know if my code has a problem or if I need to configure additional hardware.

My plan is to control 4 motors in 5 phases.

1 step: No. 1 motor forward
2 step: No. 1 motor reverse, No. 2 motor forward
3 step: No. 2 motor reverse, No. 3 motor forward
4 step: No. 3 motor reverse, No. 4 motor forward
5step: No. 4 motor reverse

I want it to move with a time of 4 seconds per step.

I am using l16-50-63-6-r(L16-50-63-6-R),
Arduino uno, external power supply.

Servo servo1;
Servo servo2;
Servo servo3;
Servo servo4;

float servo1Pos = 0; 
float servo2Pos = 0; 
float servo3Pos = 0; 
float servo4Pos = 0; 

void setup() {
  Serial.begin(9600);
  servo1.attach(3); 
  servo2.attach(9);
  servo3.attach(10);
  servo4.attach(11);
}

void loop() {
  servo1.write(0);
  servo2.write(0);
  servo3.write(0);
  servo4.write(0);
  // No. 1 motor forward
  for (int i = 0; i <= 74; i ++) 
  {
    servo1.write(i);
    delay(54);  
  }
  // No. 1 motor reverse, No. 2 motor forward
  for (int i = 0; i <= 67; i ++) {
    servo2.write(i);
    servo1.write(74 - i*1.1);
    delay(60); 
  }

  // No. 2 motor reverse, No. 3 motor forward
  for (int i = 0; i <= 70; i ++) {
    servo3.write(i);
    servo2.write(67-i*0.957);
    delay(75);
  }

  // No. 3 motor reverse, No. 4 motor forward
  for (int i = 0; i <= 50; i ++) {
    servo4.write(i);
    servo3.write(70-i*1.4);
    delay(78);
  }

  // No. 4 motor reverse
  for (int i = 50; i >= 0; i --) {
    servo4.write(i);
    delay(78);
  }
}

Here is my code and a circuit diagram
Unfortunately, linear actuators do not exist in Thinkercad, so we replaced them with servo motors.

Currently, there is a problem that the motors are not controlled simultaneously in steps 2, 3, and 4.
I would like to ask for your opinion.

I moved your topic to an appropriate forum category @junhyeokock.

In the future, please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.

This is an important part of responsible forum usage, as explained in the "How to get the best out of this forum" guide. The guide contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

Please edit your post to add code tags, and explain the problem.

What do you expect the code to do, and what does it do instead?

the motors are not controlled simultaneously in steps 2, 3, and 4.

You send commands "simultaneously" to the motors, so what do they do?

Keep in mind that breadboards are not designed to handle motor currents (the tracks burn), and the motor power supply MUST be capable of handling the start/stall current for all the motors, simultaneously. Post a link to the actuator product page.

Thanks for your interest.
I send commands "simultaneously" to the motors.
but they are moving individually.

when the No. 1 motor reverse finished, No. 2 motor forward

post motor product

when the No. 1 motor reverse finished, No. 2 motor forward

This code drives servo 1 from 0 (initial position) to 74 in the first pass through the for loop, with i = 0. Sorry, I don't see the problem.

  // No. 1 motor reverse, No. 2 motor forward
  for (int i = 0; i <= 67; i ++) {
    servo2.write(i);
    servo1.write(74 - i*1.1);
    delay(60); 
  }

According to the manufacturer, the stall current is a little over 300 mA at 6V, so a 6 V, 2 Ampere motor power supply should be adequate.

My power supply can produce up to 5A, so it doesn't seem to be a power supply problem.
at 1 step, No.1 motor moves forward at 74
So I made reverse movement 74 - i

Hi,
Lets get this straight.

  1. step: No. 1 motor forward
  2. step: No. 1 motor reverse and No. 2 motor forward at the same time
  3. step: No. 2 motor reverse and No. 3 motor forward at the same time
  4. step: No. 3 motor reverse and No. 4 motor forward at the same time
  5. step: No. 4 motor reverse

Tom.. :smiley: :+1: :coffee: :australia:

It seems impossible that this loop could somehow move motor1 first, all the way to the end of its programmed motion, then move motor 2.

  // No. 1 motor reverse, No. 2 motor forward
  for (int i = 0; i <= 67; i ++) {
    servo2.write(i);
    servo1.write(74 - i*1.1);
    delay(60); 
  }

Make sure that the motors, when driven alone, are actually capable of executing the given commands without hitting an internal end stop or limit switch.

thanks for your opinions.
it looks straight.

Unfortunately, the current moves are made individually. It's hard to show because I can't attach a video.

I didn't understand "without hitting an internal end stop or limit switch." Can you describe it in detail?

If you attempt to try to drive a servo or linear actuator beyond its limits, it will either hit an end stop or a limit switch, which prevents further travel.

The motor drive electronics should not accept commands past that point, but some (especially cheap hobby servos) will actually be damaged by hitting the end stop.

In most cases, you must determine the allowed range of motion experimentally.

The only explanation I can think for that first loop to misbehave is that actuator 1 cannot be physically driven to the expected position for servo1.write(74). So it stops somewhere else until it receives position commands that it can execute.

I selected a linear motor considering the maximum distance to implement the movement.
The maximum movement distance of the motor I selected is 50mm, and the movement distance I implemented is 20mm. I don't think it's a problem related to limits.

Hello

Which type of micro linear actuator you will operate?

Actuonix Motion Devices offers micro linear actuator with different interface types.

hello

my linear motor model is L16-50-63-6-R
type is RC Linear Servo

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