# PWM Regulator for Lantern bodies, JM-PhD-X1



## JimmyM (Jan 29, 2009)

This is another project following the work Alan b, wquiles, and I have been doing to build a microcontroller based PWM regulator for incandescent lights.

The original project threads and their follow-up parts.
Part 1
http://candlepowerforums.com/vb/showthread.php?t=186291

Part 2
http://candlepowerforums.com/vb/showthread.php?t=209098

Part 3
http://candlepowerforums.com/vb/showthread.php?t=220475

Alan's project
http://candlepowerforums.com/vb/showthread.php?t=218506

Will's project
http://candlepowerforums.com/vb/showthread.php?t=215806

My project for the Mag D body
http://candlepowerforums.com/vb/showthread.php?t=216160

This version will extend the capabilities of the JM-PhD-D1. It's will be larger and be targeted specifically at the 1000+ watt crowd.

Thus far I have the following design criteria in mind. Some is already working in the JM-PhD-D1.
1) 10 bit ADC (analog to digital converter) reads voltage of batteries, etc.
2) 10 bit PWM. This allows 1023 levels of regulation versus 8-bit which will give only 255. 
3) 60V maximum input voltage. Combined with 10-bit regulation yeilds ~0.06V accuracy.
4) Dual on board FETs (I found an awesome one)
5) FET driver to drive the large gate capacitance of the FETs.
6) multiple inputs/outputs for buttons or LEDs.
7) Copper "buss bars" for high current paths.

A few questions are still outstanding.
In the JM-PhD-D1, the output voltage and low voltage shutdown are set by the user using onboard pots. How should these values be set in this version?
Output voltage: External pot? Up/Down buttons? Programmed in absolute maximum voltage that external adjustments can't exceed?

Low voltage safety: Programmed in value? onboard pot?

Low voltage behavior: Right now, the JM-PhD-D1 is set up to dim and pulse the light when the low voltage safety has been hit. But this version will have the capability to driver external LEDs as warnings, etc.
For lights in this power range (since it is hardly an EDC) I would suggest having the light shut off and flash an LED for the user.

I was thinking if using an RGB LED that could be programmed to do different things with different colors depending on what condition is present.
Flashing Yellow = Low Voltage
Flashing Red = Over Temp
Steady green for power on or maybe a variable level dependendent on output power. It could flicker when 100% duty has been reached.
Blue for Charging maybe? that would have to be figured out.
The chip I'm using has plenty of I/O pins.

One warning that must be adhered to... The bulb cannot be functional while programming the chip. I'll supply a jumper on the board to isolate the FET drive during programming so that the user does not have to physically disconnect the bulb itself. But there is the possibility of blowing the bulb while programming, if the battery voltage is significantly higher than what the bulb can take.

Anyway, so let's have it.


----------



## Starlight (Jan 29, 2009)

Jimmy, here are my thoughts.

Output voltage: External pot? Up/Down buttons? Programmed in absolute maximum voltage that external adjustments can't exceed? Pot or pushbuttons would be fine, but don't these small pots have short life cycles on number of twists? I would prefer buttons or programming changes.

Low voltage safety: Programmed in value? onboard pot? Once again, I think programming is better.

Low voltage behavior: Right now, the JM-PhD-D1 is set up to dim and pulse the light when the low voltage safety has been hit. But this version will have the capability to driver external LEDs as warnings, etc.
For lights in this power range (since it is hardly an EDC) I would suggest having the light shut off and flash an LED for the user. Dim and pulse at the low voltage is my preference. The option for external LED's and the option of the RGB LED won't help me. I don't plan to mount any external LED's. My driver will be buried inside the light and only accessable when the light is opened.

So, I want a self contained driver with adjustments by programming (1st choice), buttons (2nd choice), or on board pots (3rd choice). We need to be able to program the driver. It could be by software and connected to a computer, or by buttons to select to function, then scroll through choices or scroll up and down (like voltages).

I know you started this thread to keep working while you determine how to produce the other drivers. I wouldn't mind the extra cost of having the boards fabricated. You might see what others think.


----------



## JimmyM (Jan 29, 2009)

Starlight said:


> Jimmy, here are my thoughts.
> 
> Pot or pushbuttons would be fine, but don't these small pots have short life cycles on number of twists? I would prefer buttons or programming changes.


An external pot would be a regular duty pot, not a little trimmer. Their cycle life is much greater. It would be an external Knob to adjust output voltage.


Starlight said:


> Low voltage safety: Programmed in value? onboard pot? Once again, I think programming is better.


OK. One vote for programming.


Starlight said:


> Dim and pulse at the low voltage is my preference. The option for external LED's and the option of the RGB LED won't help me. I don't plan to mount any external LED's. My driver will be buried inside the light and only accessable when the light is opened.


The LEDs would be externally mounted, not on the board. In your instance, you would just not use them. Disable in software.


Starlight said:


> So, I want a self contained driver with adjustments by programming (1st choice), buttons (2nd choice), or on board pots (3rd choice). We need to be able to program the driver. It could be by software and connected to a computer, or by buttons to select to function, then scroll through choices or scroll up and down (like voltages).
> 
> I know you started this thread to keep working while you determine how to produce the other drivers. I wouldn't mind the extra cost of having the boards fabricated. You might see what others think.


I'll look into it some more. You have to supply overages for parts. So I would have to supply 5% extra Tiny44s, not to mention all the other parts. For the smaller ones, I'd have to supply 10% more, up to a certain amount.
I'll see about a quote though.


----------



## Alan B (Jan 29, 2009)

JimmyM said:


> An external pot would be a regular duty pot, not a little trimmer. Their cycle life is much greater. It would be an external Knob to adjust output voltage.
> 
> ...



Rather than an external pot, I would suggest a detented rotary encoder (at least as one option). Can be interfaced with 2 binary pins (rotary only) or 3 binary pins (encoder with push-switch). These encoders can be had in various models, some rugged enough to last a lifetime on a flashlight.

I can show you how to program for these.

-- Alan


----------



## JimmyM (Jan 29, 2009)

Alan B said:


> Rather than an external pot, I would suggest a detented rotary encoder (at least as one option). Can be interfaced with 2 binary pins (rotary only) or 3 binary pins (encoder with push-switch). These encoders can be had in various models, some rugged enough to last a lifetime on a flashlight.
> 
> I can show you how to program for these.
> 
> -- Alan


I had been looking at those and did a little research at AVRfreaks. I really like the idea of the encoder. We'll see how things work out. If it's a pot they want, it's a rotary encoder they'll get!


----------



## SafetyBob (Jan 29, 2009)

Jimmy, I have not built one of these 400, 600 or 1000 watt lights yet. 

