paulzimm
0
- Joined
- Jul 22, 2008
- Messages
- 288
- Points
- 28
Hello, it's been a while since I've posted. I have 2 new RGB projectors with galvos and ILDA DB-25 port. I am a programmer and just want to code some simple cirlces, squares, etc using an Arduino Uno USB board.
I just need a way I can write computer code to control about 3 or 5 +/-5VDC ILDA pins.
I found this online - very cheap way to make a controller...
Anyone have experience with this stuff?
- Paul
---------------------------------------
LINK: Laser X-Y-Axis control - Arduino Forum
Use any single-supply op-amp (I used the LM324 from rat shack as I had it lying around... overkill as I'm not using 3 of the op-amps)
and hook it up in voltage following mode:
INV1OUT (pin 1): Galvo control wire
INV1- (pin 2): wire directly to INV1OUT
INV+ (pin3): connect to arduino pin 9
Vcc (pin4): +5V
GND (pin11): GND
You really ought to add a signal-levelling cap between GND and INV+ pins, as close to the chip as you can get it (soldered piggyback would be my preference)... but I got decent results with and without. With, your beams should look slightly sharper as the mirror won't wiggle with the PWM output. I'd use a small value as you don't want to filter out the high-end too much. For no good reason at all, I chose a small ceramic cap marked _22_ for mine.
I used galvos pulled from old supermarket scanners. There must be a million of those things lying around, you can always find them on ebay. They were made by Symbol Tech and are usually labelled as servos or some such... you can usually find them on eBay for around $30 as pulls from old equipment...
The galvo has a four-wire connector, Blue, Red, Yellow/white, Black.
I wrote Symbol a couple years ago to get info about the connector (there's zilch online in terms of official specs)... as I recall, it's max rating is 12V (I've read others quote 14V). You apply a bias current to the black/red wire pair, and a variable voltage to the other pair. The direction and magnitude of that voltage determines the mirror swing.
I connected Blue and Black to ground, Red to +5V, and Yellow/white to the INV1OUT pin.
Then analogWrite(9, value) should position the galvo!
Two big issues with the above:
a) the galvo is way underpowered for it's rating
b) the PWM on the arduino is timed ~ 490Hz by default
a) is solved by using a 9V adapter / battery to power your arduino, and feeding the motor off of it. To adjust the signal, connect Vcc of the op-amp to 9V instead of 5V, and add a Gain=1.8 to the op-amp. Basically, that means you need two resistors with a value ratio of 1 : 0.8. Connect the higher one from INV1- to GND, and replace the connection between INV1OUT and INV1- with the smaller resistor. Not sure how much value matters, but lower is probably better. The LM324 is current-limited to 40mA sink internally so you can't really fry your arduino with it, feel free to play around with the resistor values some. If you pick too high of a ratio, you'll get clipping at the extreme +/- end of the range.
b) requires a little timer hacking. The PWM timer on the arduino is adjustable... I used the following code to set mine fast enough:
Code:
#define TIMER_CLK_STOP 0x00 ///< Timer Stopped
#define TIMER_CLK_DIV1 0x01 ///< Timer clocked at F_CPU
#define TIMER_CLK_DIV8 0x02 ///< Timer clocked at F_CPU/8
#define TIMER_CLK_DIV64 0x03 ///< Timer clocked at F_CPU/64
#define TIMER_CLK_DIV256 0x04 ///< Timer clocked at F_CPU/256
#define TIMER_CLK_DIV1024 0x05 ///< Timer clocked at F_CPU/1024
#define TIMER_PRESCALE_MASK 0x07 //Total guess at this value...
void setup() {
TCCR1B = (TCCR1B & ~TIMER_PRESCALE_MASK) | TIMER_CLK_DIV1;
}
These galvos are really non-ideal for graphics, but the work good for beam effects. They have a wicked non-linear response; my testing seems to indicate there's a lock-in zone around dead-center (with a LOT of wiggle on it!) and two dead zones on each side half-way to full deflection - your mileage may vary. Circuit tuning your op-amp with some basic filters will certainly help, too.
I just need a way I can write computer code to control about 3 or 5 +/-5VDC ILDA pins.
I found this online - very cheap way to make a controller...
Anyone have experience with this stuff?
- Paul
---------------------------------------
LINK: Laser X-Y-Axis control - Arduino Forum
Use any single-supply op-amp (I used the LM324 from rat shack as I had it lying around... overkill as I'm not using 3 of the op-amps)
and hook it up in voltage following mode:
INV1OUT (pin 1): Galvo control wire
INV1- (pin 2): wire directly to INV1OUT
INV+ (pin3): connect to arduino pin 9
Vcc (pin4): +5V
GND (pin11): GND
You really ought to add a signal-levelling cap between GND and INV+ pins, as close to the chip as you can get it (soldered piggyback would be my preference)... but I got decent results with and without. With, your beams should look slightly sharper as the mirror won't wiggle with the PWM output. I'd use a small value as you don't want to filter out the high-end too much. For no good reason at all, I chose a small ceramic cap marked _22_ for mine.
I used galvos pulled from old supermarket scanners. There must be a million of those things lying around, you can always find them on ebay. They were made by Symbol Tech and are usually labelled as servos or some such... you can usually find them on eBay for around $30 as pulls from old equipment...
The galvo has a four-wire connector, Blue, Red, Yellow/white, Black.
I wrote Symbol a couple years ago to get info about the connector (there's zilch online in terms of official specs)... as I recall, it's max rating is 12V (I've read others quote 14V). You apply a bias current to the black/red wire pair, and a variable voltage to the other pair. The direction and magnitude of that voltage determines the mirror swing.
I connected Blue and Black to ground, Red to +5V, and Yellow/white to the INV1OUT pin.
Then analogWrite(9, value) should position the galvo!
Two big issues with the above:
a) the galvo is way underpowered for it's rating
b) the PWM on the arduino is timed ~ 490Hz by default
a) is solved by using a 9V adapter / battery to power your arduino, and feeding the motor off of it. To adjust the signal, connect Vcc of the op-amp to 9V instead of 5V, and add a Gain=1.8 to the op-amp. Basically, that means you need two resistors with a value ratio of 1 : 0.8. Connect the higher one from INV1- to GND, and replace the connection between INV1OUT and INV1- with the smaller resistor. Not sure how much value matters, but lower is probably better. The LM324 is current-limited to 40mA sink internally so you can't really fry your arduino with it, feel free to play around with the resistor values some. If you pick too high of a ratio, you'll get clipping at the extreme +/- end of the range.
b) requires a little timer hacking. The PWM timer on the arduino is adjustable... I used the following code to set mine fast enough:
Code:
#define TIMER_CLK_STOP 0x00 ///< Timer Stopped
#define TIMER_CLK_DIV1 0x01 ///< Timer clocked at F_CPU
#define TIMER_CLK_DIV8 0x02 ///< Timer clocked at F_CPU/8
#define TIMER_CLK_DIV64 0x03 ///< Timer clocked at F_CPU/64
#define TIMER_CLK_DIV256 0x04 ///< Timer clocked at F_CPU/256
#define TIMER_CLK_DIV1024 0x05 ///< Timer clocked at F_CPU/1024
#define TIMER_PRESCALE_MASK 0x07 //Total guess at this value...
void setup() {
TCCR1B = (TCCR1B & ~TIMER_PRESCALE_MASK) | TIMER_CLK_DIV1;
}
These galvos are really non-ideal for graphics, but the work good for beam effects. They have a wicked non-linear response; my testing seems to indicate there's a lock-in zone around dead-center (with a LOT of wiggle on it!) and two dead zones on each side half-way to full deflection - your mileage may vary. Circuit tuning your op-amp with some basic filters will certainly help, too.