PWM Regulator-Mag D, JM-PhD-D1, UPDATE

Candle Power Flashlight Forum

Help Support CPF:

Jimmy, I wasn't complaining, I was just providing feedback in case it would help you. I like your regulator so much, I'm about to order 2 more. I will put specs in the paypal message.
 
Thank you sir! Great improvements. I want to get 4 more of these.

"It's Gold, Jerry. Gold!"
 
Last edited:
Jimmy, I wasn't complaining, I was just providing feedback in case it would help you. I like your regulator so much, I'm about to order 2 more. I will put specs in the paypal message.
I didn't mean to sound terse. Not at all. I just want to support my customers they way I'd like to be supported after a sale. I want to provide a quality product. If there is indeed something amiss. I will make it right.
 
I have one of each, 189 and 289. The 189 is smaller, lighter, and does the AC+DC as good as the 289, so you are not missing anything with the 187/189 😉
Bragger! 🙂. There's no debating that the 189 is super capable. But the 287/289 is just so cool. QVGA screen.:naughty:
 
Hi

Further testing now with 2 setups and I think the over-read is probably measurement error and everything is working as designed.

My problem is probably that the 10Hr LuxLuthor point may be a bit too close after all and I have tried the 64625 at the 20Hr 13.00V setting and all is fine.

I didn't think I had been using my 6xA123s that much in this testing, but time flies you know . . . and JM's trusty LowBatt warning kicked in spot on 17.4V as set, which was a great event in my life - saved a cell too as while 5 were at 3.21V, one was at the edge on 2.68V - Perfect Catch :thumbsup:

Thanks Jimmy

Anybody else with settings tested ? please post your results.

Cheers
Pete

ps.
The Fluke 189 I bought when I first got a PIR1 has been totally brilliant by the way - TrueRMS AC+DC - Duty Cycle and I used to think that for simple Voltage and Resistance measurements a $20 meter was fine. No.

Having used the Fluke 189 next to one there is no comparison.

The Fluke showed an Open-Circuit as metered on ElCheapo to actually be a few millon Ohm and this was enough to just light an LED with the microAmps that were flowing.
 
I have also noticed that my 189 reads high momentarily as the regulator ramps up. This is with different code than Jim's, and this code does not overshoot, so I suspect it is a characteristic of the way the meter reads. It settles down to the right value right away, just one or maybe two readings a bit higher.
 
I have also noticed that my 189 reads high momentarily as the regulator ramps up. This is with different code than Jim's, and this code does not overshoot, so I suspect it is a characteristic of the way the meter reads. It settles down to the right value right away, just one or maybe two readings a bit higher.
I've sent petrev a slightly updated firmware for testing which prevents any overshoot other than the +1 pwm count as part of regulation.
This is included in the new firmware that will go out.
I'm also going to work out an "S"-curve soft start.
 
I have also noticed that my 189 reads high momentarily as the regulator ramps up. This is with different code than Jim's, and this code does not overshoot, so I suspect it is a characteristic of the way the meter reads. It settles down to the right value right away, just one or maybe two readings a bit higher.

Hi Alan

Thanks for that confirmation.

Seems like the poor Fluke is seeing some part of the waveform and giving a more instantanious estimate rather than a true reading. The Fluke does a brilliant job of trying to interpret what is happening but it can't get it right every time when things are happening so fast - 😱 - Sampling at just the wrong time is my guess.

I think my problem was starting right at the bleeding edge. Having backed a little away from the visual cliff I can see the bright new vista stretching out ahead . . . too mix a few metaphores :thinking:

Cheers
Pete

ps New software loaded really nicely thanks to JM's guidance

(PhD +AVRISP-II +Studio +WINAVR +little Switch and some wire = Happiness)
 
My problem is probably that the 10Hr LuxLuthor point may be a bit too close after all and I have tried the 64625 at the 20Hr 13.00V setting and all is fine.

Please keep in mind that part two of my intended destructive testing was to verify Lux & actual survival at projected Life that was taken from AWR Hotrater which is not that useful without verification. I would look at my Bulb Life projections, as "better than nothing."