The parts, however, may be one the way (the Emoli's arrived today and are charging as we speak for they other project)....

Pushbuttons that would adjust at 0.1 or 0.2 volts (or whatever) I could see as easy to set, also the detented encoder would also be killer. Either one would be excellent. 

A single encoder would no doubt take up less room or perhaps encoder with push button with onboard lights that flash during setup to tell us low voltage set, high voltage set, blink lite on low volt warning or flash external led at low volt warn. (thinking out load here)

Ultimately, we need the guys who have built the big lights that you have already helped or how have completed a couple of these to chime in. 

Also recommend you add appropriate led into kit (for us to wire up) or give specific part number so we don't have to go through hundreds of pages of electronics catologs trying to find the right one. 

That's all that I can think of right now.

Bob E.


----------



## JimmyM (Jan 29, 2009)

I've got some time to think about all of this stuff.
During programming mode the led can repeat back the settings by flashing different colors/patterns. green flashes are 10s, yellow are 1s, red is 0.1s. Or something like that.
I would include the LED as well as the little board it mounts on. The chip I'm using has a 2nd PWM output. I could use that for some Eye Candy with the LED.
I like the encoder idea too. Enter programming mode by some neat click/press sequence, Push to select mode, LED tells you what mode you're in, turn to change setting, push to confirm, LED repeats setting back to user.


----------



## Alan B (Jan 29, 2009)

The heck with flashling LEDs. Small LCD displays are pretty inexpensive. It takes 6 pins to interface one. No reason to stick to an tiny84 in a lantern, either. Make a really nice UI with an LCD and a push/turn encoder. 9 pins. plus pwm and battery 11 pins. Maybe one more pin for backlite on the LED. So choose a 16 pin chip. Probably would fit in the 84, barely. The LCD can share pins with the ISP.

-- Alan


----------



## JimmyM (Jan 29, 2009)

Alan B said:


> The heck with flashling LEDs. Small LCD displays are pretty inexpensive. It takes 6 pins to interface one. No reason to stick to an tiny84 in a lantern, either. Make a really nice UI with an LCD and a push/turn encoder. 9 pins. plus pwm and battery 11 pins. Maybe one more pin for backlite on the LED. So choose a 16 pin chip. Probably would fit in the 84, barely. The LCD can share pins with the ISP.
> 
> -- Alan


You're really upping the ante on this. Why not use the Mega8? or something really fancy?


----------



## Alan B (Jan 29, 2009)

JimmyM said:


> You're really upping the ante on this. Why not use the Mega8? or something really fancy?



Of course! Lotsa room here, why not?? The Mega8 is a very old chip, may not be as nice as some of the newer ones. You have to look into the fine details. It is mostly about pin count, and hardware features, and adequate memory. Having a lot of extra pins is pointless and costs $ here and there. But if there is a lot of room, and it is a small volume app so cost is not the issue, no problem. The real issue is a good user interface, and a small LCD would really solve that nicely. It could keep track of Ampere Hours (don't forget a shunt to measure current), show percent battery remaining, runtime at this setting, etc. Very useful! Maybe we can back-fit an LCD into the D [email protected] later!!

-- Alan


----------



## JimmyM (Jan 30, 2009)

Alan B said:


> Of course! Lotsa room here, why not?? The Mega8 is a very old chip, may not be as nice as some of the newer ones. You have to look into the fine details. It is mostly about pin count, and hardware features, and adequate memory. Having a lot of extra pins is pointless and costs $ here and there. But if there is a lot of room, and it is a small volume app so cost is not the issue, no problem. The real issue is a good user interface, and a small LCD would really solve that nicely. It could keep track of Ampere Hours (don't forget a shunt to measure current), show percent battery remaining, runtime at this setting, etc. Very useful! Maybe we can back-fit an LCD into the D [email protected] later!!
> 
> -- Alan


True the Mega8 is old, I'll have to look at the different chips.
As far as LCDs go....
There was this little number at Matrix Orbital I found while looking for LCDs for my reflow oven.
http://www.matrixorbital.com/lcd0821gw-p-121.html


----------



## Alan B (Jan 30, 2009)

JimmyM said:


> True the Mega8 is old, I'll have to look at the different chips.
> As far as LCDs go....
> There was this little number at Matrix Orbital I found while looking for LCDs for my reflow oven.
> http://www.matrixorbital.com/lcd0821gw-p-121.html



That one is big and expensive compared to some I've been looking at.

-- Alan


----------



## JimmyM (Jan 30, 2009)

Alan B said:


> That one is big and expensive compared to some I've been looking at.
> 
> -- Alan


OK. So which one have you been looking at?

Maybe this one? http://www.trulydisplays.com/oled/brief/TOD9M0011 Brief.pdf


----------



## SafetyBob (Jan 31, 2009)

Jimmy and Alan, we are on the right track here. 

Yes we can find/make room on the side of any latern for an LCD display with or with out buttons and what not. 

Anything to help monitor battery voltage would be cool to. 

Bob E.


----------



## Alan B (Jan 31, 2009)

JimmyM said:


> OK. So which one have you been looking at?
> 
> Maybe this one? http://www.trulydisplays.com/oled/brief/TOD9M0011 Brief.pdf



I"ll have to dig out my notes. Something more like the small LCDs on the outside of folding cellphones.

-- Alan


----------



## SafetyBob (Jan 31, 2009)

Alan and Jimmy, a small LCD like is on cell phones (the Motorola Razor's come to mind) would be good, especially if it was encased in a plastic case or cover we could either screw from behind or through in order to install would be even better. 

That way we could simply drill a couple of holes, run our cable or wire loom and be done. 

Bob E.


----------



## JimmyM (May 20, 2009)

I'm thinking about focusing my development on the ATMega168. Or the ATxmega16A4
Is there something they're missing?
Multiple PWM channels, ADC channels, etc.
The ATxmega is a 3.3V chip, but the X1 will use a proper FET gate drive, so it would not need to drive the gate of a logic level FET with 5V anyway.
Soooo.
The Xmega has the advantage of 12-bit ADCs, that would mean 12-bit PWM and a 0.02V theoretical voltage resolution over 80 Volts.
The ATMega168 would be easier to implement, I think, and would have 0.08V resolution over an 80V range.
They both could drive pretty much any LCD out there.
I'm going to have to investigate, but they may be directly addressable by USB.


----------



## JimmyM (Jul 13, 2009)

I've been doing a little snooping around.
I like the ATMega2561, it may be overly capable, but who cares.
Lots of memory for LCD messages.
I want to use a rotary encoder + an LCD ScreenKey.
Dual PWM outputs for the dual filament landing lights. One set of FETs would be onboard and another set would be an add-on.

80V capable.

Anyway. No real development yet, but I'm building a shopping cart at Digikey to do some more development in the future.


----------



## mpf (Jul 16, 2009)

If you have an LCD available and a capable uC, what about adding GPS and a compass to display location and direction on the LCD.


----------



## JimmyM (Jul 16, 2009)

mpf said:


> If you have an LCD available and a capable uC, what about adding GPS and a compass to display location and direction on the LCD.


The mega2561 has plenty of capability. I chose it because it has tons of memory and a boat load of pins. But some further research and some hand sketched schematics shows that I might be able to use the Tiny84. I found some code that allows me to dynamically generate text for the LCD instead of using stored graphics array data sets. This DRAMATICALLY reduces memory requirements. And I should still have enough pins to allow the LCD, Rotary encoder, and dual PWM outputs. However, I think GPS and compass is out.


----------



## mpf (Jul 18, 2009)

JimmyM said:


> ... I might be able to use the Tiny84. I found some code that allows me to dynamically generate text for the LCD instead of using stored graphics array data sets. .


I am using Attiny84 and have just added a bluetooth connection, great for debugging while actually running. You can plug it into the SPI interface. Can you post a link to the "dynamically generate text" code. Having not found a place on my torch to mount the LCD I thought of bluetoothing the GPS and compass readings to an arm mounted LCD (still in the anything is possible stage though)


----------



## JimmyM (Jul 18, 2009)

mpf said:


> I am using Attiny84 and have just added a bluetooth connection, great for debugging while actually running. You can plug it into the SPI interface. Can you post a link to the "dynamically generate text" code. Having not found a place on my torch to mount the LCD I thought of bluetoothing the GPS and compass readings to an arm mounted LCD (still in the anything is possible stage though)



I found the dynamic text code at AVRFreaks. In the projects section HERE.
Bluetooth? Really? Perhaps a bigger chip could be used that runs a boot loader. Programming updates could be uploaded via bluetooth. Holy moly.
Doing some more research, I might use the Tiny88 instead. I'll have to see how much code space I need. It's a larger chip than the Tiny84, but would allow everything I need with "expansion pins" left over for future development. I'd also bring out the I2C pins for external communication. I have some parts I need to order from Digikey to do some development.


----------



## mpf (Jul 18, 2009)

JimmyM said:


> Programming updates could be uploaded via bluetooth. .... I might use the Tiny88 instead.


Thanks for the link.
I am looking at programming updates via bluetooth, perhaps just limiting them to changing turnoff timouts, modes of operation, level settings etc. rather then full blown code replacements. I have remote on/off level change working at the moment (no getting out of the sleeping bag to turn off the lantern) see my website below or this thread (https://www.candlepowerforums.com/threads/231992) for the tutorial

Attiny88 provides more pins, but what would be useful for the bluetooth would be a fully implemented UART, I had to write a RS232 module to get the bluetooth running on the ATtiny84

Are you programming in C or asm? I did a simple test and found the C code took about twice the space for a simple led controller as the asm code did.


----------



## JimmyM (Jul 19, 2009)

mpf said:


> Thanks for the link.
> I am looking at programming updates via bluetooth, perhaps just limiting them to changing turnoff timouts, modes of operation, level settings etc. rather then full blown code replacements. I have remote on/off level change working at the moment (no getting out of the sleeping bag to turn off the lantern) see my website below or this thread (https://www.candlepowerforums.com/threads/231992) for the tutorial
> 
> Attiny88 provides more pins, but what would be useful for the bluetooth would be a fully implemented UART, I had to write a RS232 module to get the bluetooth running on the ATtiny84
> ...


I just did some testing last night. Just testing the example code, compiled to 120% of data space on the Tiny84. I program in C using WinAVR. I'm new to this and don't know anything about assembly. GCC optimization is set to -Os. I need to go through the code and figure out how to remove the un-needed character map entries. I just need upper case, numbers and a decimal point. That may get things down far enough to fit in the Tiny84. But that leaves me precious few pins to work with. I thought of using the Tiny88 but it has almost no EEPROM. Of course I could expand that with I2C EEPROM, but would like to avoid that. But the Tiny861 has 0.5K EEPROM like the 84 and 85, but has 4 additional pins. But those pins are multi-tasked. So the MISO/MOSI is on the OCR1B, etc.
What do you think about the Mega1284P or the Mega644. Still small, but has excellent memory space and good I?O pin assignment.


----------



## mpf (Jul 20, 2009)

I like the look of the Mega1284P, 2 uarts one for bluetooth I/O and reprogramming and one for GPS. I am designing my next torch now and will look at using one of these. Plenty of code space so using C would not be a problem, 20Mhz is good too.


----------



## JimmyM (Jul 20, 2009)

mpf said:


> I like the look of the Mega1284P, 2 uarts one for bluetooth I/O and reprogramming and one for GPS. I am designing my next torch now and will look at using one of these. Plenty of code space so using C would not be a problem, 20Mhz is good too.


Yeah, the Mega1284P has tons of space, is physically the same size/pin count as the 644, and has additional functionality (2 UART, 2 16 bit timers, etc). The only place where it falls short of the features of the 644 is it only has 3 external interrupts.


----------



## JimmyM (Jul 20, 2009)

Oh, another difference... Digikey doesn't carry the mega1284P :mecry:


----------



## JimmyM (Jul 20, 2009)

And yet another reply.
I got the ScreenKey code to fit into the Tiny84 (Not the Tiny44 though). So I'll do a little testing with that to get things working and fiddle with the code to my tastes. The original author uses a TON of compile-time substitution macros that I'm just not used to.
18% Program Space, 70% Data space.

EDIT: Got it working. I can send 3 lines of text to the screen; Left, Right, or Center justified. Change colors. send bitmapped images. Really quite slick.
I'm going to work on a different clock generator to potentially work better with the regulation program. I'll have to see how the 50kHz timer interrupt affects regulation events.


----------



## mpf (Jul 22, 2009)

JimmyM said:


> Oh, another difference... Digikey doesn't carry the mega1284P :mecry:


Mouser says
*Estimated Ship Date*
245 on 7/08/2009


----------



## JimmyM (Jul 22, 2009)

Oh. That's cool. I would wait until they actually have them in stock. I waited 4 months for an item from Mouser once. Never again.
In any case, I'll probably order the 644P for development.

I have dynamic text working now. I can increment a number from 100 (10V) up to 800 (80V) by 0.1V and display that value on the screen. But the code bloats up when I try to use a float/double to string function. I can convert to an integer, but I need a decimal display. Of course I just started fiddling with this, so I'm sure there's a lot I still don't know. I'll see what else is out there.

You really need to check out these screen keys. The display is monochrome on an RGB backlight. They're also quite small. Of course there are a couple of full color OLED displays that are small too, but they would require a lot more mounting finesse.


----------



## JimmyM (Jul 22, 2009)

After some more testing...
I have the Tiny84 running regulation with a Multi-Level UI and driving the ScreenKey.
It displays the active Output Level (1,2, or 3), It will also display an Over Temp message or Under Volt message, or both.
Under normal circumstances the backlight is green, In Under Volt Mode, it's Orange, in Over Temp mode, it's RED.

That chip is very busy. I might have to move some of the sampling around, otherwise I can't get it all in during each cycle.

I'm going to try connecting a Tiny85 to the LCD display and having it run the LCD clock and Data outputs. I'll connect it to the Tiny84 via I2C, so the Tiny84 does all of the work most of the time. It only has to take time out to send data to the Tiny85 when the display needs to be updated.
The I2C would just send the command type and string, if needed, to the Tiny85 to update the LCD display. Right now it can display 0-9 and upper case characters with a few non-text characters.
I'd like to create a routine that displays a bar across the bottom given the position (top, middle, or bottom) and number 0-36.


----------



## Alan B (Jul 24, 2009)

Which screen keys are you using? Sounds fun.


----------



## JimmyM (Jul 24, 2009)

Alan B said:


> Which screen keys are you using? Sounds fun.


"ScreenKey" brand. Their LCD is 36x24 pixel resolution. Enough for 3 rows of 6 characters.
I'm looking at another that is 64 x 32 and uses an 8-bit communication protocol. I'm getting some more information from the manufacturer regarding the protocol.

I'm also looking at splitting up the sampling so it samples the battery during one cycle, then scans the Pots and thermistor on the next.
Of course, with this design, I'll be removing the pots, so that sampling time is removed. Maybe I'll do that.
The 50kHz interrupt is slowing things down.


----------



## Alan B (Jul 24, 2009)

Found them. Sparkfun has some of the lower models. Pricey but cute. Too big for the [email protected], though.


----------



## JimmyM (Jul 24, 2009)

Alan B said:


> Found them. Sparkfun has some of the lower models. Pricey but cute. Too big for the [email protected], though.


Yeah. Too big for the Mag. But not too big for a Larry14K or PK1000.
Also, I found a cheaper source for the RGB24T and also a 64x32 pixel version.

This is really for a Lantern body light. Although I could mount one on the side of a Mag of I hacked up the body of the Key and the Mag.
Perhaps for a personal project.
I'm going to see if I can get the necessary things packaged into a Tiny44. I do have those extra PortB pins I can connect this to. I could pare down the code to just display simple messages and change colors.


----------



## JimmyM (Nov 29, 2009)

A little update...
I'm doing testing using the Atmel mega324P/644P for development. I've got it reliably reading a pair of rotary encoders. For testing purposes I'm using it to control the duty cycle of two PWM waves for control of 2 outputs (think dual filament bulbs). I've also got the ScreenKey displaying text and the numeric value of the PWM (OCR1A register value).
Since this will be a rotary encoder/programming regulator (no pots) I need to know... 
Of the folks who would buy this for one of their lights, How badly do you want a "screenkey" LCD button for the light? It will add another $40+ to the install.
I'm looking at a few UIs right now, one of them being the LCD/Screenkey. If I try to make this thing be "everything to everyone" it will never get built.
On the simple side, I could just make this a dual channel regulator that is programmed with a few levels and uses a pushbutton to control the levels. A couple of output LEDs could also be implemented to indicate status/condition etc. No rotary encoder, no LCD, Just a few Kilowatts of regulation. It could be done with the Tiny84 chip I'm already using and cost less.
Or it could be the super glitzy "swiss army knife" regulator that has been discussed earlier in this thread and cost $150 or more.
What's possible with the Tiny84...
-Dual channel regulation (10-12 bit)
-Button UI
-2 external LEDs(varying brightness)
-External temperature sensor
What's possible with the 324P
-All the above +
-rotary encoder(2)
-LCD display
-Multiple LED outputs
-multiple buttons for UI
-just about anything else you can think of.


----------



## wquiles (Nov 29, 2009)

Very nice - a display unit 

Could it be something that you can remove after you have done the settings/calibration? That way you could use the "display module" with various lights?


----------



## JimmyM (Nov 29, 2009)

That's actually a very good idea. A plug in display/programming unit.
Plugging it in activates the programming mode, unplugging it returns it to the normal mode. Hmmmmmm. I like that.



wquiles said:


> Very nice - a display unit
> 
> Could it be something that you can remove after you have done the settings/calibration? That way you could use the "display module" with various lights?


----------



## JimmyM (Nov 29, 2009)

A little more work today. Working on the various functions that will be incorporated into the overall design.
The LCD now displays the set voltage. The rotary encoder adjusts the value up or down. Pressing the button switches the display from White to red, then green after the voltage has been set. At that point the updated Vbulb setpoint is implemented. So that works.
Next is to design a programming menu.
The Mega324P isn't all that expensive in the TQFP package ($3.78 each in qty=100) and it's small enough to incorporate. So unless I hear a lot of feedbacl to the contrary, I'm going to use the Mega324P with the pluggable programming interface.


----------



## Starlight (Nov 29, 2009)

All the bells and whistles sound nice, but not if it gets a lot more expensive. I could be happy with a regulator like your others, except that it needs to handle the higher current and voltages.


----------



## JimmyM (Nov 30, 2009)

That's fine. I'll put together a rough schematic and see about how much the parts cost. Based on the previous boards, I'll estimate overall cost.


Starlight said:


> All the bells and whistles sound nice, but not if it gets a lot more expensive. I could be happy with a regulator like your others, except that it needs to handle the higher current and voltages.


----------



## JimmyM (Dec 16, 2009)

I'm going to see if I can squeeze everything into the Tiny84 for the regulator, and use the Mega324P/328P for the programmer.
I was thinking about the programming part. I'll be testing a few options.

1) Mega324P as regulator with LCD/Encoder as external plugins. Cheapest option if you only need one regulator.
2) Mega168P/88P as regulator, with external LCD/Encoder programmer driven by a Mega324P/328P. More expensive if you only need one, but a little less expensive if you have more than one. 
3) Tiny84 as regulator, with external LCD/Encoder programmer driven by a Mega324P/328P. Cheapest solution of you have more than one regulator. Most of the cost is in the pluggable programmer. This would be ideal, if the Tiny84 can do everything.

None of the above options allows for a permanently installed LCD. It sounds like the LCD is a nice feature, but you guys don't really want the added expense of an LCD. I'm going to be doing more testing, but If I could make the programmer work for multiple designs, it may be a lot more appealing. Perhaps if someone really wants an LCD display on their flashlight, I could build them one. But for the mass production stuff. I think I'll stick to very flexible hardware design without a built in LCD.


----------



## Starlight (Dec 16, 2009)

Jimmy, that sounds good. My Larry12K is salivating.


----------



## petrev (Dec 17, 2009)

Hi Jimmy

Would it be possible to have the programmer + display (Cheapish option 1)
mounted in a small box such that they could be attached with velcro if desired but removable - plug and short umbilical perhaps ? ? ?

Thus we may achieve relative cheapness and a display that could be mounted if desired for extra readouts in use maybe ? ?

I probably need a drawing of what the rig might look like to help my brain with modeling . . .

Cheers
Pete


----------



## JimmyM (Dec 17, 2009)

I've got a couple of ScreenKeys I'm doing development with now, but their data protocol requires a constant clock and bit banging a 10-11 bit packet at 50kHz. Others I'm ordering use 8-bit SPI at up to 2MHz and have better resolution (also a few bucks cheaper, go figure) So I can maybe mock something up after some more testing.

The issue is that if the LCD is used during operation, I definitely can't use the cheaper regulator chips. I have to use the 328P/324P because the needed memory space and pin functions. The Tiny84 can't do 16-bit PWM and serial communication at the same time.



petrev said:


> Hi Jimmy
> 
> Would it be possible to have the programmer + display (Cheapish option 1)
> mounted in a small box such that they could be attached with velcro if desired but removable - plug and short umbilical perhaps ? ? ?
> ...


----------



## petrev (Dec 17, 2009)

OK !

Lost me there . . .so I will just trust you and leave it up to the expert . . .
Always best really :candle:

Cheers
Pete


----------



## petrev (Dec 18, 2009)

Hi Jimmy

Seems the 328P is about $6 for 1 unit so I would wear the extra for my single unit to get the option of an attached display that could move to another if desired and act as a programmer. If this is anything like what you have been talking about ? ? ?

Not sure what the cost frames are for the different version/options you are exploring . . .

I won't be buying that many - unless people want me to make up Larry14K/PK1000s for them . . . I will just convert my own and play !



Cheers
Pete


----------



## JimmyM (Dec 18, 2009)

If an external programmer is used that has it's own chip, I'll use the smallest version of the Mega328/168/88 I can if the Tiny84 won't work. There are just so damn many options.
Basically it comes down to... Super capable, but rather expensive regulator with a cheaper external programmer that may or may not be used as a permanantly installed part of the system. Or a cheaper regulator section that still has lots of auxiliary I/Os, but uses an external programmer that is more expensive than the regulator by quite a bit and cannot be used as a permanent part of the regulator.
I am leaning towards a regulator based on the Mega328P though. It's cheaper than the 324P but still has everything I need and can be implmented any way you want. I'll build the hardware for expandability.

Pete, Maybe you'd like to create a limited run of PK1000s (5 or 10) that have the full regulation and LCD already built in. Just a thought.


----------



## JimmyM (Mar 17, 2010)

I've got the new 64x32 pixel display working. It can do text and bargraphs. Heck I can get it to go a historical playback of battery voltage over time.
And I've done it with smaller cheaper chips. All good stuff.
Any way...
The regulator will be based on the ATMega168 or 88 and (of course) be reprogrammable if you choose to do so.
1) Dual regulated outputs up to 12-bit, ~240Hz
2) 4 auxiliary outputs 
-2 on/off (2 Amp switched ground) - warning LEDs, indicators, Fans
-2 PWM (2 Amp switched ground) ~ 480Hz - pulsing/variable brightness LEDs, etc.
3) 3 button inputs (pushbutton to ground)
4) 3 A/D converter inputs 
-1 for Vbat
-2 others for pots or thermistors. 
5) Unused pins will be brought out to the board connections for future expansion.
6) Hardware will support an externally plugged in LCD (not provided)
7) Absolute max input of 80V
8) Ability to "snap off" the FET section and wire it remotely which will allow the use of Dual FET boards for those of you with dual filaments or obscene current requirements. I suppose you could use 3 or 4 externals if you really wanted to.

