Speed controlled dual led driver and housing

astroman

Newly Enlightened
Joined
Jul 10, 2008
Messages
4
Location
Toronto Ontario Canada
Greetings to all. This is my first post, yet I am no stranger. Please accept my thanks for the many postings all of you have made: you have taught me much, and there is still much more to learn!

In building an advanced folding e-bike last year, I settled for eBay 2x10W halo Cats to meet budget. I need more photons for road and minor trail use. The new light will run off a 48v - 12v DC converter from main bike batteries for regulated power (50W cap) and "unlimited" runtime.

The_Aluminator_enclosure.JPG


Here is my design for "The Aluminator"
A 2" Alum square cube angled at the front houses 4 x Cree Q5 WH placed 2 over 2 behind Lexan. The bottom 2 get Ledil CRS-D 9* for spill. The top 2 are for throw: 1 x Ledil CRS - SS 7* and 1 x CRS-RS 6*. Everything fits nicely on paper, and should align OK. The leds mount on the exterior of an inverted U channel that also supports dual 12v buck drivers and additional circuitry on the other side. The back of the U channel forms the rear lamp cover and supports a power connector and switch. So far, so good but not very cool, literally.

Total metal radiating surface area is 36 sq. in., when 60 are needed for 20W (15 for Q5s and 5 for drivers etc.) When standing still for a bit at full power, it's gonna roast the leds.

Add a heatsink? Nope!! Keep the lamp moving! Make led power increase with bike speed. As led power increases, so does heat, but so does airflow. Wiki "wind resistance" to see how much. Let airflow convect the additional heat while automatically keeping within the housing's thermal limit all the way to full power.

With the bike stationary, the light starts off on the lower two spills at, say, half power. As speed increases, so does brightness. Going faster, the top two throws brighten, so at full speed, you have full brightness on all leds. You see farther down the road the faster you go. On-coming cars? Add a circuit to auto-dim the throws and not blind drivers. Now that's a cool light!

OK, so build it! Here's where I am somewhat ignorant, as I was only a tech long ago, not a circuit or pcb designer. Stuff may be wrong. Your opinions and any circuit assistance are very welcome.

Speed_controlled_dual_LED_driver.JPG


The wheel magnet-speed sensor wire is tapped to send its pulses to a gate to condition the signal. The gate outputs the pulses to a frequency to voltage (F2V) chip whose output is a linear control voltage proportional to the frequency of the input. The chip must accept at least 10 Hz, preferably 1 Hz. This control voltage could be applied to the dimming input of a PWM circuit to control all leds, but in this design two circuits are needed, one for spill and the other for throw.

The F2V control voltage goes to the inputs of a dual op-amp, running as window comparators. Pots and resistors on the inputs adjust the window thresholds for each op-amp. These windows are the hi-low dimming regime for each of the spill and throw leds. Each op-amp volt controls its own buck driven PWM, or perhaps can drive its leds directly with high watt chip types. More parts may be needed than shown here for proper chip and driver function.

A forward facing phototrans or CDS masked from the leds "sees dark". It auto-dims the circuit by turning off or dimming the two throw leds, leaving the bottom two spill leds to light your immediate path. Adding pots, you can also manually drive the op-amps to bring leds to their max power (housing thermal limit) for stationary use (10 W or half power) or control the light when riding.

Another approach omits the op-amp comparators. Use 2 F2V chips, one with an adjustable pre-scaler input. The F2V voltages control dual buck supplied PWMs to drive their leds.

Speed controlled lights save battery power plus the cost, weight and ugliness of heatsinks with only a few extra bits of circuit. It lets you automatically see farther the faster you go. It can put the proper brilliance and beam on the road as needed, yet have usable light when stopped or facing traffic.
 
:welcome:

Good idea, been putting a bit of thought into this lately(see the MC-E thread on MTBR), Im running dynamo lights so they behave like this anyway.

Based on experience with the bflex I think the power curve should go from 5% stopped -> 100% at 30/40kph. And you want it to drop slowly so the sensor falling out of alignment doesn't leave you in the dark in a hurry, but increase quickly for downhill trail starts.
Ideally you would be able to select the different max power levels for different riding conditions(town/road/offroad/wet/dry). Maybe 40/70/100%.

