Mod - GarryBunk's SecurityIng HD-016 (It's Finally Done!) - Pic Heavy

170 posts / 0 new
Last post
ImA4Wheelr
Offline
Last seen: 2 months 2 weeks ago
Joined: 02/03/2013 - 14:51
Posts: 7935
Location: SC

Hardware is the stock driver (pictures in Post 16) with the MCU pulled.  Here is a schematic of everything but the 2 build-in buck drivers.  I will adjust the voltage divider resistors initially and again after testing, if needed.  I can also adjust the FW to fine tune LVP.

LED's 3, 4 & 5 are voltage indicator LED's.  There are 2 buck drivers in the driver.  Both will be provided the same PWM feed.

garrybunk
garrybunk's picture
Offline
Last seen: 15 hours 28 min ago
Joined: 10/31/2011 - 09:25
Posts: 6099
Location: Johnstown, PA

wight is correct.  I sent you (TK) a PM earlier that I am willing to give up the temp. monitoring if that is holding things up or too difficult.  And like wight said, getting voltage indicators to work in some fashion to provide low voltage indication (and I like wight's idea to just light / flash all 3 together). 

-Garry

My Bike Lights Thread, Optics (TIR) Comparison Beamshots, Diffusion Techniques

, MTBR’s Lights & Night Riding Forum
NOTE: Now hosting my photos from my Google account. Post up if you can’t see them. Older photos hosted on Photobucket or Flickr may disappear (PM me if you want access to them).
wight
Offline
Last seen: 1 year 8 months ago
Joined: 11/27/2013 - 16:40
Posts: 4969
Location: Virginia, USA

garrybunk wrote:

wight is correct.  I sent you (TK) a PM earlier that I am willing to give up the temp. monitoring if that is holding things up or too difficult.  And like wight said, getting voltage indicators to work in some fashion to provide low voltage indication (and I like wight’s idea to just light / flash all 3 together). 

-Garry

I think that’s actually ImA4Wheelr’s idea! Hopefully I recall that correctly.

I was under the impression that the code JonnyC had on Github for temp & voltage was functioning, but who knows. I could definitely be wrong about that, I have not tried it.

Still fine, still on a break. One day I’ll catch up with you folks! previous wight catchup Wink
list of my drivers & variants (A17DD, FET+1 stuff, WIP stuff, etc)

ImA4Wheelr
Offline
Last seen: 2 months 2 weeks ago
Joined: 02/03/2013 - 14:51
Posts: 7935
Location: SC

You are correct wight.  That was my idea if we used a pin for temperature monitoring.  Although 2 emitters at 2.6 amps does not sound like much, the light is very small and the bike may not always be moving.  Also, Garry could decide to increase current in the future.  So it seemed true thermal protection would be worth pursuing and that it should trump voltage indicator lights (but that is Garry's decision).

 

180jacob
Offline
Last seen: 6 years 1 month ago
Joined: 01/05/2015 - 18:01
Posts: 1
Location: UK

Hi all,
Have just discovered this forum and have been hooked on it for the past few evenings. I am an apprentice electronics engineer and find it all very fascinating. I have one of these lights and am planning on resistor modding then having a stab at an mcu. I’ve only ever used PIC mcu before and the attiny is completely new to me but when you come up with something that works I will most definitely be attempting to reproduce it. Thanks very much for all the work that you guys have shared thus far and please please see this project through to completion.
Regards Jacob

garrybunk
garrybunk's picture
Offline
Last seen: 15 hours 28 min ago
Joined: 10/31/2011 - 09:25
Posts: 6099
Location: Johnstown, PA

Welcome to BLF Jacob! We might be scrapping the idea of the custom driver and instead utilizing the newly available KD2 10 Step programmable driver.  Well it will still be custom work as the KD driver is not a direct fit.

-Garry

 

 

 

 

 

My Bike Lights Thread, Optics (TIR) Comparison Beamshots, Diffusion Techniques

, MTBR’s Lights & Night Riding Forum
NOTE: Now hosting my photos from my Google account. Post up if you can’t see them. Older photos hosted on Photobucket or Flickr may disappear (PM me if you want access to them).
ImA4Wheelr
Offline
Last seen: 2 months 2 weeks ago
Joined: 02/03/2013 - 14:51
Posts: 7935
Location: SC

Hi 180jacob.  Sounds like you bring a very needed skill set to the hobby.  Looking forward to seeing what you eventually set out to do.   We only have a couple PIC programmers here.   Some of the PIC's seem have some nice advantages over the Attiny's.  It would be nice to see the hobby branch out that way.  Right now, all the momentum seems to be with the Attiny13a.  I don't know if we have any electronics engineers here on BLF.

This build be be completed.  We're currently trying to figure out the best MCU/FW to use to give the light the most desired functionality.  I really hope we develop a nice open-source FW/Hardware solution.  One option, as Garry mentioned, would be to transplant the MCU (and I think eeprom chip) from the KD2 to the host driver.  Garry will be evaluating the UI, mode separation, etc and then will make a decision if we will go that route.  It does seem like a very attractive route as the KD2 driver can be had for about 8 bucks.  If we go that way, I'm thinking of using the brainless KD2 driver to drive a couple off-road lights on one of my cars.

ImA4Wheelr
Offline
Last seen: 2 months 2 weeks ago
Joined: 02/03/2013 - 14:51
Posts: 7935
Location: SC

Garry has opted to utilize the MCU from the KD2 10 Step programmable driver.  For any not aware, he requested KD make the driver available separately from the light.  Last I checked it was $8.

After playing with the KD driver a bit, I have to say it is a pretty cool driver.   Programmable levels, thermal and low voltage protection, and indicator lights basically cover all the features Garry wanted.  I really like how it smoothly ramps to the next level. 

I've spent a good amount of time trying to map out the circuits on the KD driver so that I can determine what needs to be done to transplant the MCU to to the HD-016.  It's been frustratingly difficult due the black masking and traces running under components.  I finally had to resort to sacrificing the KD driver by sanding off the masking.

This will be a pretty involved driver mod because it will require at a minimum that the MCU, EEPROM chip, and some resistors be transplanted.  Another complexity is that the pin outs are completely different and almost every pin of the KD's MCU is used.  There will be a lot of air wiring.  There are some other circuit differences that may need to be addressed as well.  I also hope to transfer the Red, Yellow, and Green indicator LED's as they have different meanings for programming and voltage indication.  Not sure what the HD-016's green GITD cover will do to the colors.

Here is the driver with the toroidal inductor removed:

Driver with mask partially sanded off:

Here is a first draft of the KD circuit.  It was written down as I studied the sanded driver and compared to pictures of the unstripped driver.  It doesn't include some of the buck portion of the circuit as the HD-016 will provide that.  I still need to verify the accuracy of the diagram.  Once verified (hopefully tonight), I will compare the the HD-016 circuits and formulated a transplant plan.

Hopefully all goes smoothly.  I will update the OP with a summary of all the mods once completed.

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 5 hours 4 min ago
Joined: 01/12/2013 - 14:40
Posts: 10784
Location: (469219) 2016 HO3

I’m glad to hear it’s moving along. I’ve been sick for about two weeks and barely managing to keep up with work, so I haven’t really stayed in the loop.

ledoman
Offline
Last seen: 4 days 17 hours ago
Joined: 09/25/2010 - 06:27
Posts: 937
Location: Slovenia (EU)

ImA4Wheelr, great job. I like that KD2 driver much and it's nice to see the drawing of it. Hopefuly you'll do it like this at DX forum (pic.source http://i.imgur.com/WzPgF8g.gif). It has identical user interface, but it's boost driver for 3 to 6 leds in series.

Maybe this drawing would help you somewhat.

ImA4Wheelr
Offline
Last seen: 2 months 2 weeks ago
Joined: 02/03/2013 - 14:51
Posts: 7935
Location: SC

Thank ledoman.  That may be very helpful.  Do you know if there is a free program out there that would enable me to create a diagram like that for the this KD driver?

ledoman
Offline
Last seen: 4 days 17 hours ago
Joined: 09/25/2010 - 06:27
Posts: 937
Location: Slovenia (EU)

Unfortunately not. I'm not EE, just end user of those driver.

ImA4Wheelr
Offline
Last seen: 2 months 2 weeks ago
Joined: 02/03/2013 - 14:51
Posts: 7935
Location: SC

Maybe Eagle can do that for me.  I need to study this thread by Mattaus.

Your diagram will be good for verifying mine for the relevant parts of it.  Thanks again ledoman.  Smile

garrybunk
garrybunk's picture
Offline
Last seen: 15 hours 28 min ago
Joined: 10/31/2011 - 09:25
Posts: 6099
Location: Johnstown, PA

Glad to see progress ImA!  Sorry this project has become so difficult!  I didn't intend to torture you when I asked you to take this on! 

-Garry

My Bike Lights Thread, Optics (TIR) Comparison Beamshots, Diffusion Techniques

, MTBR’s Lights & Night Riding Forum
NOTE: Now hosting my photos from my Google account. Post up if you can’t see them. Older photos hosted on Photobucket or Flickr may disappear (PM me if you want access to them).
ImA4Wheelr
Offline
Last seen: 2 months 2 weeks ago
Joined: 02/03/2013 - 14:51
Posts: 7935
Location: SC

No worries.  Learning a lot.  Hoping to wrap this baby up this or next week.

wight
Offline
Last seen: 1 year 8 months ago
Joined: 11/27/2013 - 16:40
Posts: 4969
Location: Virginia, USA

Eagle can do the diagram. IMO using a CAD program like Eagle is much less frustrating than attempting to map out an unknown circuit on paper.

Still fine, still on a break. One day I’ll catch up with you folks! previous wight catchup Wink
list of my drivers & variants (A17DD, FET+1 stuff, WIP stuff, etc)

ImA4Wheelr
Offline
Last seen: 2 months 2 weeks ago
Joined: 02/03/2013 - 14:51
Posts: 7935
Location: SC

I think jotting down observations on a piece of paper seems much easier than burning time searching for library elements for an unknown MCU and other components.  Maybe for a more complex circuit, but for our drivers a sketch seems adequate.

Would be nice to document all tidy and all for future reference though.

wight
Offline
Last seen: 1 year 8 months ago
Joined: 11/27/2013 - 16:40
Posts: 4969
Location: Virginia, USA

One factor is how well you understand the circuit to start out with. The better mental image you have of the circuit, the easier it is to draw in either format.

There’s no reason to go running around looking for library components. Just pick something that uses the same package and go with that. It’s not like someone is going to flip a power switch on your Eagle schematic: it’s just a representation. More experienced Eagle folks may normally just make any missing parts, but I don’t usually bother for a schematic.

Still fine, still on a break. One day I’ll catch up with you folks! previous wight catchup Wink
list of my drivers & variants (A17DD, FET+1 stuff, WIP stuff, etc)

ImA4Wheelr
Offline
Last seen: 2 months 2 weeks ago
Joined: 02/03/2013 - 14:51
Posts: 7935
Location: SC

Number of components that will be swapped over is 15.  Actually, 13 swaps and 2 additional components (EEPROM and a 30K resistor) will be added.  Six of the ten swaps will be resistors, three the colored indicator LEDs, then the MCU, EEPROM, thermistor and the tantalum capacitor.  I'm not crazy about tantalum capacitors, but since it is part of the MCU's and the EEPROM's power supply circuit, I will error on the side of caution and swap it over.

Heaps of air wires will be needed.  Some traces will need to be cut and new "traces" laid down for the indicator LED's.  They are feed a positive charge from the MCU on the KD driver, but a negative charge from the MCU on the HD-016.

If I was handy with Eagle and Gerber files, I would make an adapter PCB for the MCU.  Well, maybe not.  I don't think I would want to wait for an order to be fulfilled.  I'll air wire and secure wires/mcu/eeprom with a little silicone.

I noticed my diagram does not show the tantalum capacitor connection to B-.  I will eventually make a nice diagram for future reference and post it.  I'll try to do it in Eagle.

vueltinguer
Offline
Last seen: 6 years 9 months ago
Joined: 02/05/2015 - 18:25
Posts: 2
Location: Spain

Hi, I’m new to his forum and first I would like to thanks ledoman for his great review of this light, ImA4Wheelr for his reverse engineering job and others for their contribution to this thread. I’m engineer in electronics, hobbist and embedded systems programmer, and I’m the recent owner of a HD-016 from Gearbest that I bought for my mtb. I’m very interested in modding this light, and I would like to add my “little grain of sand” to this thread. It seems to me that the stock MCU is an Attiny 24, (VCC and GND pins match Attiny pins, OC1A and OC1B, (ATtiny PWM outputs), are tied to led1 and led 2 PWM controllers, maybe Aref is VCC and not internal ref…), so maybe the best solution would be to reprogram the stock MCU using ISP pins. I will try to read it’s firmware,maybe it is not protected, but even if I couldn’t, it would be very easy to program a new custom firmware.

This weekend I will try to make some photos of my semi-modded light.I have improved thermal dissipation using thermal compound and two pennys attached to the back of the pills. Ledoman, I like your idea of connecting both pwm’s in parallel and use a combination of Rsense’s, but I’m not sure if current regulation will be stable. I will give it a try. Sorry for my bad english, Jose Luis
garrybunk
garrybunk's picture
Offline
Last seen: 15 hours 28 min ago
Joined: 10/31/2011 - 09:25
Posts: 6099
Location: Johnstown, PA

Welcome to BLF Jose! Glad to have your contributions.  Feel free to post up pics of what you've done.   

-Garry

 

 

My Bike Lights Thread, Optics (TIR) Comparison Beamshots, Diffusion Techniques

, MTBR’s Lights & Night Riding Forum
NOTE: Now hosting my photos from my Google account. Post up if you can’t see them. Older photos hosted on Photobucket or Flickr may disappear (PM me if you want access to them).
ledoman
Offline
Last seen: 4 days 17 hours ago
Joined: 09/25/2010 - 06:27
Posts: 937
Location: Slovenia (EU)

Jose Luis, welcome to the club ;-). it would be nice to have some EE here helping us (and yourself) solving electronics issues. We are mostly lack of that knowledge.Please see my post 100 with plan of another driver with same user interface as KD2 driver has and there should be the same chip IC4 regardless it is a boost driver.

Please rethink about my idea using both output circuits combined. Probably there can be some interference, but since there should not be any PWM this should not be an issue. It is just if the current from one circuit can interfere to another. Diodes should prevent that, but please take a closer look. Thanks. Of course I would also use different sense resistors in the case this idea should work. This would eliminate a lot of hassle to reprogram IC.

vueltinguer
Offline
Last seen: 6 years 9 months ago
Joined: 02/05/2015 - 18:25
Posts: 2
Location: Spain

Hi, I have tried to communicate with MCU by using both TPI and ISP modes, but with no luck Sad ,may be it is a PIC, and I have no experience working with pics, only with AVR’s. Next step will be combining Rsense resistor and put leds in parallel, but I need to find SMD resistors with low values.

cam99X
Offline
Last seen: 6 years 9 months ago
Joined: 02/13/2015 - 17:22
Posts: 1
Location: Melbourne Australia

Are you still going ahead with this light mod?

ImA4Wheelr
Offline
Last seen: 2 months 2 weeks ago
Joined: 02/03/2013 - 14:51
Posts: 7935
Location: SC

^ Yes, it's been progressing slowly partly do to it's complexity and partly due to lots of life interrupting events.  I haven't had a chance to mod any of my lights in ages.  When I do get a chance, this project get the attention.

I'm hoping to bring the frankendriver to life tonight or tomorrow.  I'll be honest.  I'll be holding my breath.  I've never so massively changed a driver.  The MCU's have the same number of pins, but that is the extent of their commonality.  For instance, the KD MCU feeds a positive charge to the indicator LED's, but the HD-016 MCU feeds a negative charge to them.  The forced me to cut traces and wire in new circuits to keep that functionality.  I wouldn't be surprised these two MCU are from completely different companies.

Anyway, I hope to be reporting good news and updating the OP with all the mods that have been made to the light by the end of this weekend.

ImA4Wheelr
Offline
Last seen: 2 months 2 weeks ago
Joined: 02/03/2013 - 14:51
Posts: 7935
Location: SC

Things are not going well with the MCU air wiring and I will be ditching that approach.  Keep running into complications.  There are 12 needed in total.  Below is second attempt before the blue wire in back broke free and I gave up air wiring this MCU.  Thinner wire would help, but still be problematic.  Please ignore the sloppy LED lead solders on top.  I just tacked them to have load testing purposes.

Garry is being very patient with my pace on this light and has OK's me going with an adapter board.  So I'm finally going to learn how to used Eagle and make Gerber files and such.  I don't know what MCU I'm dealing with.  I think I will just build the element from scratch based on dimensions.  If anyone has any tips for a better approach, please advise.

Time to go watch a Mattaus tutorial.

garrybunk
garrybunk's picture
Offline
Last seen: 15 hours 28 min ago
Joined: 10/31/2011 - 09:25
Posts: 6099
Location: Johnstown, PA

Thanks ImA for all the hard work!  As I stated via PM, I never expected this mod was going to be so difficult and frustrating for you.  Keep up the good work! 

-Garry

My Bike Lights Thread, Optics (TIR) Comparison Beamshots, Diffusion Techniques

, MTBR’s Lights & Night Riding Forum
NOTE: Now hosting my photos from my Google account. Post up if you can’t see them. Older photos hosted on Photobucket or Flickr may disappear (PM me if you want access to them).
ImA4Wheelr
Offline
Last seen: 2 months 2 weeks ago
Joined: 02/03/2013 - 14:51
Posts: 7935
Location: SC

I didn't either, but it's all good.  I'm learning things that will be useful in future projects.  That is part of why I want to do this mod.

Looks like the PIC16F676 may have the same footprint.  Trying to verify and see if any of the major vendors have a library part for it.  The SO-14 in the Microchip library looks like it may be a match.

ImA4Wheelr
Offline
Last seen: 2 months 2 weeks ago
Joined: 02/03/2013 - 14:51
Posts: 7935
Location: SC

Critiques please on this SO14 MCU adapter board.  Eagle has been kicking my butt all week.  Not a very intuitive progam and I kept having issues with mirroring, routing, and just being a dumb ass.  I finally have the following built.  I think I'm at the point I build Gerber files.  I don't know why I can't get a yellow "X" on the far right via.  I have check and double checked several times.  Any possible causes or other recommendations appreciated.  Here are pics of the combined and individual layers.

ImA4Wheelr
Offline
Last seen: 2 months 2 weeks ago
Joined: 02/03/2013 - 14:51
Posts: 7935
Location: SC

I ran a routine called DRC and it gave me the following.  I don't think I need to be concerned about any of it, but I really know nothing about Eagle yet.  All the errors seem to be at the via's. Maybe from me trying to make smooth traces?  Please let me know if there are any problems I should fix.  Also, if there are any other routines I should run.

Pages