I'm estimating power handling in the 40 Amp range up to 60V using Dual 60V FETs.

I'll try to make it as small as possible, but big FETs take up a lot of space.

This is the design I'll be going forward with unless anyone has objections.

I found a smaller 64x32 LCD that's about $60 but is lower profile and will find its way into my personal Mag project.


----------



## Starlight (Mar 17, 2010)

Jimmy, please go forward!! 60v and 40 amps is all I need for now. Put me down for serial number 001.


----------



## wquiles (Mar 17, 2010)

JimmyM said:


> I've got the new 64x32 pixel display working. It can do text and bargraphs. Heck I can get it to go a historical playback of battery voltage over time.
> And I've done it with smaller cheaper chips. All good stuff.
> Any way...
> The regulator will be based on the ATMega168 or 88 and (of course) be reprogrammable if you choose to do so.
> ...



Dude - great update!

Photos? :devil:


----------



## JimmyM (Mar 17, 2010)

wquiles said:


> Dude - great update!
> 
> Photos? :devil:


It's in the breadboard now, tweaking some code while I'm away for work. I'll see if I can get some LCD screens together, but pictures of finished, or even prototyped, hardware are a little bit off. Right now I'm just figuring out if I can include a fan cooled, electrically insulated heat sink on the FET board.

Once I've got hardware working as desired, I'll get working on the UI.

