New DIY dynamo light project

For discussions about bikes and equipment.
edocaster
Posts: 565
Joined: 10 Apr 2013, 10:43pm

Re: New DIY dynamo light project

Post by edocaster »

Solocle wrote: 7 Jan 2025, 9:15am
lucasdupuis32 wrote: 30 Oct 2024, 9:32pm
edocaster wrote: 30 Oct 2024, 12:09pm If I understand the last example correctly, it enables an IC to supply current to the load while charging the battery, and the battery to supply current to the load if the input falls. If so, that sounds like a good candidate for a dynamo USB charging system, as the variability of the source compared to what a USB load wants is a frequent cause of issues. Possibly overkill for a bike standlight, but certainly worth investigating.
I don't really see it as overkill. It would definitely solve the low speed issues AND add a standlight feature. Another feature of this IC is that it can combine its input voltage (rectified dynamo output) with the battery to give more power to the LED.
I live in a very hilly area and my commute consists of a 14% climb of a few hundred meters. This is why I'm so obsessed with (very) low speed performance.

The only issue is that no one sells a PCB or a breakout board of this IC, so I'm gonna have to make my own.
I'm looking at it from a slightly different standpoint, in terms of doing a USB charger, but the MPS2722 has a similar feature about sourcing the system load. The attraction there is it supports DRP USB-C signalling, so only one USB port needed. I want to be able to charge the internal battery off the wall like a power bank, then have the dynamo trying to keep things topped up.

I think combined with an AC/DC converter circuit for the dynamo, then I need to figure out where to attach the dynamo output, but failing anything else the VBUS USB pin will work fine, I'd just need some network to signal that power was available.
All sounds very interesting. I wonder how lucasdupuis32's plans have shaped up? Even with the Pilom circuit being practically ready-made, it can still take a long time to go from proven concept to finished version. But going to an entirely new concept will be even more of a challenge.

For your own plan, the challenge will be getting practical power through to the USB charger that is controllable (i.e. accounts for the variable nature of the source)
lucasdupuis32
Posts: 17
Joined: 5 Sep 2024, 11:56pm

Re: New DIY dynamo light project

Post by lucasdupuis32 »

I paused the project since I'm going through my exam session at university :D

I think I found the chip I need, which is the BQ24073 https://www.ti.com/lit/ds/symlink/bq240 ... er.io%252F made by Texas Instruments. Sadly it's only available in a QFN package which is quite annoying since I can't just use a breadboard for prototyping. Next step is designing a breakout board PCB and have it assembled by JLCPB using their SMT assembly service.

I'll have to add a DC-DC converter in between the rectified dynamo output and the BQ24073 since it needs a constant voltage to operate properly.

I found a manufacturer that produces small cylindrical LiPo cells which would perfectly fit in the enclosure. These cells offer high discharge rates which is needed if I want the cell to be able to power the LED on its own https://www.lithium-polymer-battery.net ... battery-2/. These cells are 3.7V nominal so I plan to use a LED driver to boost the voltage and limit the current.

I still need to figure out a way to test the setup properly. Spinning the wheel with a drill is way too troublesome : I can't reach high speeds and it's very difficult to achieve a constant speed while taking measurements.

This is going to take a lot of time and I'm not sure if it'll work so I will also try to replace the Cree XHP35 LED with a less powerful one, which might remove the flickering at very low speeds.
edocaster
Posts: 565
Joined: 10 Apr 2013, 10:43pm

Re: New DIY dynamo light project

Post by edocaster »

lucasdupuis32 wrote: 9 Jan 2025, 4:02pm
I'll have to add a DC-DC converter in between the rectified dynamo output and the BQ24073 since it needs a constant voltage to operate properly.
The output of the chip looks like around 4.4V, and operational input is '4.35 V to 6.6 V'. It does seem optimised for li-ion battery charging, and all the extra complexity is to also allow a power path to a load. But do you need that? Presumably you'll be using a boost converter to get the li-ion back up to 12V for the XHP35 LED. That's necessary. But when powering the LED in motion I don't see the advantage of going through the chip (buck from whatever to 4.4V, and then boost back up to 12V). If you only need a chip to charge the battery, there are many far simpler ones.

