loading

firgelli L12 -I with adafruit motor shield v2 + arduino mega 2560...not sure how to run it!!

Hello,

I am trying to turn on and control a Firgelli L12 -I actuator using a Adafruit Motor Shield connected on top of a Ardunio Mega 2560.
I connect the red/black/white set of wires from the actuator to the set of pins labeled as servo (there are two sets of three pins labeled as servo 1 and servo 2). There are no examples I could find for Servo control using Adafruit on top an Arduino!!

Could someone please elaborate on this a bit, so I can find the right connections from firgelli to the Shield, How would I connect it if I do not have the Shield, and then what code should I use?

Many Thanks,
Karim.

sort by: active | newest | oldest
1-10 of 13Next »
behzadjk (author) 3 years ago

OK, I pulled out the adafruit and connected the actuator directly to the arduino. Then I connected the red, black and white on the actuator to 5V, GND and pin9 on the arduino, respectively. as soon as I connected them, the actuator started working. However I had not even opened the arduino software!! How do I get control over the actuator? so I can program it? Thank you.

DO NOT TRY TO RUN THE ACTUATOR FROM THE ARDUINO DIRECTLY!!!

You will burn out the Arduino.

In the software libraries for the motor shield are examples for running a stepper motor.

http://learn.adafruit.com/adafruit-motor-shield/do...

Just be careful. The motor shield is rather weak. I burned out one of the setter sides on a motor that was pulling more current than the controller chip could handle. It was a small stepper i pulled from an old printer.

behzadjk (author)  mpilchfamily3 years ago

OK thanks!

I am glad I received this soon enough. I now re-installed the adafruit shield on top of arduino. I have not yet opened the arduino software; but when I connect the actuator first of all on pins "servo 1" nothing happens, but on "servo 2" it starts moving instantly!! why is that? Basically I do not have control over the movements? I have not compiled any code yet...and why is it not working with "servo 1"?

Thank you again!

You have the arduino connected to the PC right? If so the PC and arduino are communicating over the I2C bus. The motor shield receives it's signal over the I2C bus. So as it's communicating back and forth the shield is interpreting the signal to cause movement on servo 2. You'll notice when you first plug it in the TX and RX LEds are flashing back and forth as the PC and arduino initially talk to each other.

behzadjk (author)  mpilchfamily3 years ago

OK, but what do I do to prevent the actuator from moving just involuntarily!? as soon as I connected to adafruit, it starts moving back and forth no matter what!! I tested it this time and it moves even without the arduino software being open...!

Keep the shield unplugged until you get your sketch uploaded.

The Arduino IDE doesn't do anything until you open up the serial window or upload a sketch. The existing sketch on the arduino may be signalling things. If the previous sketch is sending things over Serial or looking for serial communications, than it's triggering the shield. Keep the shield unplugged and upload an example sketch that doesn't use any serial commands.

behzadjk (author)  mpilchfamily3 years ago

OK, but when I am connecting to the "servo1" and "servo2" pins of the AdaFruit, how would I know which pins on the Arduino they are referring to? I guess pin 9 is the signal pin that corresponds to "servo1". What signal pin corresponds to "servo2" then?

On the other hand, are there sample codes regarding the servo actuation? I was checking the code from:

http://playground.arduino.cc/Learning/SingleServoExample

However:

Firstly there is an error with the "refresh"; I am not sure if it is sources from the type of "servo.h" library that I am using. Also, the actuators move slightly and then stop (and it seems that they are in stall position). What is that I need to do about that?

Thanks,

Karim.

Go top that link i posted above. There you will find the download with the library and example code you will need to use the shield. Also look areound there for tutotrials.

behzadjk (author)  mpilchfamily3 years ago

Hello,


I have connected to firgelli -I actuators directly to an Arduino Mega 2560. Power connections are from +5V and GND, and the signals go to pins 9 and 10. However when I run the code only the one connected to pin 10 works, the other has no movement. Could it be due to the low power to move both? Or am I missing anything? The code is supposed to move both servos from 0 to 180 degrees in steps of 1:

Code:

#include <Servo.h>

Servo servo1;
Servo servo2;

int pos1 = 0;
int pos2 = 0;

void setup()
{
servo1.attach(9);
servo2.attach(10);
}

void loop()
{
for(pos1 = 0; pos1 < 180; pos1 += 1)
{
servo1.write(pos1);
delay(15);
}
for(pos2 = 0; pos2 < 180; pos2 += 1)
{
servo2.write(pos2);
delay(15);
}

for(pos1 = 180; pos1>=1; pos1-=1)
{
servo1.write(pos1);
delay(15);
}
for(pos2 = 180; pos2>=1; pos2-=1)
{
servo2.write(pos2);
delay(15);
}




I would appreciate your help, feel like this is small mistake somewhere.

If your actuator has 4 wires then it's a stepper based actuator not a servo. It won't work directly connected to the Arduino as the adruino cannot supply enough current to run the motor. Use the Sheild and examples made for stepper motors and you will be all set.

1-10 of 13Next »