How many buttons do you folks want in the standard interface?


----------



## Starlight (Mar 18, 2010)

Jimmy, I think we need more explanation about your setup. What do the buttons do, and what would more buttons do?


----------



## JimmyM (Mar 18, 2010)

Starlight said:


> Jimmy, I think we need more explanation about your setup. What do the buttons do, and what would more buttons do?


You'll need at least one button to turn it on or off. The others can do anything you want, or don't even connect them. Fleeeexible.

1 could be master on/off, another could be mode (low, med, high)
or you can use 2 as up/down steps...
If you had backlit buttons you could use the Aux outputs to illuminte them under certain conditions.
Whatever.


----------



## Starlight (Mar 19, 2010)

Jimmy, I'm not sure we are on the same page. I plan to bury your regulator inside a lantern. The buttons will not normally accessible. I will only use them to change parameters on the regulator, or can one button input be wired to the lantern switch? How can we accomplish voltage change steps with this setup?


----------



## JimmyM (Mar 19, 2010)

Starlight said:


> Jimmy, I'm not sure we are on the same page. I plan to bury your regulator inside a lantern. The buttons will not normally accessible. I will only use them to change parameters on the regulator, or can one button input be wired to the lantern switch? How can we accomplish voltage change steps with this setup?


No buttons or LEDs will be on the board itself. There will be pads where you solder wires for connecting buttons, switches, LEDs, Fans, Alarms, pretty much whatever you want.


----------



## JimmyM (Mar 19, 2010)

JimmyM said:


> I'm estimating power handling in the 40 Amp range up to 60V using Dual 60V FETs.


My power supply can only do 20A. I'm going to have to hook up car batteries to test power handling. I've already got a 500A current shunt.


----------



## Starlight (Mar 19, 2010)

Jimmy, in an earlier post you said you were planning 3 button inputs. I think that would be enough for the basic setup.


----------



## JimmyM (Mar 19, 2010)

Starlight said:


> Jimmy, in an earlier post you said you were planning 3 button inputs. I think that would be enough for the basic setup.


Yes. 3 button inputs. Not 3 button mounted on the board.


----------



## JimmyM (Mar 20, 2010)

I've breadboarded the mega168 with full text support, rotary encoder, 3 buttons, 6 LEDS (2 variable brightness), and dual regulated outputs.

Now I'll start rolling in all of the low/volt, temperature stuff into the UI.
I've been beating my brain to figure out what the "standard" interface should be... Most folks don't want 3 external buttons and 6 LEDS in their lanterns.

What about this.
Single button (multi-level like the multi-level in the D1). Single regulated PWM output.
Low Battery warning - Pulse the main bulb and/or an external LED.
Over Temp warning - Dim the main bulb or dim main bulb and light an LED.
Remember last level on wake up.

For people that want up/down brightness buttons or rotary encoders, custom LED indicators, auxiliary thermal sensors, code will be made available.

Simple, straight forward to start with.


----------



## Bimmerboy (Mar 20, 2010)

Been lurking this thread for a while, but holding my peace since I don't know when I'll be able to put my money where my mouth is. It'll take a while, but I do want to eventually create a mega-monster... something with WAY too much power for a Mag host to handle. So, I'm throwing my support into the ring.



JimmyM said:


> For people that want up/down brightness buttons or rotary encoders, custom LED indicators, auxiliary thermal sensors, code will be made available.


Very cool, because if I do make some terrifying beast, I'll want a fair amount of the bells and whistles for the "awesome" factor, and to convince everyone around me I've gone completely insane.


----------



## JimmyM (Mar 21, 2010)

Bimmerboy said:


> Been lurking this thread for a while, but holding my peace since I don't know when I'll be able to put my money where my mouth is. It'll take a while, but I do want to eventually create a mega-monster... something with WAY too much power for a Mag host to handle. So, I'm throwing my support into the ring.
> 
> 
> Very cool, because if I do make some terrifying beast, I'll want a fair amount of the bells and whistles for the "awesome" factor, and to convince everyone around me I've gone completely insane.


I KNOW. Right, bimmer?
If I'm sinking God knows how many hundreds into a 1000+watt monster, that thing is gonna have some bells and whistles. Hell, I want the filament to whine "greensleeves" during start-up. The hardware will be capable of a LOT. However, the things that make it capable of all the bells and whistles, don't add much cost at all.
What is going to cost money... The primary 12V regulator capable of 80 volts will cost about $6 in parts alone. Big FETs are $3-$7 each. It's not gonna be cheap, but will still probably cost less than $100.


----------



## Starlight (Mar 21, 2010)

Jimmy, single button like the D1 is just right for the standard interface. Under $100 will be fine. You probably better sign me up for serial numbers 001 & 002.


----------



## petrev (Mar 21, 2010)

JimmyM said:


> I KNOW. Right, bimmer?
> If I'm sinking God knows how many hundreds into a 1000+watt monster, that thing is gonna have some bells and whistles. Hell, I want the filament to whine "greensleeves" during start-up. The hardware will be capable of a LOT. However, the things that make it capable of all the bells and whistles, don't add much cost at all.
> What is going to cost money... The primary 12V regulator capable of 80 volts will cost about $6 in parts alone. Big FETs are $3-$7 each. It's not gonna be cheap, but will still probably cost less than $100.


 
Hi Jimmy

Sounds Great

As long as the pads are there for all the extras you can think of - and you write the masses of code needed - I think everyone will be happy.

Cheers
Pete


----------



## JimmyM (Mar 30, 2010)

I've got a "first pass" at the PCB design. I'm sure I can make it smaller and some of the circuitry will change based on some bench testing to be done. Right now, it's 50mm x 100mm (about 2 in x 4 in)


----------



## JimmyM (Apr 4, 2010)

I've incorporated relay to disconnect the Vbat sampling resistor divider while off to reduce parasitic losses. I have to order parts for some other testing. Like the 12V primary and 5V auxiliary regulators. I want to try to keep sleep mode power to a minimum. Sleep moce isn't much good if the quiescent current of the onboard regulatos is 100mA.