I think you are better using a % OD between default Vbulb and my Vflashed level, taking into account the advertised Life @ spec, and the range between default & flash voltage. I'm sure there could be another Excel display to present this.

For example, the Phiips 5761 (100 Hrs) has a very narrow, delicate tolerance for OD, and the Osram 64458 & IRC's (4,000 Hrs) are beasts.
 
Lux, do we need to build an automated test setup to do life testing? Something that would chart output and run the bulb through some cycle under computer control? Perhaps that old computer could be set up to do that? Is your power supply capable of omputer control? If not we could make a serially controlled PWM switch from one of the regulators and just allow the computer to turn the bulb off and soft start it with the power supply set to a fixed voltage. Then a serial readout light meter and a program for the computer would complete it. Then a bulb life test would take a day or so.
 
Alan, I did it for a small number of bulbs (like 5 or 6)....just enough to realize what a time consuming pain in the bumpkiss it is. With a couple of the bulbs, their output (from fatigue) dropped to about 40% of starting Lux about halfway through the projected life from spreadsheet, and failed at 125% (longer than predicted).

When I saw that huge drop off, that became a whole other factor that I had not anticipated, and for practical purposes the rest of the bulb's life was nearly worthless. I repeated it with another bulb to make sure it was not a spurious result (alas, it was reproduced). Then I had to repeat the process at a lower OD voltage...trying to find the sweet spot of ideal OD Lux vs. Life.

Keeping an eye on the bulb (never knowing when it would flash), taking lux measurements, keeping track of logged life, not to mention the cost of 2-3 more bulbs per listing (after the 2-3 already destroyed)...and the hours involved....it stopped being a fun project, so I gave up on part two.
 
Fair enough. A computer setup could help by cycling the power and reading the light output. The tests could be terminated when the light output has dropped by some set factor. But the cost of the bulbs remains. Plus the cost of a computer output light meter and a serial controlled power supply or PWM switch, plus effort in some custom software.

Probably too expensive.
 
Hi

All Lovely and Hunky Dory

:twothumbs

Jim spent 24hours sorting me out.

I was trying to get straight to the max point and after a few firmware updates we are there now.

Regulators are rock steady at their set points.
Softstart rise is softened a bit and there is no chance of overshoot.

Jim is working on even better functions for soft start and sampling as I understand it ? ? ?

Upgrading firmware is an absolute doddle with WINAVR and AVR-Studio and Jim's help.

Updated FULL version 1.4
with LL notes added
and extra pics (2)
HowToLoadYourPhD1.4FullPics.pdf

Single Page Version 1.4
HowToLoadYourPhD1.4SinglePage.pdf

Edit: New Updated

Full (more Pics)
and extra Links
HowToLoadYourPhD1.61FullPics.pdf

1 Page QuickGuide
HowToLoadYourPhD1.6SinglePage.pdf


v1.6
How to: Load New Software to your PhD

