Hi all -
I am using a Arduino Duemilanove with a Firgelli PQ-12-P linear actuator. It can go 20 mm, at 0.1 mm steps, or 200 steps total. When voltage is applied to two pins in one way, it extends, and the other way it retracts. Pin2+/Pin3- extends, Pin2-/Pin3+ retracts. (I have Arduino Digi Output 1 on Pin 2, and Digi Output 2 on Pin 3, by the way). The longer you apply the voltage, the further it goes. I want to create two programs. One takes one step forward, one takes one step backward. These little bundles I want to drop into LabVIEW.
The good news is I can get it to do exactly what I want it to do. The bad news is that it takes some undesired pre-move before it does it.
So I basically played around with examples until I got something that does what I want it to do. It looks like this (for the extend):
void(setup) {
//EXTEND
pinMode(1, OUTPUT);
pinMode(0, OUTPUT);
digitalWrite(0, LOW);
digitalWrite(1, HIGH);
delay(10);
digitalWrite(0, LOW);
digitalWrite(0, LOW);
}
void(loop)
{
}
So it basically does what I want, but it does some strange extra step, that seems unavoidable, which is that it extends a few steps, and then retracts a few steps, to the same position, before it does my desired command.
What's interesting is that when I completely strip the code down to nothing, it does the same quick out/in motion (without the desired extension/retraction, obviously).
void setup()
{
}
void loop()
{
}
I was wondering if anyone had any idea why this happens. This movement, I believe, implies a quick H/L and then L/H occuring on digi output pins 0 and 1.
(By the way, the current draw is a bit too high for the digi outputs, so I built a circuit with a 12 V power supply (made by XP Power), and an H-Bridge chip (made by ROHM). Basically this just amplifies the Arduino signal, so I believe and hope this is irrespective of my question.)
Thanks a million. Your participation in the forums in the past have already been very helpful to me.