----------



## smopoim86 (Apr 9, 2010)

This is something I'm definitely interested in. Put me on the list. 

Daniel


----------



## lunchboxtheman (Apr 9, 2010)

JimmyM said:


> I've got a "first pass" at the PCB design. I'm sure I can make it smaller and some of the circuitry will change based on some bench testing to be done. Right now, it's 50mm x 100mm (about 2 in x 4 in)




PCB design looks solid. Once you make sure that it works, you could send it off to a PCB fab service and have it done professionally (which is getting pretty cheap these days). If you did that, you could even use all SMD parts instead of dealing with big through hole parts making it super small and even more awesome!

Keep up the good work. I'm just a programmer, wish I knew more about the hardware side of things.


----------



## JimmyM (Apr 10, 2010)

lunchboxtheman said:


> PCB design looks solid. Once you make sure that it works, you could send it off to a PCB fab service and have it done professionally (which is getting pretty cheap these days). If you did that, you could even use all SMD parts instead of dealing with big through hole parts making it super small and even more awesome!
> 
> Keep up the good work. I'm just a programmer, wish I knew more about the hardware side of things.



I see you've just got here. Welcome.
In my sig is a link to a previous run of regulators that I designed. I had the boards fab'd for that run and will have them fab'd for these too. The professionally done boards are just so nice. It makes reflowing them in my reflow oven almost too easy. Except for the tweezer placement of over 100 components.
This design is 4 layers too, so I can't really do that at home. The high current paths use all 4 layers (2 oz outside, 1 oz inside) with several vias to distribute current amongst the layers.


----------



## smopoim86 (Apr 16, 2010)

What's the current timeframe on these? I'd ideally like one or 2 before the SE Cloudland Canyon meetup. I know it's probably too soon. I'm just itching to get some power behind these big lamps and don't want to blow one in the process.

Thanks
Daniel


----------



## JimmyM (Apr 17, 2010)

smopoim86 said:


> What's the current timeframe on these? I'd ideally like one or 2 before the SE Cloudland Canyon meetup. I know it's probably too soon. I'm just itching to get some power behind these big lamps and don't want to blow one in the process.
> 
> Thanks
> Daniel


I'm not sure when that is, but these aren't even finished development. Not for months.


----------



## petrev (Apr 17, 2010)

Hi

Looks Lovely

*SE Regional Get-together IV - Cloudland Canyon - Tenn Georgia Ala - May 15 Tentative* 










Shame it's not in my neck of the woods !

Pete


----------



## JimmyM (Apr 23, 2010)

Here's another pic of the board. I've added SPI and I2C headers to facilitate things like LCD displays, etc. I've breadboarded most if the circuitry and it all works as intended. I still have to test the power supply section. It has to be able to drop as much as 80V down to 12V and not overheat while running a few extra LEDs or an external LCD. I've got some parts to test a DC-DC converter as well as a linear option.


----------



## JimmyM (Apr 25, 2010)

More progress in the software area. Working on base functionality. Things get a little noise sensitive when an 80V range in compressed to 1.1V. But I've got things stable with an 80V input and 10V Vbulb. So that's all good.
I'm going to add the low voltage and high temp warning logic next, but want to include compile time options to use the auxiliary outputs for warning LEDs instead of pulsing or dimming the light. I'd like it to be optional to just have the light dim or shutdown and use LEDs for status.

How do you folks feel about external temperature sensors? Thoughts?


----------



## Starlight (Apr 25, 2010)

Jimmy, I don't think a temp sensor is something I will use.


----------



## petrev (Apr 27, 2010)

JimmyM said:


> . . .
> 
> How do you folks feel about external temperature sensors? Thoughts?


 

Hi Jimmy

Not essential ! 
Could be a nice option for people who want to monitor batteries or lamp housing ? Or some such
Low extra cost might consider it ! ? ?

Keep up the great work
Cheers
Pete


----------



## smopoim86 (Apr 27, 2010)

What would it take to have a 12v fan connection to keep the batteries and unit cool off the board? I'm just thinking out loud. I was looking at building a custom box for a par64 and putting a 120mm fan in the rear to keep the case reasonably cool.


----------



## JimmyM (Apr 28, 2010)

smopoim86 said:


> What would it take to have a 12v fan connection to keep the batteries and unit cool off the board? I'm just thinking out loud. I was looking at building a custom box for a par64 and putting a 120mm fan in the rear to keep the case reasonably cool.


The board has an auxiliary outputs that are FET switched grounds. So, depending on how much current it drew, you could use the 12V+ bus from the board to power the fan(+) and connect the Fan(-) to one of the Aux output FETs. How much current it draws is very important. I haven't tested the on-board primary voltage regulator yet. But power dissipation is critical.
With a 60V input, running a 12V fan at 500mA will require power dissipation of 24W. WAY too much. I could add a heat sink, but that drives up cost. I could use a DC-DC converter (switching power supply) for the primary regulator and it could do it without a problem. But that will drive up the cost. As it sits now (with a Linear primary power supply), it can run external LEDs and low power stuff like that.
As it is I'm going to build the output section to allow the use of heatsinks and even potentially fans for the heatsinks, but have an eye on cost.
Can you dig up some specifics on a 120mm fan that you might use? Voltage/Current, etc.


----------



## smopoim86 (Apr 28, 2010)

For a 12v 120mm fan anywhere between 80ma for a light duty fan to around 550ma for a 120x38mm sanAce.


----------



## JimmyM (Apr 28, 2010)

smopoim86 said:


> For a 12v 120mm fan anywhere between 80ma for a light duty fan to around 550ma for a 120x38mm sanAce.


I'm going to be doing some power supply breadboarding and testing in the coming days, so we'll see what happens. But I can tell you that 550mA is too much unless you're running a much lower pack voltage. I want to keep the cost of these things as low as possible. Adding a heat sink to it will only add about $1, but something that size will only be able to dissipate a couple of watts. Using a DC-DC converter will add about $10 (maybe more) to the cost.


----------



## JimmyM (Apr 28, 2010)

I've been doing some messing around with the board design. Right now it's 50mm wide by 73mm long. Not including the detachable output section. That adds 35mm to the length. Overall it's 50mm x 98mm. Do you guys have that much room?
If it's too big, let me know now before I build these things. If it absolutely HAS to be smaller, I can use a smaller micro-controller and reduce the auxiliary inputs/outputs to a bare minimum.

I also have, in the design, secondary drive sections that are an exact copy of the drive section shown above. I have added room for heatsinks that will be included (they're small but will help) and a provision for a drive section cooling fan which will be up to the buyer to procure/install. I've found very nice small fans at Digikey. They're 25mm x 25mm x 10mm thick and can move 3.5CFM at 12V. They draw ~86mA each.


----------



## Starlight (Apr 28, 2010)

Jimmy,
I just pulled out my light and checked it for board size. If the board doesn't go over 4 inches, it will fit fine. However, if you could add the 35mm on the side rather than the end, it would be better (85mm x 73mm, rather than 50mm x 98mm).


----------



## JimmyM (Apr 29, 2010)

Starlight said:


> Jimmy,
> I just pulled out my light and checked it for board size. If the board doesn't go over 4 inches, it will fit fine. However, if you could add the 35mm on the side rather than the end, it would be better (85mm x 73mm, rather than 50mm x 98mm).


I'll see what I can come up with. But keep in mind, the drive section is removable for mounting more conveniently or nearer the high current path. You just score with a knife and snap it off. Or I could do it before shipping.
Heavy gauge wire attachment can be done via solder or #8 machine screws and ring terminals.


----------



## JimmyM (Apr 29, 2010)

After some quick rearrangement (this may change a little)

Overall board:
86.8mm x 72.3mm

Control board:
51.9mm x 72.3mm

Drive Section:
34.6mm x 72.3mm


----------



## JimmyM (Apr 29, 2010)

This is a serious matter whose answer is NOT "As high as possible".

The answer will seriously affect the final cost/size/complexity of the regulator.

A 60V unit is easier to design for rather than 80V+.

So 2 questions...
1) How much voltage to you guys see actually putting into this thing?

2) Will you operate additional items off of this? Status LEDs, etc.

I know we've discussed this along with lots of other bells and whistles, but seriously. How much are you willing to pay for stuff you'll never use?

$75 for a single channel regulator with no external outputs?
$175 for a dual channel bad boy with features galore?


----------



## smopoim86 (Apr 29, 2010)

For My use, 60v would be acceptable (16 A123 @ 56.7v). I'd love to have some of the bells and whistles. I've ordered a couple of the cheap volt meter displays and they require 5v supply, it would be nice to be able to power one or 2 of those. That would make the need of battery status leds void. I'd love to have a way to power a 12v fan, but it's really not a real necessity. Offering a dc>dc converter separate might make more sense. 

As for price. I probably wouldn't be interested at 175. I'd be willing to play up to around $130 depending on features.

Daniel


----------



## JimmyM (Apr 30, 2010)

I may have a partial solution...
The onboard regulators will be able to handle 70V Max but just be able to power the micro-controller and FET drive circuitry. Nothing else. But I can leave a provision on the board for a 3-pin switching regulator that you guys could add if your needs dictated it. I found a simple 3-pin switcher that can do Up to 60V and is adjustable. SO you could use it to supply 12V or 5V or whatever to drive accessories you want. The devices can sill be controlled by the micro-controller since it will have high voltage FETs as auxiliary outputs. They just switch the ground lead of your added device.
The switcher I found is here HV Adjustable Switcher
Sound like a possible solution?


