My arduino rocked up today so I wired it up to the LCD. After working out I'd wired the backlight back to front I uploaded the "hello world" LCD test program after making a few modifications
At this stage the program had been running for 16 seconds, hence the 16 on the bottom line.
Seems I got that working. Now to make it take over the world, or at least control a JDSU argon laser. The next step will be when the relay board arrives, then I can perhaps get them clicking out morse while I learn how to drive this aruduino thing
driving the laser in current mode will be easy - the pwm output of the arduino coupled to an RC network should have no issue driving the laser to 10 A.
edit: No sooner did I have the arduino out of the box, I had it hooked up to the PC, and flashing a led and then pwm'ed a buzzer (yes I had to make an annoying truck reversing noise out of it hehe)
Got the relays and display playing nicely together - a little "chase my tail" program...
sorry for triple post...
Next voltage dividers and then learning analogue read.
edit: and for the digipots, since a 15v part is hard to find, I'm going to make my own, utilizing the stepper library on the arduino, a stepper motor (one of the chinese reduction gear ones), and a trim pot.
This will provide a "digipot" with no voltage restrictions, and heaps more accuracy than the only 15v part i found in real digipots - 128 steps. A 25 turn trimmer connected to a stepper gives heaps more adjustment range
edit 2: woot! got the voltage divider working. The arduino does all the math, take the resultant voltage thats divided, converts it back to the original voltage, multiplies it by 10 (10mw/V) and then spits it out to the LCD. So the power output monitor code and current output code is complete. Thats the second hardest bit! I hate maths
The hardest bit will be the menu system. Which just got a helluva lot easier (and a tad expensive), thanks to the fairly mature uLCD library. This one drives a 320x240 colour touch panel, and has all the routines for creating menus and buttons (its a touch screen - duh), to run the show. Should look very professional. As a bonus, it only uses 4 wires to talk to the AVR, so I will have a heap of free digital pins to monitor stuff like the keyswitch and perhaps fan rpm to ensure its spinning.
The downside, is the display costs $79. However considering its a display and user interface all rolled into one, with only 4 wires, its worth it. I'd probably end up spending that on buttons, switches, pots and other gadgets along with pcb's to interface them to the arduino, alone.
Tapping the screen to switch between modes, sliding your finger to increase or decrease power, constant display of tube current, power out, etc. Could end up being a real professional controller with a screen like this. I'll still have to include a key switch and E-Stop, not gonna let software or a uC handle those.
The preheat timer with its countdown (and thus the maintenance burn timer) is done. Also wired up a piezo to give beeps for events (e.g. series of beeps to indicate something wrong, maintenance burn finished etc)
I am writing the stepper motor routine. I have 2 choices and would like some input. Since I'll be making the code and schematic available so others can "roll their own" controller, what would you guys prefer?
Option 1:
Adjust the power on the screen: Stepper only moves once the "Select/Start" button is pressed. Example: Current mode, 4.15 amps. User adjusts up to 7 amps. During adjustment, the laser stays at 4.15 amps. As soon as select / start is pressed, stepper hightails it to close in on the value, then slows right down to lock on.
Option 2:
Adjust the power on the fly: As soon as the value is adjusted on the screen, the stepper moves to set this value at the laser. Example: laser is in current mode at 4.15 amps. Each press of the up/down button/icon moves the stepper enough to increase the current by 10ma. Pressing select goes into course mode, allowing for adjustment in 1A steps. Obviously the stepper wont move below idle threshold or above the TubeIMax value stored in EEPROM.
Mode switching (between light and current) will ALWAYS drop power to minimum before switching. This is to prevent an over current issue in case the trimpot is set to the maximum and the mode is called to switch from light feedback to current feedback.
Good to see you've got it going right ahead. If you haven't already bought the display, I could help you with a menu system that would work with your LCD. I had to make a menu system for the display on my lightning detector too
As for your 2 options, I'd probably go with option 2.
What are you planning to use as feedback on the potentiometer and stepper combo?