If you place everything after the chip (standlight charger and main light), you'll then have to roll your own solution to maximum peak power - as you'll no longer be presenting a 12V LED (or equivalent series of LEDs) to the dynamo (which is the trick to extracting higher power without a more complex way of controlling the impedance). In other words, instead, the dynamo will see whatever DC-DC converter you present to it, and unless you can control its duty cycle, it may end up sliding towards a low or too high voltage.
lucasdupuis32
Posts: 17
Joined: 5 Sep 2024, 11:56pm

Re: New DIY dynamo light project

Post by lucasdupuis32 »

It does seem optimised for li-ion battery charging
Li-ion and LiPo have the same charging protocols. I couldn't find any Li-ion cells that would fit in such a small enclosure while having a high discharge rate.
But do you need that?
The chip can supply power to the LED from both the source (dynamo) and the cell, when the source power is too low. This is the feature I was looking for since it could solve the low speed issue.
If you place everything after the chip (standlight charger and main light), you'll then have to roll your own solution to maximum peak power - as you'll no longer be presenting a 12V LED (or equivalent series of LEDs) to the dynamo (which is the trick to extracting higher power without a more complex way of controlling the impedance). In other words, instead, the dynamo will see whatever DC-DC converter you present to it, and unless you can control its duty cycle, it may end up sliding towards a low or too high voltage.
Indeed, that's the main reason I have doubts about this idea.
edocaster
Posts: 565
Joined: 10 Apr 2013, 10:43pm

Re: New DIY dynamo light project

Post by edocaster »

lucasdupuis32 wrote: 14 Jan 2025, 7:56am Li-ion and LiPo have the same charging protocols. I couldn't find any Li-ion cells that would fit in such a small enclosure while having a high discharge rate.
My mistake. I never noticed the difference between Li-ion and Li-Po. But, like you say, not a major difference.

For using a DC-DC converter to feed a charger, I found it worked fine (using the L6902D in my case) if it didn't hog the available current from the dynamo. By setting a current limit that's low enough, that allowed the input voltage to rise high enough to operate the 12V LED in parallel to the DC-DC converter. So, keeping the main light in parallel to the DC-DC converter (and hence charger) will preserve the diode characteristics that the Pilom lights rely on.

The way I see it, you either keep the 12V LED fed directly after rectification, keeping the core of the circuit to the Pilom approach and, in parallel, use a DC-DC converter to feed the charger circuit, which then upconverts back to 12V as a standlight. Or you abandon the Pilom approach and have a bespoke buck converter to feed both the charger and a 3V LED - bespoke in the sense that it avoids presenting a low impedance to the dynamo until the voltage is high enough...
Cyclothesist
Posts: 1139
Joined: 7 Oct 2023, 11:34am
Location: Scotland

Re: New DIY dynamo light project

Post by Cyclothesist »

edocaster wrote: 14 Jan 2025, 2:52pm
lucasdupuis32 wrote: 14 Jan 2025, 7:56am Li-ion and LiPo have the same charging protocols. I couldn't find any Li-ion cells that would fit in such a small enclosure while having a high discharge rate.
My mistake. I never noticed the difference between Li-ion and Li-Po. But, like you say, not a major difference.

For using a DC-DC converter to feed a charger, I found it worked fine (using the L6902D in my case) if it didn't hog the available current from the dynamo. By setting a current limit that's low enough, that allowed the input voltage to rise high enough to operate the 12V LED in parallel to the DC-DC converter. So, keeping the main light in parallel to the DC-DC converter (and hence charger) will preserve the diode characteristics that the Pilom lights rely on.