----------



## smopoim86 (Apr 30, 2010)

Seems like a good way to add additional options without raising the price for everyone
.


----------



## petrev (Apr 30, 2010)

Hi Jimmy 

Sounds a good way to go.

Nice idea and I guess you could parallel 2 units to drive both 12V and 5V (for a fan and a small volt meter display say ?)

Nice find.

Cheers
Pete


----------



## Starlight (Apr 30, 2010)

Jimmy,
60V is plenty for me. I probably won't go much over 40V, dropped down to about 30V. It's the high current capability that is needed. I need at least 25 amps, and 35 would be better. If someone just wants more battery capacity, they can always parallel battery packs.

The 86.8mm x 72.3mm board will be very good.


----------



## smopoim86 (Apr 30, 2010)

I've been looking for a less expensive option for acc power and found these http://focus.ti.com/docs/prod/folders/print/tl2575hv-05.html#samples

Looks like you could build a Vout fixed at 12 or 5v for just a few dollars extra. I'm definitely no expert at electronics, but it seems like it could be a viable option.

Maybe have the board made for the components and have it as an option?


----------



## JimmyM (Apr 30, 2010)

I've got a new board design.
69.9 mm x 62 mm including the drive section. It includes mounting pads for the Switching regulator above.
I used a surface mount micro-controller and removed the I2C and SPI headers. I'm testing out a new sampling divider disconnect to hopefully reduce parasitic current drain. We'll see. The math works.
Also included with the rearrangement is room for 2 heatsinks for the high current FETs. I managed to keep all of the auxiliary I/O pins. Still working on it.


----------



## JimmyM (May 3, 2010)

Can I get a show of hands to see how many I should build?
I won't be making a hundred of these like the D1s.
So whoever wants one, please make your needs known or this run may never happen. I can't afford to loose $1000 if I only sell 2 of these things.


----------



## JimmyM (May 3, 2010)

JimmyM said:


> I've got a new board design.
> 69.9 mm x 62 mm including the drive section. It includes mounting pads for the Switching regulator above.
> I used a surface mount micro-controller and removed the I2C and SPI headers. I'm testing out a new sampling divider disconnect to hopefully reduce parasitic current drain. We'll see. The math works.
> Also included with the rearrangement is room for 2 heatsinks for the high current FETs. I managed to keep all of the auxiliary I/O pins. Still working on it.


The sampling disconnect works great. As does the high voltage primary regulator. It was able to run a 20 mA LED at 50V input and just barely get warm. It was also able to run 2 LEDs at 40V input. That's the same power dissipation as 20mA at 80V input. SO I think we're looking good there. FETs will be 75V units. The over all unit will be officially rated at 70V input.


----------



## smopoim86 (May 3, 2010)

I'm in for 1, possibly 2. Really depends on how the current project turns out


----------



## JimmyM (May 3, 2010)

smopoim86 said:


> I'm in for 1, possibly 2. Really depends on how the current project turns out


What current project? This X1 project? How do you like how it IS going? Any feedback?


----------



## smopoim86 (May 3, 2010)

Sorry, I wasnt clear at all. I meant a current project of mine. 

This project seems to be going well. I like your quick response to the feedback. 

Daniel


----------



## JimmyM (May 3, 2010)

Here's yet another revision of the PCB design.




Things have changed so much over the course of this thread. LCD screens, blah blah blah.
Here's what we have. In no particular order.
Atmel ATMega88 microcontroller
Regulator architecture capable of driving 2 regulated outputs.
Dual 75V FETs on detachable drive section. (Single output)
Additional drive section can be purchased if desired.
Heatsinks on output FETs
70V input rating.
Current rating to be determined.
2 on/off FET switched ground auxiliary outputs (1A each)
2 PWM FET switched outputs (480Hz)(1A each)
3 defined button inputs (only need one with current software)
2 auxiliary A/D inputs
Sample divider disconnect
4 unused I/O pins brought out to pads
Mounting position for customer installed switching regulator with power output pads.
Diagnostic I/O pin. Can be re-tasked if needed.
6pin Standard AVR programming port.

An LCD screen/button can be installed by the user using the AVR programming port's SPI pin connections.

If there's something else you can think of, let me know now.
Thanks.


----------



## Starlight (May 3, 2010)

Jimmy,
I want 2 for sure and I may buy a third. What does an additional drive section do for me?


----------



## petrev (May 3, 2010)

Hi Jimmy

That is a lovely looking board you got there - Super Nice.

I will have 1 for definite - people this side of the pond don't seem to want to spend any money on my big lights - so I will just make a super 1000W light for me and see if there is any respose when it's done . . . 

You should run through the major options available with your super expandable and customisable outputs and inputs. It would be good to know what you have managed to incorporate from the long list that has appeared all over this thread ! I'm just not technical enough to be able to work out all that can be programmed in and added on ? 

Cheers
Pete


----------



## JimmyM (May 3, 2010)

Starlight said:


> Jimmy,
> I want 2 for sure and I may buy a third. What does an additional drive section do for me?


The additional drive section is for people that want to drive a 2nd filamant at different voltages that the "main". The processor can do it without a problem and it doesn't take more than a couple of additional board traces. So it's a no-cost capability. If you DO want to add a second lamp, just wire on the additional board.


----------



## JimmyM (May 3, 2010)

petrev said:


> Hi Jimmy
> 
> That is a lovely looking board you got there - Super Nice.
> 
> ...


Dual 75V FETs on detachable drive section - You can remotely mount the drive section if you want.

Additional drive section can be purchased if desired to regulate voltage to a second lamp.

Heatsinks on output FETs - Increase current carrying capability.

2 on/off FET switched ground auxiliary outputs (1A each) - You can turn on/off secondary devices. Fans, LEDs, etc

2 PWM FET switched outputs (480Hz)(1A each) - Varying brightness, power to LEDs, Fans, etc.

3 defined button inputs - You only need one to operate the regulator. But you can use these for additional buttons switches to control whatever you want.

2 auxiliary A/D inputs - External thermal sensors.

Sample divider disconnect - Reduces parasitic power drain while off.

4 unused I/O pins brought out to pads - Anything you want.

Mounting position for customer installed switching regulator with power output pads. You can power auxiliary devices from a battery up to 60V. Fans, LEDs, LCDs, etc.

Diagnostic I/O pin. For testing purposes. If you're doing so much that you need an addition I/O pin you can use this one. Otherwise it's for development and program timing output.

I can't list everything that can be done with this because it's basically unlimited. You could program this thing to literally play Greensleeves with the filament's magnetostriction. It's a microcontroller. You can program it to do almost anything. I've got the basics already written. But the details aren't all worked out yet. So a lot is still flexible.


----------



## JimmyM (May 3, 2010)

Maybe all of this is too much?
Even simpler?


----------



## Starlight (May 4, 2010)

Jimmy,
I don't need the bells and whistles, but I will buy whatever you decide to produce.


----------



## JimmyM (May 25, 2010)

Starlight said:


> Jimmy,
> I don't need the bells and whistles, but I will buy whatever you decide to produce.


That's what I like to hear! :devil:

Going back to the optional onboard switcher to run accessories...
I found this little gem at digikey.
http://search.digikey.com/scripts/DkSearch/dksus.dll?vendor=0&keywords=945-1057-ND
Half the price of the one above. Only good to 0.5A, but at least you have options.


----------



## JimmyM (May 25, 2010)

I'll tell you what I'm going to do. I'm going to design out all of the extra crap and see how small, simple, cheap I can make it and still hit all of the design requirements. Those requirements are high voltage, high current regulation and programmability. I won't throw away this design, just design a variant that's simpler/smaller/cheaper.
Let me come up with something and see what you guys think.


----------



## Bimmerboy (May 25, 2010)

JimmyM said:


> I'll tell you what I'm going to do. I'm going to design out all of the extra crap and see how small, simple, cheap I can make it and still hit all of the design requirements.


Well... crap. :sigh: Speaking for myself, I'm gonna' have to give a thumbs up to this idea, as it speaks exactly to my recent thoughts. 

Any number of reasons are putting on hold my envisioned, _über tech_, township-wide-advertisement-of-my-nerdiness, gigantic, expensive light cannon. Wouldn't even know where to store it, much less use it around here. Money's also an issue. :shakehead 

For now, it's home made, sheet metal housing, one of those cheap V/I/W LCD meters for cool looks, and sealed beams ranging from PAR36 - 56. Won't come anywhere close to pushing the driver's limits, but this solves a number of problems for me, while still allowing me to build a real scorcher. If I can reasonably get into programming the thing, I've got incredible platform versatility as well.

Looking forward to what ya' come up with, Jimmy. I'm definitely in! :thumbsup:


----------



## petrev (May 26, 2010)

JimmyM said:


> I'll tell you what I'm going to do. I'm going to design out all of the extra crap and see how small, simple, cheap I can make it and still hit all of the design requirements. Those requirements are high voltage, high current regulation and programmability. I won't throw away this design, just design a variant that's simpler/smaller/cheaper.
> Let me come up with something and see what you guys think.


 
Hi Jimmy

Sounds good - From my point of view (400W-1100W) 

Not sure how slimmed down you are going ? I like the idea of "in the field" swaps of bulb so need to be able to change max power setting without re-prog (Change profile ?! or some such) I also would like to be able to add the driver thingys for a 12V fan and 5V meters as needed if that is still an option ? Status LEDs for LOW-BATT etc. would still be a nice option. 