Requires Atmel AVRISP-mkII - (Hardware inc. AVR-Studio 4 and USB driver)
Install
AVRStudio - Install USB Driver during AVRStudio install
Only after AVRStudio is installed should you Plug AVRISP-mkII to USB cable
.
To compile your code, you need WinAVR.
WinAVR can be found here
http://sourceforge.net/project/showfiles.php?group_id=68108
Download and install it. I just put the install folder in the root of my C drive - this is the default.
When given the option, let it add entries to your windows PATH.
Then, when you start AVRStudio it will find the WinAVR directory.
.
Create a new Windows ProjectFolder for your new PhD project.
Download Updated RegulatorSource.c file from JimmyM, AlanB, wquilles (etc?)
Copy to your ProjectFolder
.
Plug - Connect AVRISP-mkII to computer connected USB cable.
.
Run AVRStudio ( Version Used – AVR-Studio 4.16)
First Run – With AVRISP connected should detect any AVRISP Firmware updates required and you can install update.
Welcome Screen Opens –
- Click New Project (subsequent re-programming - select Recent Project from list – Click Next)
Create New Project Panel –
- Select "AVR GCC" and Give your project a ProjectName. – Un-Tick :- Create Initial File Box
- Set the Location: to the ProjectFolder you created.
- Click Next.
Select Debug Platform and Device Panel –
- Select AVR Simulator
- Select the ATtiny44 (JM-PhD) or ATtiny45 (AlanB-PhD) in the right hand pane.
- Click Finish.
AVR-Studio - Project Window Loads
- AVR-GCC Navigation (left window) Right-Click "Source files" Folder and select Add Existing Source file.
- Select your RegulatorSource.c file.
- Double Click the RegulatorSource.c file in the "Source Files" to open up the code editor window.
.
Plug – Connect AVRISP-mkII to computer connected USB cable if not already attached.
.
Upgrade AVRISP Firmware (if not already done)
From the main menu at the top, select Tools ->Program AVR ->Connect.
In the Connect window select the AVRISP mkII, the Port should be USB.
After you click Connect another window will appear.
In the HW Settings Tab, click Upgrade at the bottom.
Another window will appear.
Click Start Upgrade. Little LEDs Flash . . .When Prompted : Remove and Re-Connect USB to AVRISP-mkII
.
Connect PhD via ribbon cable and then power-up PhD (Never connect/disconnect ribbon cable with power applied)
.
Compile
- Make Changes (eg. User Options) to the source code file (RegulatorSource.c) in the code editor window

- Save Changes - File >Save (or Control-S) - Compile the program with Build >Build
- Review the messages in the Build window for errors and warnings
- If anything needs fixing return to the Make Changes step

Electronic Connect
- Bring up the Programmer with Tools >Program AVR >Auto Connect or the AVR Button
On the Main Tab (the first time, does not need to be done each time unless programming multiple PhD versions)
- ensure ATtiny44 (JM-PhD) or ATtiny45(AlanB-PhD) is selected
- ensure ISP Mode is selected
- under Settings ISP Frequency default should be 125 khz
- click "Read Signature" to verify the connection to the target board
Upload Program
- On the Program Tab; in the ELF sub-window,
- select the input ELF file (eg. ../Default/ProjectName.elf - required first time only)
- click the ELF > Program button to program the PhD !!!!!

- review the log messages - if there are errors
-- ensure CPU type is the same in both Project Configuration and in the Programmer-Main Tab
.
Remove Power from the PhD and then remove ribbon cable – Reassemble your Super Regulated-Mag. e&oe

Cheers
Pete

ps. Feel free to copy .pdf to your server and link guide if you want to.
Should be the same method for other PhDs as far as I know ? ? ?
 
Last edited:
Jim and Pete, this is nicely done. Can I use some of it in my documentation? It has been so long since I set this stuff up it is hard to remember what needs doing.

As I recall the above procedure does not load software into the regulator. It upgrades the AVR ISP with new code from Atmel. There are a couple more steps to load code into the AVR CPU.

However all the steps above need to be done just the first time. After that just the last few (missing) steps are done to load the code into the regulator.
 
Last edited:
Hi Alan

This was the method I used and it seems to work.
What are the missing steps . . .

Cheers
Pete
 
Last edited:
I don't see where the C program was compiled to produce the binary. Nor where the binary was selected and loaded to the target AVR in the regulator. The Upgrade button upgrades the AVR ISP programmer itself (as I recall). It doesn't load code to the target AVR.

Perhaps there are some changes in the newer program, my version is a little older than present ones.
 
I don't see where the C program was compiled to produce the binary. Nor where the binary was selected and loaded to the target AVR in the regulator. The Upgrade button upgrades the AVR ISP programmer itself (as I recall). It doesn't load code to the target AVR.

Perhaps there are some changes in the newer program, my version is a little older than present ones.

Hi Alan

You could be right there ?

Just tried without a PhD attached and it went through the cycle as before . . .

How strange as before doing this my PhD was Instaflashing and now it isn't ? ? ? ?

Let me know if/what steps need adding ?

Cheers
Pete

ps. When I first attached my AVRISP the Studio prog it alerted me to a Firmware update and loaded it at that time - the above Update seems to be an automatic method for update of the ISP-attached board - but I am less than an expert . . .
 
Last edited:
Back
Top