I had a feeling that it was for fixed images, and yes I most certainly will be whirling them around my head. Have a look at this video (~700k). I'm doing it with streamers there, but the LED tubes are connected / used the same way. The video is shot at 15fps to give you an idea of how fast they move. Another guy I know is developing something similar (have a look here). He's tried PWM, and at 100Hz the flashing was very evident : "I'm using relatively cheap controllers for my poi and while they do PWM it's unusable because it's low speed (something like 100 cycles a second) and you can clearly see the off section of the strobe when the poi head is in motion." Maybe I'll have to use some caps / resistors after all?
Ah yes i forgot they where moving! To make it easy on yourself you might want to use an 18 series PIC, i feal slightly bad recomending them for this, but they can run at 40mhz (10mhz instruction cycle) which should give you enough RGB combinations without flicker. If you really don't like the idea of an 18series (is a bit like using a sledgehammer to kill a fly), then you could just stick a 20mhz oscillator on, but your code would have to be very cunning. The way i used in the i gave code for isn't the most effective way of getting high frequency PWM.
I've managed to "overclock" a PIC and use a 33.3333MHz crystal with no side effects, maybe try this first.
i tried a 30mhz osc on a 16F870 had it working for about 2 weeks, then it died, i wouldn't recomend it! You might find as you will have to use drivers for the high current requirment of the luxons, that you can get away with it thou. However a phase locked 10mhz PIC18fxxx will give you a 40mhz clock, thats a 10mhz instruction cycle (as aposed to the 1 mhz instruction cycle of a 12f629 on its internal oscilator). Thats a more gradual change of luminosity possible (over 3!).
I just made a program that does PWM nice and smooth at a high frequency for a single RGB LED (in other words 3 LEDs). It's running on a PIC16F628 (IMHO one of the better microchip PICs for hobbyists) with the internal 4MHz oscillator, but it can easily be adapted for a PIC12F629 or 675. All you have to do is program the patterns into the EEPROM and you are good to go! Turn it on and it will pulse through the colors, and with a little creativity you can make all of the patterns that you posted. The code could be easily modified to use lookup tables and a button so you could switch between effects. Lemme know if you are interested... I can clean up the code and whip up a page for it if you want. -special [k]
Sounds good specialk - a mini-tutorial would be most appreciated! Have you tried waving it around at all? Mine will be moving fairly quickly - what frequency is your PWM running at?
Ok, well... You can check out the single controller here: http://www.wahoo-wa.net/PICprojects (Scroll down to Single RGB LED Controller) If you want/need more information, please ask! I tried to comment the code as much as possible, so please ask me if there are any questions or comments. There is flicker if it is moved too fast (I'll measure the freq in just a little bit...), but I'm sure a correctly sized cap should smooth it out or just use a 20MHz osc... Lemme know what you think! -special [k]
My JAL isn't upto par, i confess i hate the principle of creating such a language. But from my understnad the Code: for 16 loop -- Loop for PWM ledRed = ( valRed > theCount ) -- If current value is > theCount then display ledGreen = ( valGreen > theCount ) -- ^^ ledBlue = ( valBlue > theCount ) -- ^^ theCount = theCount + 1 -- Increment theCount end loop won't give a linear change of colour to the human eye (16 differn't that is). But you should be able to get 5 levels of luminosicty from it. or am i missing somthing with JAL?
Each to his own It's a free upper-level compiler that is suprisingly robust. I've become a fan because it is a relatively tight-knit community and it is easy to impliment my design ideas. I could do assembly or I could do C; however, I often don't have the time to program in assembly (which can be optimized much more efficiently than JAL) and C compilers are often expensive (and I'm not a big fan of C myself). It will not change logarithmically, if that is what you mean... It may produce 5 levels of logarithmic luminosity; however, practically the transition is very smooth (and smoother with 32 loops). I can post a hex file if you want to test it out... You will see that it is very smooth and the intensities are quite distinguishable. -special [k]
g'awn post a hex file plz. I've been thinking of getting some 3mm RGB leds, and putting them instead of the ccfl on my ATCS-210 case, i was thinking of a few SSOC 16f88's on a one wire bus (the alluminum) controlling all these rgb leds, so anything that makes it simpler, because space is so tight, would be really apreachated.
Cheers for that SpecialK! I've been doing some investigating / thinking about speeds. I took a vid of myself doing some Poi using my digicam earlier. It takes movies @ 15fps. Now knowing that and the length of the chains, we should be able to calculate how fast the things move and therefore, the minimum speed we need to do the PWM so you can't see it. Here's what I've got : Chain length : ~0.8 m (that's from the handle to the tip of the LED tube) Frame Rate : 15 fps Angle covered between frames : ~45° Circumference of the circle the Poi spin through = 2*Pi*r = 5.03 m Distance travelled by the Poi between frames = circumference * angle / 360 = 0.63 m Approximate speed of Poi = distance / time = 0.63 / (1/15) = 9 m/s So what kind of seperation will there be between flashes? 100Hz => 94.2 mm 1KHz => 9.42mm 10KHz => 0.94mm 100Khz => 0.094mm Now maybe my brains a little tired and I've got those sums wrong, but it looks to me like I'll be needing something like 100KHz to get the seperation between flashes down to something sensible!!
Sorry to kinda threadjack this thread, but here's an oscilloscope (that I just made) shot of one output. Please note that this was fed through a resistor and "smoothed" with a capacitor. There is still quite a bit of noise (which is why it is not a single band) from the PWM. Better resistor and capacitor selection would help. -special [k]
Been quite busy recently, but I've been thinking about this project again recently. Can someone check the numbers I worked out in my last post? Not sure if they're correct? ...and if they are, will one of the 16F chips be fast enough or will I actually need an 18F.. ? P.s - this is what my current LED Poi look like : No strobing, just 4xsuperbright LEDs in each unit
^^^ BUMP ^^^ Just ordered a PIC programmer (Olimex PG2C) for ~£10 including shipping from the US - not bad! Anyways, I'm thinking of ordering a PIC or two to have a play with so if someone could PLEASE have a bit of a think (Tha Animus, SpecialK, SteveyG, Conkbot your forum needs YOU! ). I'd like to try a 16F device, but will it be fast enough to get the speeds I need at the voltages I can provide? Something else has been troubling my poor brain. If I ended up using resistors to limit the current, surely there will be problems when the batteries run down a little.. ? I'd like the LEDs to stay bright for as long as possible. I'll be using 4xAAA batteries in series which should give ~1.3v x 4 = 5.2v at full charge...
I'm pretty sure a 16F series PIC should be fast enough for your needs, depending on your code efficiency. How much space do you have for the circuit? I'd recommend a 16F648A or 16F628A. The 648A has "nano-power" technology, or something like that, for extended battery life.
Not an aweful lot of space.. the smaller I can get it, the better. I was thinking of going for a SOIC package to get it as small as possible and use In-Circuit-Programming to avoid having to solder / de-solder the chip to adjust the program.
TBH I would not worry too much about the power consumption of the logic, it is going to be tiny compared to the power requirements of the Luxons. You may have to think about the amount of current that your batteries can supply. 350mA per LED is about an amp for all three, we had a situation where 8 NIMH AA's (9.6V nominal, more like 11V actual) fell to sub 4V when we drew about 1.5A through them.