Not sure which things are cost/complexity extras and which are just pad programming extensions . . .

Sorry if this is all gibberish to people who know what they a are talking about !

Keep up the good work
Cheers
Pete


----------



## JimmyM (May 26, 2010)

petrev said:


> Hi Jimmy
> 
> Sounds good - From my point of view (400W-1100W)
> 
> ...



Hell, the D1 could just maybe do 400W. The X1 should handle 1100W without issue. I've done some work on the design. I changed microcontrollers. Tiny84 instead of the Mega88 and removed all of the auxiliary output stuff. I was able to remove ~3/4" from the board. But there's room for a couple of outputs, without increasing board size or changing chips. I'll add a couple. But as far as the add-on regulator to drive accessories, that WILL increase the size of the board back to where it was.


----------



## Starlight (May 26, 2010)

JimmyM said:


> I'll tell you what I'm going to do. I'm going to design out all of the extra crap and see how small, simple, cheap I can make it and still hit all of the design requirements. Those requirements are high voltage, high current regulation and programmability. I won't throw away this design, just design a variant that's simpler/smaller/cheaper.
> Let me come up with something and see what you guys think.



High voltage (40v-60v), High current (25A-40A), and programmability. That's exactly what I have been talking about! Go Jimmy, GO!


----------



## Starlight (Jun 15, 2010)

Bump for update.


----------



## JimmyM (Jun 15, 2010)

Sorry for the lack of presence here. I've had other things to do.
I have a smaller simpler design worked out in software (smaller and cheaper), but still capable of the same voltage and current. I have to make some changes to the prototype software. I've also stared, but not completed, testing of the primary regulator section. I built a prototype board for the high voltage section but have not proceeded with testing. My biggest concern was heat, but I may also have another solution. I've found a small, cheaper than the previous model, switching regulator that is good from 17V to 72V. I may re-design the board to accommodate this new module. It will add somewhat to the cost, but only about $7-$9 per board. Also, I need to build the BOM to properly estimate costs. I envision only building 25 of these as I don't predict demand will be as great as it was for the JM-PhD-D1.


----------



## JimmyM (Jun 26, 2010)

OK. I've redesigned the board to use the Tiny84 as stated before. I'm going to use the switching power supply (DC-DC converter) for all models. That allows you 12V at 500mA including onboard usage which is <10mA. So that should drive a small fan. It should also power a meter display if you use a small 5V regulator from the 12V aux output. I was able to retain 2 of the auxiliary outputs that can use PWM to vary power to auxiliary devices like LED indicators, Fans, etc, or just ON/OFF if you want. It can be done in programming. There is a DIP switch on the board for user settings like voltage ranges, etc.

I've built a BOM for the redesign. It's more expensive than I would have thought. Since I'm only building 25, the boards, regulators, and FETs make up the bulk of the parts cost. There's nothing I can really do about that. Redesigning won't remove those items.
So... the answer to the big question. How much will it cost? $100USD


----------



## petrev (Jun 26, 2010)

:thumbsup:


----------



## Starlight (Jun 26, 2010)

Still fine with me.


----------



## JimmyM (Jul 10, 2010)

A bit of a setback. My bench PC died. It won't get past the Compaq logo. No BIOS edit options are shown. Tried swapping out RAM, etc. To no avail. It was working just earlier this week. So have to get a new (at least new to me) computer.


----------



## wquiles (Jul 10, 2010)

Ah man! That sucks. The same happen to me during the development of the PhD-M6. Luckily I had backed prior to the failure, but it still sucks having to install everything again


----------



## JimmyM (Jul 10, 2010)

wquiles said:


> Ah man! That sucks. The same happen to me during the development of the PhD-M6. Luckily I had backed prior to the failure, but it still sucks having to install everything again


Yeah. Backups aren't a problem. But a new machine is a HUGE PITA!!!


----------



## Starlight (Aug 13, 2010)

BUMP. I needs my regulators!


----------



## LuxLuthor (Aug 14, 2010)

JimmyM said:


> Yeah. Backups aren't a problem. But a new machine is a HUGE PITA!!!



WOW, just read that Jimmy! Very sorry you have this hassle.


----------



## JimmyM (Aug 14, 2010)

LuxLuthor said:


> WOW, just read that Jimmy! Very sorry you have this hassle.


Computer has been fixed. It turns out I have a bad USB device. My microscope. When ever/where ever it's plugged in, the PC won't boot. I haven't had a chance to get another yet. I've been busy with work, home projects, family vacations, etc. Summer is tough. I've put in some time fine tuning the smaller unit. The PCB design is just about complete. Now all I have to do is secure financing from my CFO (wife). I also want to breadboard the entire thing from HV section to the bulb and 2 BIG FETs. Another design I finished for another CPFer a few weeks ago uses the same FET driver I'll be using and it worked fantastically. 50Vin, 36-40Vout, 1 FET, 12 amps and it barely even warmed up without a heatsink. I think Dual FETs at 20-30A here will be a walk in the park.


----------



## Starlight (Aug 14, 2010)

Jimmy,
I need 2 of these regulators. I would be happy to send you $200 now, and you can deduct that from my order later.


----------



## JimmyM (Aug 14, 2010)

Starlight said:


> Jimmy,
> I need 2 of these regulators. I would be happy to send you $200 now, and you can deduct that from my order later.


I appreciate the offer, but $200 is a drop in the bucket. And I can't guarantee when you get them.
I'm pushing these back to the top of the priority list.


----------



## JimmyM (Aug 15, 2010)

Discussing financing now. I'll be in the basement this week to confirm hardware design. Then I'll buy parts. I was able to get 2 sample HV primary regulators for testing. That will help prove the entire design.


----------



## JimmyM (Aug 28, 2010)

Hardware design is confirmed.

Added one more component to make the primary regulator stable at such a low current draw. 
Added an LC (inductor/capacitor) filter to the battery ADC input to make the battery voltage reading less noise sensitive.
Added a jumper to disable the regulation output during programming.
Added 2 additional pads. One for my use during diagnostics (but can be used to drive an LED if necessary), and another for future use (ON-OFF control, ADC for external temperature, etc).

For testing I set voltages of 8.0-12.0 (5 steps)
Accuracy was excellent (7.999V, 8.997V, 9.995V, 11.000V, 12.001V).
Even when I increased/decreased input voltage from 14V to 27V, Vout was always within 0.02V of target.

I've got software pretty much completed.
As it is coded right now, you get 5 levels, a Memory start feature (turns on to the last level in use before shutdown), Low voltage warning/shutdown, high temp (in the AVR only) warning/shutdown. These are standard configuration options.

Auxiliary PWM outputs (2) that can be used for warning LEDs or Fans, etc. There are 2 DIP switches onboard for future options, also there are 2 12V (actually 11.4V) connections available to power things like fans, LEDs, external digital displays. Current drawn from these 2 points CANNOT exceed 450mA.

The use of these auxiliary PWM outputs, ports, and switches is up to the user. But requires additional coding to implement. I won't be offering to write custom code for each regulator. There are sooooo many possibilities built into this board that each user's custom code would take hours to nail down requirements and implement/test. Perhaps in the future I may offer custom code, but it can't be free.


----------



## Starlight (Aug 28, 2010)

Jimmy,
Glad to see that things are progressing, especially since football season is about to start. (You might get distracted.) I still need two.


----------



## JimmyM (Aug 28, 2010)

Starlight said:


> Jimmy,
> Glad to see that things are progressing, especially since football season is about to start. (You might get distracted.) I still need two.


Lucky for all of you I'm not a rabid football fan. Unless the Patriots make the playoffs.

Starlight, When these are done and tested, I'm not even going to post all 25 for sale. I'll post 23, and just send 2 directly to you.


----------



## LuxLuthor (Aug 28, 2010)

JimmyM said:


> Computer has been fixed. It turns out I have a bad USB device. My microscope. When ever/where ever it's plugged in, the PC won't boot. I haven't had a chance to get another yet. I've been busy with work, home projects, family vacations, etc. Summer is tough. I've put in some time fine tuning the smaller unit. The PCB design is just about complete. Now all I have to do is secure financing from my CFO (wife). I also want to breadboard the entire thing from HV section to the bulb and 2 BIG FETs. Another design I finished for another CPFer a few weeks ago uses the same FET driver I'll be using and it worked fantastically. 50Vin, 36-40Vout, 1 FET, 12 amps and it barely even warmed up without a heatsink. I think Dual FETs at 20-30A here will be a walk in the park.




Details sound great. Please reserve me 1 or 2 if you can.

Imagine that...."our" cute little USB microscope made with the highest quality Chinese junk causing a problem!!! I still use that software you sent me from the baby cd. Someday when I clean up my "work area," I'll find my original cd.


----------



## JimmyM (Aug 28, 2010)

LuxLuthor said:


> Details sound great. Please reserve me 1 or 2 if you can.
> 
> Imagine that...."our" cute little USB microscope made with the highest quality Chinese junk causing a problem!!! I still use that software you sent me from the baby cd. Someday when I clean up my "work area," I'll find my original cd.