The way I see it, you either keep the 12V LED fed directly after rectification, keeping the core of the circuit to the Pilom approach and, in parallel, use a DC-DC converter to feed the charger circuit, which then upconverts back to 12V as a standlight. Or you abandon the Pilom approach and have a bespoke buck converter to feed both the charger and a 3V LED - bespoke in the sense that it avoids presenting a low impedance to the dynamo until the voltage is high enough...
Or you could keep the Pilom circuit for the main light but add in another smaller LED for the standlight powered by a small Li ion battery. A simple 4.2v voltage regulator (a zener diode/single transistor circuit would be enough) to charge the battery from the rectified dynamo output. Employ a simple transistor circuit to switch on the standlight when the dynamo output falls below a threshold.
Solocle
Posts: 8
Joined: 17 Jun 2022, 9:33pm

Re: New DIY dynamo light project

Post by Solocle »

lucasdupuis32 wrote: 9 Jan 2025, 4:02pm I paused the project since I'm going through my exam session at university :D

I think I found the chip I need, which is the BQ24073 https://www.ti.com/lit/ds/symlink/bq240 ... er.io%252F made by Texas Instruments. Sadly it's only available in a QFN package which is quite annoying since I can't just use a breadboard for prototyping. Next step is designing a breakout board PCB and have it assembled by JLCPB using their SMT assembly service.

I'll have to add a DC-DC converter in between the rectified dynamo output and the BQ24073 since it needs a constant voltage to operate properly.

I found a manufacturer that produces small cylindrical LiPo cells which would perfectly fit in the enclosure. These cells offer high discharge rates which is needed if I want the cell to be able to power the LED on its own https://www.lithium-polymer-battery.net ... battery-2/. These cells are 3.7V nominal so I plan to use a LED driver to boost the voltage and limit the current.

I still need to figure out a way to test the setup properly. Spinning the wheel with a drill is way too troublesome : I can't reach high speeds and it's very difficult to achieve a constant speed while taking measurements.

