[retired] [WIP] 20mm single sided & 17mm double-sided ?-amp linear driver - surprisingly good!

Yeah I was just thinking about the star/pin needing to be grounded. I’ll try that after dinner tonight.

My mistake, I should have known better. I got confused.

Probably nothing but should you have both of these lines commented out?

//#define FAST_PWM_START 255 // Above what output level should we switch from phase correct to fast-PWM?
//#define DUAL_PWM_START 8 // Above what output level should we switch from the alternate PWM output to both PWM outputs? Comment out to disable alternate PWM output

That’s all I saw that looked odd to me. But I’m not the one to ask on these things. Wight, RMM or ToyKeeper , by the way, where’s Comfy?

I don’t have that exact line of code, I have this:

It’s not a big deal to me, I would only use 4-modes anyways

I think they technically should be, but AVRStudio won’t compile it if both are commented out.

As I said before, it’s much easier to work with the older version since you don’t use either of the dual PWM features here.

I also had trouble understanding the code you quoted pilotdog68. I posted about it in post #769 over here: STAR Firmware by JonnyC - Source Code and Explanation

EDIT: so if you go to that post and read the code comments in the example code I posted it should be more easy to understand what that very strangely formatted section of code does. The intention is to allow DUAL_PWM_START to force MOON_MODE on. We need to do that since we can’t turn PWM on with the star because we’re using that star for the secondary PWM output! BUT if someone has commented out MOON_MODE it still won’t get turned on. That’s the intention of that convoluted thing.

In the end, you still just make the same change.

Ah. Makes sense.
Nevertheless, before I read your post I was already working on it using the old version of STAR. Here is my final revison.
All five modes work. The lowest firefly is basically just a novelty, but the other modes are spaced nicely. The PWM is still a bit audible, but it’s faint enough that I’m not sure you would hear it at all once it is inside a light. The only other issue is that some people would prefer the OTC setting be a little faster, it’s about 3 seconds right now.
…………………………
I don’t have a light to put this in yet, so it’ll probably just go in my tacklebox while I try some of your other designs. I think I’m going to try the 12mm dual-pwm fet driver next.

I’m wondering if the driver modes would still work at the slightly higher 2.4khz or 4.7khz pwm frequencies ( using the 9.6Mhz clock combined with Phase correct / fast and 8x divider combinations)

If you’re up for testing that before you pop this thing in the tackle box that would be awesome! :slight_smile:

I’ve been playing around a bit with the 1khz pwm on other drivers and it’s bugging me a bit too much to consider putting it in a light. Visually annoying rather than the sound.

Well I just realized my Supfire L5 will fit a 20mm driver, so this one will remain on my desk a bit longer.

I can try it, but I’m not sure I follow what you mean. What settings do you want me to change?

edit: are you talking about changing the low fuse to “0x6a” ?

I’d double check to make sure your firefly mode works on depleted cells. It would be disappointing to try whipping that out to show off to someone and have the LED not light at all.

I’ve been thinking that putting in a hidden firefly mode would be best. That way there is no annoying basically-fully-off mode plunked into your rotation, but you can still bring out firefly to impress folks. With a hidden moon mode (like TheSTAR has) I’d think putting firefly right after moon would be good.

I find 3 seconds totally unacceptable. If cranking it to 250 or so doesn’t get it to around 0.5s I’d consider adding a pulldown resistor stacked on the OTC. LinusHofmann ran into a similar problem and stacked a 220kOhm resistor.

Higher freqs will just compress the modes higher. Notice that the current range of modes is ~40-255. Doubling the freq will compress the modes higher, something like 80-255 for example (I don’t know exactly how much upwards compression to expect).

This is all a function of FET selection. An FET with more ideal properties for this driver would function at higher freq. DTU30N02 does.

I think I’m getting the hang of this. I got STAR momentary working on the first try. Here it is.
I would still prefer direct access to ‘off’, so tomorrow I think I’ll try some of toykeepers versions.

Sweet, nothing like a little practice.

Don’t forget that Tom E’s version is also popular.

Yes

I believe for…

2.4khz pwm: Low fuse is set to 0x65 and using Fast PWM in firmware OR Low fuse is set to 0x6a and using Phase Correct PWM in the firmware
4.7khz pwm: Low fuse is set to 0x6a and using Fast PWM in firmware.

Going by the table posted here

Ok I tried flashing the exact same momentary configuration as I posted earlier, but this time I used 0x6a for the low fuse.
My eyes may be deceiving me, but every mode seems brighter. I know for sure that the 37pwm mode that was a firefly, is now 5-10x brighter than before. It is too bright to be used as a moon mode. I’ll keep playing with it to see how low i can take the pwm.

edit:
after doing the simple “wave paper in front of the light” test, the PWM with this fuse setting is actually much slower than with the 0x75 fuse. Comparing the original (0x75 fuse) vs the PZL driver I just built using the standard Fast PWM, the PZL Pwm is roughly 2 times faster (to my eye, take with a grain of salt)

You probably did not change the :8 we set earlier, so maybe you have a total of :64 right now? I’m on my phone, not easy to consult charts etc. There are 4 factors which affect freq: CPU clock, divider, presenter, and PWM type.

I honestly still have no idea how those relate. I can only report what I’ve found. I used the same momentary build I linked in post #151, and then changed the fuse value in the avrdude command.

Now that I have a momentary FW that I like (thanks wight and toykeeper), I’ll be putting this in my L5 (hopefully tonight). I’ll measure and report parasitic drain and if it’s pulling the current that it should.

No worries, I’ll do that testing myself when my boards get here. Thanks for giving it a go anyway.

Heh, phone autocorrected to ‘presenter’ but I meant prescaler.