Do you see the serial printing you are doing at all? if you do, the problem might come form the library you are using.
We recommend, writing a simpler version of your code just to test the library and make sure it works. The you can gradually add the functionality you need while constantly testing it works.
I’m not sure I entirely understand the desired result… Do you want to have the actuators turn on one at-a-time in the order you specified, or do you want to turn on the actuators in a staggered/cascading order? Can you give us more information about your application?
From your code, I see that as part of the setup() function, you wait 1 second, then give each motor a short 30 ms pulse at about 60% power, and stop. Then the main loop starts, where you spin up the first motor from stopped to 100% forward back down to stopped, then up to 100% backwards and back down to stopped. This sequence is repeated for the other two motors with only a 30 ms wait between motors.
There’s no delays in the the spin-forward-up-down-reverse-up-down-stop sequence itself, so it must be incredibly short (milliseconds) total. Perhaps you want to start by adding a delay(3) inside each of the for-loops?
That’s right, you actually need to connect the two motors leads (red and black from the actuator) to M1A and M1B (ex: red to M1A and black to M1B). We need to do this because the two outputs (per motor) of the motor controller chip are actually independent of the main GND since it needs to inverse the voltage in the motor to make it move the opposite direction.
I am hoping this is not redundant; I am trying to actuate a few linear actuators IN A SEQUENTIAL manner.
I am using motor shield v2 and arduino mega 2560 with firgelli L12 -P.
I am using the following:
I am not sure where to put the delays (or not sure if putting delay is conventional when trying to make sequence of motions!?
any help would be appreciated very much! This does not seem to be so difficult but I am not getting the kind of motion I want:
Initially I am hoping to get a sequential movement of three actuators within (lets say) half a second delay. Then I was hoping to get this type of sequence:
1st 2nd 1st 3rd 1st 2nd 1st 3rd …
It is worth saying that I do realize the actuators move all the way to the fully extended length and I am hoping to, at some point, control that distance but I am thinking this is not an issue at this point as I believe for position control I need to use the potentiometer feedback.
OK sir, this is the new setup i have with: Firgelli L12 -P actuator + Arduino Mega 2560 + Pololu VNH Motor Drive
I have the made the connections as seen in the picture. I got the blue LED (i believe this is the motor indicator LED) working which happens when i supply the Vin and Gnd with the red and black from the power supply.
But when i connect the M1A and Gnd to motor, nothing happens! I run the demo code which should run the motor back and forth but nothing!
COULD it be because i am only connecting the red of the motor to one of M1A or M1B and not both?
COULD it be due to less current going into the motor that it is not moving? I am saying this because I tested the motor connecting it directly to power supply and it works perfectly.
Thank you. I did according to what you suggested, but the motor is not doing anything! why is this the case?
When I run the code on Arduino IDE is it not just uploading and then verifying? should i not be expecting movements right after?
I have got a similar Problem. I am trying to use L12-30-100-6-R lineal servos controlled with an Arduino Mega 2560 and powering them with an external battery of 6V. The fact is that I can not manage to make them move. I just want to make them move back and forth. Maybe the Arduino program is not right…
The program I want to use is this one:
#include <Servo.h>
Servo servo; // create servo object to control a servo
void setup() {
servo.attach(46); // attaches the servo on pin 46 to the servo object
Serial.begin(9600);
}
void loop() {
servo.write(180); // sets the servo position according to the scaled value
delay(3000); // waits for the servo to get there
servo.write(0); // sets the servo position according to the scaled value
delay(3000);
}
Does anyone have an idea of what could be happening? Thanks in advance
If I recall correctly, the Firgelli actuators don’t like it when the signal jumps from one position to another. Can you try running the Sweep example that’s provided in the File -> Examples -> Servo menu to see if that one works? If not, can you upload a picture of your setup that goes with your code that shows all the connections, power supply, etc?
The Firgelli type I actuators are very versatile - you can interface it with the Arduino in several ways. One option is to treat it like a regular R/C servo, connecting the white wire to a digital output, the red to your power source and the black to the power source ground (and also connected to the Arduino ground). Send a timed pulse between 1000 and 2000us (1 and 2ms) sets the position. Alternatively, you can use Analog or PWM modes etc.
It seems you chose the -P version of the actuator with position feedback. This means the L12 operates at a normal DC linear actuator where you can control speed and position via a DC motor controller. It also has a built-in linear potentiometer to get the position. To position the actuator, you need to know the current position and the desired position, the calculate which direction to turn the motor and at what speed. You need to constantly perform these calculations until you are close to the desired position, then if the actuator is within a certain range of the desired destination, stop the actuator. This all needs to be coded. The option most people choose is the -R or -I where you can control it like a normal RC servo (the one disadvantage is that there’s no position feedback).
It’s all up to the code you are using. You need to read the manual for the motor shield and ensure you have the connections correct, then create code. It’s likely that the sample code is only for moving a DC gear motor and does not include feedback; this part you will need to implement yourself. If you are having issues with the code itself, we encourage you to create a thread on the Arduino forum where there are many users who can help you troubleshoot line by line.