If you come up with a good cheap circuit for buckpucks this idea would take off. People will talk about having a chriscontroller etc. :D
No more hassles with control pots etc, just an on/off button on the battery pack. :thumbsup::thumbsup::thumbsup:

:popcorn:
 
Instead of all the analog front end to generate freq->voltage to PWM to control a buck converter - it would be easier to just use a uController. That would allow the ability to handle various frequency inputs (wheel sizes etc) and also provide some delay for ramping down the output. Just because you brake and slow down for an obstacle, doesn't mean you want light output to drop.

Basically something like a bFlex could have new firmware to sense speed and control the output.

It is a lot easier to tweak firmware versus redesigning analog input/timing and output profile.

Anyhow, jmho.

cheers,
george.
 
astroman, take a look at the LM2907 which contains the f2v, a voltage reference and a comparator. Different configurations (packages, wiring flexibility, internal shunt regulator) are available. I'm using this device in one of my circuits that switches a dynamo-based LED driver depending on bike speed.
The LM2907 has been around for ages as it is often used in ABS applications (automotive). You can trust this part to be reliable and available for a long time.
As you try to deal with low frequencies such as 1 Hz, you could face a bit of an issue with your filter: It might just react terribly slow. So you could use 2 or more wheel magnets to somewhat relax the ripple of your f2V output and have a higher cutoff frequency filter in the circuit. Or you simply do not evaluate the speed below a certain threshold and run on a fixed light level from let's say 0..12 km/h.
 
Great suggestions! Glad that you find the basic idea practical. Thanks for the CPF welcome and kind words Znomit, but I'd rather have light than fame! Both are OK too (grin). Dynos would make life easier for this concept, when you can use one. My electric bike has a rear-hub motor, and the front wheel detaches so the bike can fold. Anyway, there is no point to a dyno light on an e-bike, from an efficiency and drag viewpoint. Better to dc convert from bike batteries.

Fast up/slow down brightness is an excellent feature that I had not considered. Perhaps dim down below a set control voltage, over 5-10 sec. using an R-C cct. Programmable op-amp ramps are possible, but dunno about cost or extra parts. Cheap buckpucks are available, like TI's TPS5430. For the bike light, one can rig a rotary switch or master pot for manual power control. The LM29707 F2V chip is a great choice Martin, and thank you for the interesting schematic.

George, I took a long hard look at Microchip's AN874 a single switch mode uController. I could not see an easy means of using it to sense speed, as you do with the bFlex controller, which is why I went analog. Analog also handles smaller wheels: the F2V output rises faster for a given speed, so set the window comparators for higher turn-on thresholds accordingly.

I build what I know and understand for safety and reliability, stretching a bit with each project. Digital is flexible and preferred, but analog still has much to offer. I'll keep plodding along with this. However if George can mod a bFlex to make a speed controlled driver, well, sign me up for a bunch! Why build, if a pro's product works better for less money or effort? :thumbsup:
 
To sense speed it's just a matter of setting up one of the GPIO pins of the uController as an input and then just poll (or interrupt driven) sense each wheel rotation. You would use something as simple as a reed switch as the 'sensing' device and a clip on magnet on the wheel (or spoke), just like bike computers.

A bit of software filtering to convert wheel pulses to mph or kph and you have the info needed to control the output (current regulator). The wheel pulses are so slow even at 60mph that a uC would have no problem catching each wheel pulse.

Of course the key is to make the whole thing flexible to deal with different wheel diameters and dimming/brightness requirements along with delay before dimming etc - i.e. firmware.

The hardware isn't much, a bFlex has all the hardware hooks necessary - it's the firmware that would be the work.

Using a Buckpuck (3021) with the control input option, you could use the uC to PWM dim the LEDs. With an 8 pin uC you could run it off 5V provided by the buckpuck and have 5 pins for CDS input sensing, speed sensing, PWM output and a switch and still have a spare pin. Something like the Atmel ATTINY85 has a lot of capability in an 8 pin package. Free C compiler and development software and about $40 for a programmer.

Anyhow, I think a uC is a great deal more flexible and easier to implement all the features you need using a buckpuck as the back end driver. Of course I'm comfortable with the firmware development so it's a no brainer choice. If you are more comfortable with the discrete solution then that would be the no brainer choice for you.

cheers,
george.
 
