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

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.

Did I misunderstand what you wanted me to try? According to that table, 0x6a and a :8 divider with phase corrected should result in 2.4khz?

Or did i need to bump the chip frequency too?

I’ve been confusing you by referring to the divider and prescaler interchangeably. They are two separate things! The divider in that chart is set with fuses. That is the only divider there is.

The thing I had you adjust earlier (by setting the 0x02) is the prescaler. With both set your total is :64, not :8.

LinusHofmann wanted you to try:
4.8Mhz
:1 prescaler
:8 divider (0x65 fuse)
FastPWM

…which gives 2.4Khz. If you set the prescaler to :8 instead of :1 you get 300Hz (0.3Khz).

Yep, this is all your fault :wink:

So is 4.8Mhz default, or do I need to change something to get that? The rest of it I can manage.

I think that’s set with the other fuse, IIRC. You shouldn’t need to change anything for 4.8Mhz.

Alright I tried it with the settings wight outlined (this program, with 0x65 fuse)
Wights predictions appear to be correct. The second mode (64pwm) appears to be equal to what 37pwm was before, that is a very low firefly mode. The visible PWM is also noticeably faster to the naked eye.
……………
Are there any other drawbacks to keeping it this way other than the mode compression?

Not that I’m aware of.

Cool, thanks for doing the test. I may be able to live with 2.4khz and the reduced pwm range.

Got my OSHpark boards today but while laying out the parts to build one I realized that I’m still waiting on the QX7136s. :frowning:

Maybe I’m not thinking correctly, but in my mind while the pwm range is reduced, but the light output range is not. We still have sub-lumen lows and full on, we just have less notches in between. I feel like 191 notches is still plenty to find what mode levels you want.
………
I’m using 2.4khz myself. Coincedentally, there are also fewer modifications needed to have STAR work on this driver than using the previous way.

I think you’re right, beyond limiting ramping smoothness and just being a bit less intuitive to set up the modes I think that will work fine.

There might be some efficiency losses perhaps?

If you’re not fed up with firmware tinkering, you could change the low fuse to 0x6a and flash it again with the same firmware.
I believe that should up the CPU speed and change the pwm frequency to 4.7khz.

If I understand the chart posted by HarleyQuinn correctly, the CPU frequency is primarily changed by the low fuse bit: i.e (0x*5) for 4.8Mhz and (0x*a) for 9.6Mhz.

Not sure if the firmware will play nice without also changing “#define F_CPU” to match the new frequency though.

Really wish I could be playing with this stuff myself. Also keen to scope the fet output and see how it looks/responds at the different PWM frequences.

Cheers

I normally would love to tinker some more, but unfortunately I packed it into a light already and would prefer to not take it out (it was a tight fit). I hope to post pictures of my build tonight.