There are other USB microscopes available (Chinese junk I'm sure) that are better, but still the same form factor. I'd rather not post an eBay link here since I'm not keen on promoting any particular seller. But item#370389432200 is representative of the model I'd like to get to replace my old one. 8x LEDs and 400x magnification.


----------



## Starlight (Aug 28, 2010)

Two directly to me! Now that sounds like a really good idea!


----------



## JimmyM (Sep 26, 2010)

It's been a while. Been pretty busy with other stuff. But I thought it was a good time for an update.
The design is about as solid as I can make it. Hardware has been fully prototyped and functions as expected. Finding is near and will start buying parts ASAP.
Thanks for your patience, guys.


----------



## Starlight (Sep 26, 2010)

Jimmy,
Is this regulator capable of running a 64663 bulb (40v, 12A)? I can't remember the specs for it. I was only planning to run a 4559 (30v, 24A) bulb, but I might want to try the 64663. I may now need 3 regulators.


----------



## JimmyM (Sep 26, 2010)

Starlight said:


> Jimmy,
> Is this regulator capable of running a 64663 bulb (40v, 12A)? I can't remember the specs for it. I was only planning to run a 4559 (30v, 24A) bulb, but I might want to try the 64663. I may now need 3 regulators.


No problem. 17-70V. up to 40A. The upper current limit is based on thermal considerations. A small FET with no heat sink can do 13A on the PhD-D1. This one has 2 BIG (lower resistance) FETs and heatsinks. So we'll see. I'm not even sure how I'll test the full capabilities. I might have to get 5 car batteries and a few giant bulbs.


----------



## JimmyM (Sep 30, 2010)

I have a bit if a problem here. I don't have the equipment to test this thing under maximum expected operating conditions. I'm hoping to get high current test results with 48-60V input and about 40A output. Does anyone here have equipment capable of doing that type of power?

Current is what makes heat. If no one can test the regulator at those voltage and current levels, I'll have to do testing at lower voltage but still high current.


----------



## wquiles (Sep 30, 2010)

Jimmy,

That is a LOT of power :devil:

I am not even close as my largest power supply is a HP that can do 60 volts at 10 amps. But if that helps, then let me know.

Will


----------



## JimmyM (Sep 30, 2010)

wquiles said:


> Jimmy,
> 
> That is a LOT of power :devil:
> 
> ...


Mine will do 30A and 50V. I'm trying to team up with Lux Luthor and his 20A/30V supply to see if we can get 40A and 30V available. I think 4 or 5 24V 250W bulbs ought to suffice for a load.
The math says it will do 40A RMS while dissipating only 2W each. At that power dissipation, the heat sinks should warmup.


----------



## JimmyM (Oct 1, 2010)

Ordered parts today from Digikey. One of the items, the big FETs are on backorder for a couple weeks. But that's OK. They're nice 3.9 mOhm units.

(*$%*@!! I just found out that the switching regulators can only be bought in a minimum quantity of 42 and since the pricing I got previously was for 100+ units, they're more expensive now. The unit price of these regulators has to go up accordingly. I'm sorry guys. These are the ONLY regulators that will allow the regulator board to perform at such a wide voltage range. The unit's are now $110 each.

Again, sorry I used a unit price previously that I can't meet now.

EDIT: Now the parts are not available until January of 2011. Delays, delays, delays. But the end is in sight. Thanks for keeping the faith.


----------



## JimmyM (Oct 1, 2010)

What about a pre-order offering at $100 each?
If you folks are amenable to this idea I could start a pre-order thread in the Market Place.


----------



## LuxLuthor (Oct 2, 2010)

JimmyM said:


> Mine will do 30A and 50V. I'm trying to team up with Lux Luthor and his 20A/30V supply to see if we can get 40A and 30V available.



Sorry we can't do this as discussed in emails.



JimmyM said:


> What about a pre-order offering at $100 each?
> If you folks are amenable to this idea I could start a pre-order thread in the Market Place.



Can you give a summarized list of features you have decided on, since there has been some changes made along the way?


----------



## JimmyM (Oct 2, 2010)

LuxLuthor said:


> Can you give a summarized list of features you have decided on, since there has been some changes made along the way?


 
I'll figure out some other way to test it.

I'll put together a full description and features (implemented and some possibilities available through custom programming).


----------



## Starlight (Oct 2, 2010)

Jimmy,
I offered to do that already, so count me in for prepay.


----------



## JimmyM (Oct 3, 2010)

OK. Once I get a few minutes I'll put together a sales thread with all the specifics. Prepay/pre-order for $100 until they're ready to ship, then $110 after that.
I'll post a link to the thread here.

I've got a pre-order thread drafted, but I'm just waiting for some feedback from the moderators on the best place to put it. In the MarketPlace or the same group where I sold the PhD-D1s


----------



## JimmyM (Oct 3, 2010)

Summary of features/capabilities
Hardware features.
1) 17 to 70V input range
2) 0 to battery voltage output range
3) Minimum 40A current carrying capacity
4) Dual 3.9 mOhm FETs with heat sinks.
5) Pads for attaching ring terminals for bulb power (#8 screws).
6) 12-bit regulation (~0.02V accuracy/stability)
7) Detachable high current section
8) removable/replaceable micro-controller (Tiny84)
9) Programming header (programming adapter provided)
10) Dual auxiliary outputs that are 8-bit PWM capable. Possibly for switching power for a fan or LEDs (30V, 1A max). (firmware configurable)
11) Accessory power supply. ~11.4V @ 400mA MAX
12) 2 position DIP switch (firmware configurable)
13) 2 auxiliary micro-controller ports (firmware configurable)
14) Connection for wiring in a button to control it. (Button not supplied)
15) Output disable jumper for programming without possible bulb damage.

Firmware: (Currently allowed for)
1) Up to 5 levels
2) Low voltage warning/shutdown
3) Over temp warning/shutdown (based on micro-controller temp)
4) Memory start (when enabled, it will start at the last used voltage level)
5) "S" curve soft-start

Possible future additional configurations (Customizations)
1) External LED to light/pulse when in or before low voltage condition.
2) External LED to light/pulse when in or before over temp shutdown.
3) Thermostatically controlled cooling fan
4) Thermistor protected battery pack
5) volt meter / ammeter powered by accessory power.
6) Multi-mode (voltage ranges, etc) selected using DIP switches.
There are a lot of possibilities that I'm sure I haven't even thought of yet

Questions?


----------



## LuxLuthor (Oct 4, 2010)

Holy Moly! Is this also able to asexually reproduce itself? I don't want to get into a potential Stargate Atlantis Replicator scenario.

I had no idea you were building in so many additional features. Now the price makes more sense. What is the physical size of this? Do any parts need heatsinking? How complex (vs. previous releases) do you envision programming?

I think I would likely confirm two. Maybe more. Do you have a minimum quantity you need confirmed before this will work?


----------



## petrev (Oct 4, 2010)

:thumbsup:

Totally 

Put me on the list for 1 right now 

Pete


----------



## JimmyM (Oct 4, 2010)

LuxLuthor said:


> Holy Moly! Is this also able to asexually reproduce itself? I don't want to get into a potential Stargate Atlantis Replicator scenario.
> 
> I had no idea you were building in so many additional features. Now the price makes more sense. What is the physical size of this? Do any parts need heatsinking? How complex (vs. previous releases) do you envision programming?
> 
> I think I would likely confirm two. Maybe more. Do you have a minimum quantity you need confirmed before this will work?



Self replication has been disabled in the base code. We're safe.

The FETs are already heatsinked. At 40A, they will each be dissipating about 1.56W @ 100% duty. The heat sinks will see about a 38 deg C rise above ambient at 2W dissipation each. Below 100% duty, there will be less ON-state dissipation + switching losses. The FET driver helps reduce that to a minimum. Switching times are in the 1-2 uS range. The board traces are 2oz copper and as wide as I can make them. The FET Drain traces are 14mm wide. At 20A each (top+bottom) a 10 deg C rise requires 9.4mm traces, I have 14mm. The FET Source trace (top) is, at its narrowest, 7.2mm, but is only carrying 1/2 the current to just one of the FETs. The bottom trace is wider and carries the other half. Power dissipation from the traces, even at high current, is minimal.
The firmware is not at all complex. Once you see it, you'll see a lot of the same routines used in the PhD-D1.
As far as size... It's 2.75" by 2.19" (69mm x 55mm)

For electrical safety, I'm going to apply "liquid electric tape" to a couple of spots on the board to help reduce possible short circuit opportunities.


----------



## JimmyM (Oct 4, 2010)

The Pre-order thread can be found HERE.
Even if you have already spoken up regarding your order of one or more of these, please make a post in the pre-order thread.

If you have questions or comments regarding the thread. Please post them here.
Thanks.


----------



## JimmyM (Jan 31, 2014)

IMPORTANT NOTICE:
Due to a change in Verizon's service, my support site that hosts the software for my regulators is going away.
Get it while it's hot. I'll try to figure out another solution at some point.
Here's the link... http://mysite.verizon.net/jminihane/index.html
However, another astute CPFer had the idea to post the links here...
How to Load Firmware on your PhD-X1: Link

Firmware:
Rev1a: Link Rev1b: Link

Rev2a: Link

Connection Diagrams:
Wiring Connections and Board Features: Link
Basic connection: Link
Basic slightly modified: Link
Remote Power section diagram: Link
Auxiliary PWM connection Diagram LED: Link
Auxiliary PWM connection Diagram Relay: Link

Voltage and Current Chart for the Q4559X bulb: Link
Voltage and Current Chart for the GE 4557 bulb: Link

Calibration Factors for each regulator can be found here: Link
The Calibration Factor is specific to each regualtor and MUST be applied to your firmware "options" C file before you compile and reprogram your regulator. Otherwise, your output voltages will not coorespond to your settings.


----------