One great benefit of the uC solution is that you can hide your IP easier than with an analog circuit. This is very valuable in a world full of patent claims.
If you are not familiar with this technology yet, this is a perfect project to gain some practice. Definitely, it's the future.
 
I build what I know and understand for safety and reliability, stretching a bit with each project.

Some good ideas here. We tend to talk a lot about perfect solutions... George and Martin do some of the best stuff out there and their products are a joy to use.... but remember a lot of people are still running single mode on/off 1A driven lights. Maybe aim for MK1 going from 250mA below 10kph and 1A max. That shouldn't present any heat problems when stationary and still give a decent amount of light if the sensor gets knocked.


Oh, being tethered to the bike isn't nice so a helmet light version will need gps integration.:whistle: (ok, maybe wireless speedo???)
 
Hmmm. Lotsa brain food. I love a satisfying synapse supper. The consensus so far for The Aluminator is:

A bar or wireless helmet dual use light, as previously described, driven by a microcontrolled buckpuck with hidden IP protection. Brilliance varies with bike speed, starts at 5 % and has faster rise and slower fall times than bike speed. Auto-dimming, fail-mode and a manual drive is incorporated. Thermal, polarity, reverse/low V protection. The lamp can be used with any wheel size.

Ice Age cool! Together we make it better.

Znomit, you're perfectly correct about MK1: crawl b4 walk b4 run. The above is a solid goal, so first steps first. Moving from analog to digital means a new design. For wireless helmet op, I'm thinking IR. Helmet power is a separate issue. The hardware presents no real probs. It's the firmware that makes the magic, and I am no magician.

That ATtiny85 is a killer chip, George. Dual pwm and output compare too! The 3021 5V supply solution is elegant. I am regrettably code illiterate, and would not be an efficient programmer. Are there forums you can recommend? Are there freelance coders? "A man's got to know his limits" - Dirty Harry

Though many now run single mode 1A rigs, certainly more than a few will change lights or their driver, once this is perfected. Even me, running 20W Cat halos and having to cart the heavy 6v SLA along with the main packs everywhere I go! :thumbsdow Necessity is a mother...

BTW: here's the spex for my custom day commuter and night cruiser "Le Noctourne"
Black alum Montague M750 Wavecrest 18" folding frame. Shimano 21.
Dual 24 v 10 Ah LiFePo4 batteries (48 v), 20 A controller, on-board charger
Crystalyte 408 rear hub motor, twist 1/2 throttle, cruise control.
Solid closed cell foam tires 1.95 x 26 @ constant 65 psi. Tektro V brakes.
Watts Up meter, Palm III speedo with maps, folding pedals, signals, folding rear mirrors, horn
Top spd: 30-35 km/hr (22 American miles) average top end, motor only.
Range: motor only 40 - 50 km (20 - 30 miles) real world traffic, trails and hills
Weight: 32 kg (70 quaint old lbs.)
 
A great resource for the Atmel AVR is www.avrfreaks.com. It is supported/hosted/sponsored by Atmel but moderated and 'run' by AVR freaks. The forums are excellent and even more gentlemanly than CPF.

You may find folk on there that are similarly interested in a lighting solution like the type you have outlined and are willing to help in the design & coding.

I'd be happy to help as well, time permitting.

cheers,
george.
 
:thanks: 4 the Gr8 :welcome:

What a fine forum you folks have here!

Thank you George, for your kind offer of help and the AVR link. Like you, Martin and Znomit, they are as friendly and on the ball, so I'm in for another treat.

Looks like it's back to the drawing board and the classroom for a while to make this concept work in digital form. Reducing the Aluminator to practice begins there. Ya sold me, mista! And as stated in my first post, there is still more to learn...

Most night riders here in Toronto have no light at all, nor even wear something white. Invisible. How about your town? Promote "wear white and use your light"!

I'll post progress here on an irregular basis. Any comments or suggestions are always worthy. Let's make this work, then make it available.
 
This is such a good idea. I just ordered all the bits to follow the building a basic microcontroler based driver tutorial thread. If I can make that work this is a great target to aim for somthing more complex and usfull. Idealy you would end up with a fully integrated led driver and bike computer with an lcd display. I guess I need to look over at AVR Freaks about the best solution for driving a little lcd panel. Personaly I have no fear on the software front but for the hardware side I am a novice...

Ifor
 
Top