This is going to take a lot of time and I'm not sure if it'll work so I will also try to replace the Cree XHP35 LED with a less powerful one, which might remove the flickering at very low speeds.
I've found a cheap power supply and will source a small DC motor for that, I'm not too fussed about constant speed, only knowing what it is (and I've verified the speed sensor principle in the past, so can use my circuit for that part). But you could use PID control too.

For rectification and efficiency, totem pole active PFC might be worth a look - https://www.ti.com/lit/an/sluaau2/sluaa ... 8660075843
As for where I'm up to? Some development kits.
Image
Cyclothesist
Posts: 1139
Joined: 7 Oct 2023, 11:34am
Location: Scotland

Re: New DIY dynamo light project

Post by Cyclothesist »

That's quite a project for a bike light!
edocaster
Posts: 565
Joined: 10 Apr 2013, 10:43pm

Re: New DIY dynamo light project

Post by edocaster »

Indeed. That's quite a lot of stuff!

I'm guessing the power supply and DC motor is to build a testing rig?

Regarding rectification, I've heard of a few attempts to use alternatives to a diode bridge. Not low hanging fruit, that's for sure. Some bike dynamo versions don't rely on ICs, but still need a diode or have to forego a smoothing capacitor: https://www.ktverkko.fi/~msmakela/elect ... ex.en.html

Active PFC there's some reading here which might help a relative novice like me - I don't understand the half of it though: https://www.planetanalog.com/650-v-sic- ... perfectly/

And more here: https://www.monolithicpower.com/en/lear ... correction

What is the advantage? I understand avoiding the voltage drop of a diode bridge, but what does active PFC do in a bike dynamo context? Will it really be more efficient (i.e. what losses are being reduced? Wires from the hub to the device? In the generator itself?).
Solocle
Posts: 8
Joined: 17 Jun 2022, 9:33pm

Re: New DIY dynamo light project

Post by Solocle »

edocaster wrote: 5 Feb 2025, 12:26pm Indeed. That's quite a lot of stuff!

I'm guessing the power supply and DC motor is to build a testing rig?

Regarding rectification, I've heard of a few attempts to use alternatives to a diode bridge. Not low hanging fruit, that's for sure. Some bike dynamo versions don't rely on ICs, but still need a diode or have to forego a smoothing capacitor: https://www.ktverkko.fi/~msmakela/elect ... ex.en.html

Active PFC there's some reading here which might help a relative novice like me - I don't understand the half of it though: https://www.planetanalog.com/650-v-sic- ... perfectly/

And more here: https://www.monolithicpower.com/en/lear ... correction

What is the advantage? I understand avoiding the voltage drop of a diode bridge, but what does active PFC do in a bike dynamo context? Will it really be more efficient (i.e. what losses are being reduced? Wires from the hub to the device? In the generator itself?).
Yeah, power supply and DC motor are to spin up the testing dynamo I got for this purpose. I was initially devising a Class D amplifier for that purpose, but... why have to debug a testing rig when spinning is a good trick?
Image

In terms of PFC, I'm not sure what the effects will be, but I want to try it. My suspicion is that by lining up the voltage and current waveforms, you could extract more real power from the dynamo. Plus it seems to be a fairly cheap addition once you're using a MOSFET active rectifier and a DC-DC converter, and already have a microcontroller.
An STM presentation
Totem pole seems to completely kill any need for a diode drop, and thus maximise efficiency, but the active bridge topology could be a good start too.
Image
Then again, it's something you can modularise in the design, as everything else won't care how the AC is converted to DC.
gat
Posts: 18
Joined: 24 Sep 2023, 9:34am

Re: New DIY dynamo light project

Post by gat »

Thanks for the PFC links above, very useful. A parallel between direct-conversion mains power supplies and bike lighting seemed at first to me far-fetched, but it makes sense. I then realised that I have already built a version of the left-hand circuit above, except diodes for rectification and no separate inductor. It uses the dynamo's own inductance, so no "continuous conduction".

> My suspicion is that by lining up the voltage and current waveforms, you could extract more real power from the dynamo.

Provably correct, assuming that the dynamo can be accurately modelled as a voltage source, inductance and resistance in series. Maximum power when the instantaneous current equals the open circuit voltage (EMF) divided by twice the internal resistance. But then the efficiency is less than 50%, so probably only good at low speed.

A simple simulation with some plausible parameters for a Shimano NX30 hub shows maximum power output 25.6W at 25kph. Not bad for a gadget rated as 3W! But then the smoothing capacitor must reach at least 236V and peak current is 5.2A. I imagine that would cause magnetic saturation and possibly even demagnetise the "permanent" magnets, so not physically plausible.

The "totem-pole" naming is new to me. The right-hand diagram looks like an H-bridge for motor control, energy flow reversed. If I do another one, that design will be used. It should get close to maximum output at low speed.
Solocle
Posts: 8
Joined: 17 Jun 2022, 9:33pm

Re: New DIY dynamo light project

Post by Solocle »

gat wrote: 10 Feb 2025, 8:53pm Thanks for the PFC links above, very useful. A parallel between direct-conversion mains power supplies and bike lighting seemed at first to me far-fetched, but it makes sense. I then realised that I have already built a version of the left-hand circuit above, except diodes for rectification and no separate inductor. It uses the dynamo's own inductance, so no "continuous conduction".

> My suspicion is that by lining up the voltage and current waveforms, you could extract more real power from the dynamo.

Provably correct, assuming that the dynamo can be accurately modelled as a voltage source, inductance and resistance in series. Maximum power when the instantaneous current equals the open circuit voltage (EMF) divided by twice the internal resistance. But then the efficiency is less than 50%, so probably only good at low speed.

A simple simulation with some plausible parameters for a Shimano NX30 hub shows maximum power output 25.6W at 25kph. Not bad for a gadget rated as 3W! But then the smoothing capacitor must reach at least 236V and peak current is 5.2A. I imagine that would cause magnetic saturation and possibly even demagnetise the "permanent" magnets, so not physically plausible.

The "totem-pole" naming is new to me. The right-hand diagram looks like an H-bridge for motor control, energy flow reversed. If I do another one, that design will be used. It should get close to maximum output at low speed.
Interesting; given I did an electromagnetism module in my degree, and I work as a software engineer in the electronics manufacturing industry, I should really know more about this! H bridges are certainly familiar though.

Of course once you have active PFC you can achieve values other than 0.99... thus you can limit the power sanely.

I have to admit that I find the details with switching converters and predicting their performance somewhat bamboozling, but the test rig is coming on nicely.
Image
Solocle
Posts: 8
Joined: 17 Jun 2022, 9:33pm

Re: New DIY dynamo light project

Post by Solocle »

More thoughts, this is the model I've initally been using, and is actually pretty sane:
Image
5.5 km/h with no load, 4.5V.

In terms of topology, switching the inductor on the dynamo is clever, it seems to me to force a boost topology. Actually a good default topology for low speeds and bootstrapping.

At higher speeds you need either a very low resistance to keep that voltage down (bad efficiency), or present a higher resistance and then buck convert, or use it as part of a Cuk.
Image
gat
Posts: 18
Joined: 24 Sep 2023, 9:34am

Re: New DIY dynamo light project

Post by gat »

Yes, the internal inductance is only good for boosting, as the other end of the notional inductor is inaccessible (it does not exist!). But for best performance you need to be making a relatively high voltage to stop current flow spilling into the next half-cycle.

"5.5 km/h with no load, 4.5V"

In simulation I have 5.8939V (peak) at 5.5kph (9.7 Hz), so that looks close. But I also add some harmonics (H3=-0.35 H5=0.14) to that, to match the observed wave shape. I have 120mH and 4 ohms in series that will strangle the output more. The numbers came from a student project report, no longer accessible. For 3W into the standard 12 ohms it needs 21 kph, but the German standard says 15. So these output figures look low.

Once the test rig is working, you should get your own numbers. I found inductance and resistance a bit tricky to measure. Electonic multimeters sometimes give up when they are combined.

I guess the circuit above would normally have a capacitor in the gap. Or am I seeing a browser glitch? But then the graph should be different with a capacitor.

I was a little surprised to see a current source and parallel inductor in the dynamo. It seems to me that a series connection of voltage source, inductance and resistance better models the reality: a single piece of wire. A thought experiment: cut the wire in the middle to make a dual-output dynamo. What does that do to the model?
Solocle
Posts: 8
Joined: 17 Jun 2022, 9:33pm

Re: New DIY dynamo light project

Post by Solocle »

gat wrote: 4 Mar 2025, 9:17am Yes, the internal inductance is only good for boosting, as the other end of the notional inductor is inaccessible (it does not exist!). But for best performance you need to be making a relatively high voltage to stop current flow spilling into the next half-cycle.

"5.5 km/h with no load, 4.5V"

In simulation I have 5.8939V (peak) at 5.5kph (9.7 Hz), so that looks close. But I also add some harmonics (H3=-0.35 H5=0.14) to that, to match the observed wave shape. I have 120mH and 4 ohms in series that will strangle the output more. The numbers came from a student project report, no longer accessible. For 3W into the standard 12 ohms it needs 21 kph, but the German standard says 15. So these output figures look low.

Once the test rig is working, you should get your own numbers. I found inductance and resistance a bit tricky to measure. Electonic multimeters sometimes give up when they are combined.

I guess the circuit above would normally have a capacitor in the gap. Or am I seeing a browser glitch? But then the graph should be different with a capacitor.

I was a little surprised to see a current source and parallel inductor in the dynamo. It seems to me that a series connection of voltage source, inductance and resistance better models the reality: a single piece of wire. A thought experiment: cut the wire in the middle to make a dual-output dynamo. What does that do to the model?
Yeah, that did have a capacitor there, but in that instance I just wanted to simulate unloaded voltage, so I deleted the cap.

I believe the current source / voltage source model difference is simply exploiting series-parallel duality, and although the reality is series inductor with leakage and internal resistance, for modelling purposes, the current source model works and gets away with fewer components.

I'm leaning towards the Cuk topology, inversion is no issue with an AC source, and hopefully control loops aren't too arduous. The alternative is have a separate Boost for PFC and Buck for voltage stability, which might be notionally simpler.
Post Reply