thefreeman’s HDR Anduril 2 boost drivers - update : KR1 B35AM & D4v2, Buck driver

238 posts / 0 new
Last post
Sunnysunsun
Sunnysunsun's picture
Offline
Last seen: 8 hours 13 min ago
Joined: 08/09/2019 - 12:51
Posts: 754
Location: Toronto

thefreeman wrote:
Thanks.

Digikey should receive 30000 1616 this month, last month they got 6000 and they were gone in 3 days lol.

Yeah according to your measurement it needs 16.5mm on top and 14 on the bottom, so I’ll try to do a 14mm clearance one with the DAC, then just add the switch ring to it.

How do you see when digikey is getting stuff and the quantity they’re getting? Mouser has that info right on the page but I couldn’t find it anywhere on digikey.

thefreeman
thefreeman's picture
Online
Last seen: 2 min 10 sec ago
Joined: 01/06/2020 - 09:56
Posts: 875
Location: France

”check lead time” and type in a large number.

Quadrupel
Quadrupel's picture
Offline
Last seen: 5 hours 20 min ago
Joined: 12/03/2017 - 10:40
Posts: 731
Location: Lithuania

Ahh nice… 1 sided and acceptable quantity off components. Now id like to try to design PCB for D10 headlamp;))

gchart
gchart's picture
Offline
Last seen: 10 hours 20 min ago
Joined: 03/19/2016 - 11:57
Posts: 3158
Location: Central IL

I just ordered parts and PCBs for one of the DAC-controlled layouts. Now for the wait before everything arrives… should give me time to get the firmware ready!

Quadrupel
Quadrupel's picture
Offline
Last seen: 5 hours 20 min ago
Joined: 12/03/2017 - 10:40
Posts: 731
Location: Lithuania

Actually we don’t need DAC controller ,we need proper code for attiny. Is it so difficult to write it?

gchart
gchart's picture
Offline
Last seen: 10 hours 20 min ago
Joined: 03/19/2016 - 11:57
Posts: 3158
Location: Central IL

Quadrupel wrote:
Actually we don’t need DAC controller ,we need proper code for attiny. Is it so difficult to write it?

We’re talking about the attiny’s internal DAC, using that to control current instead of using PWM. Not an external DAC. So I guess maybe you could say that this is “proper code for attiny”.

And as you’re probably trying to bring up again… yes, YLP has created a control mechanism within the attiny to control a FET linearly instead of relying on an op-amp. In reading some of the posts they’ve made of their control scheme, yes, it actually does sound difficult and involved. Certainly not impossible though. So I invite you, if you feel that it should not be so difficult, would you like to go ahead and make that and share it with the rest of us?

Some of that control mechanism might actually be easier to write (and faster to execute) with the newer attiny’s with the use of Core Independent Peripherals and the Event System. Basically you could have the input (reading of Vsense) trigger updates to the output control (DAC or PWM) without relying on CPU cycles.

Quadrupel
Quadrupel's picture
Offline
Last seen: 5 hours 20 min ago
Joined: 12/03/2017 - 10:40
Posts: 731
Location: Lithuania

If attiny can output analog signal why we using PWM? Anduril was written for primitive hardware , maybe its time to adapt to switching topology.
Maybe it can be helpfull http://www.technoblogy.com/show?1NGL
https://github.com/RoboUlbricht/arduinoslovakia/blob/master/ATtiny85/pwm...

gchart
gchart's picture
Offline
Last seen: 10 hours 20 min ago
Joined: 03/19/2016 - 11:57
Posts: 3158
Location: Central IL

Like I said… This is an attempt to use the analog output. So we’re working our way that direction (fingers crossed).

Quadrupel
Quadrupel's picture
Offline
Last seen: 5 hours 20 min ago
Joined: 12/03/2017 - 10:40
Posts: 731
Location: Lithuania

I hope you will succeed. Good luck!

icpart
Online
Last seen: 3 min 41 sec ago
Joined: 04/15/2019 - 01:13
Posts: 334
Location: Bulgaria

thefreeman wrote:
So I’m in the process of converting my drivers to use the DAC instead of PWM, there was two reasons I was on the fence about the DAC :
  • the lower resolution of 8bits, which would make the bottom of the ramp quite coarse and decrease the dimming range, even with 2 sense resistors (HDR) the minimum for a 5A 6V driver would be 77uA 6V, my goal has always been at least 100uA 3V (ZL H600 II) so that’s not enough, but if Gchart succeeds to implement dynamic VREF then there will be enough resolution.
  • the main point about using the DAC is to not have to use the LDO and a bunch of passives that comes with it and PWM (input C for LDO, VBATT divider, PWM RC filter), but I need a constant voltage to drive the HDR FET that switches between the two sense resistors, since the Rdson of this FET is part of the total Rsense it has to remain constant through the whole battery range (4.2 to 2.8V). Except that was with the previous FET, the new one I use has a very flat RDSON/VGS curve according to the datasheet, so I measured it to be sure :


Great news about DAC implementation thefreeman. I saw your DAC shared project these days at OSHPark. In future also implementation of external DAC with higher resolution will be very good.
Gchart and you do the great job with your project. I am also very involved with them and if I can help anyway I will enjoy of that. I have master degree of Electronics and Power Electronics so I think I can help.
About time response I know you don’t like two stage RC filters like in Convoy drivers but one of advantage of them are they have better time response compared to simple one stage. Also I thinked time ago it is possible to be used active LPF filter for PWM DAC for best time response but this just go to be very complex and will add additional components on small boards.
About driving mosfet with constant voltage I have one idea which I simulated time ago and think is better from LDO solution. Because output voltage from MCU is not very accurate and constant I thought to be used for chopping of constant voltage with external load switch.
I have question to you. For HDR low side FET you need only to turn it on with constant voltage, right? Simple solution which you can use is that. You can connect to output in series shunt voltage regulator like TL431. In that case you will always have 2.5V on gate of mosfet.

For future DC/DC drivers I think is time to go with I2C control. Most of new and advanced DC/DC converters are controlled via I2C anyway. With that case it will be cery easy to control maximum output voltage or current limit just with software solution and not need to change any resistors in FB voltage dividers for example. I think it is not very difficult to be implement in firmware.

gchart
gchart's picture
Offline
Last seen: 10 hours 20 min ago
Joined: 03/19/2016 - 11:57
Posts: 3158
Location: Central IL
icpart wrote:
For future DC/DC drivers I think is time to go with I2C control. Most of new and advanced DC/DC converters are controlled via I2C anyway. With that case it will be cery easy to control maximum output voltage or current limit just with software solution and not need to change any resistors in FB voltage dividers for example. I think it is not very difficult to be implement in firmware.

Do you know of any DC/DC converters (buck or boost) with I2C current control that might be a good fit for flashlights? I knew that some controllers used I2C, but I haven’t looked too far into them. I2C from the attiny should be fairly easy, but it seems like most DC/DC converters are made for constant voltage (which of course could be converted to constant current with some extra ICs, but that adds complexity).

icpart
Online
Last seen: 3 min 41 sec ago
Joined: 04/15/2019 - 01:13
Posts: 334
Location: Bulgaria
gchart wrote:
icpart wrote:
For future DC/DC drivers I think is time to go with I2C control. Most of new and advanced DC/DC converters are controlled via I2C anyway. With that case it will be cery easy to control maximum output voltage or current limit just with software solution and not need to change any resistors in FB voltage dividers for example. I think it is not very difficult to be implement in firmware.

Do you know of any DC/DC converters (buck or boost) with I2C current control that might be a good fit for flashlights? I knew that some controllers used I2C, but I haven’t looked too far into them. I2C from the attiny should be fairly easy, but it seems like most DC/DC converters are made for constant voltage (which of course could be converted to constant current with some extra ICs, but that adds complexity).

In most cases you can fine adjust output reference voltage or current limit via i2c. Current limit its only in most cases for protection to set maximum current of device. You right if we need CC control of converter we will need again Opamp control solution for LED current limiter. I think I have been seen before some digital controllers from LT and TI in which you can set the output current limit but I didn’t it will be with fine steps for our needs. I will try to find tommorow some examples.
I think I find good example in new PD chips. You can adjust with them easy output voltage and current
https://www.monolithicpower.com/en/documentview/productdocument/index/ve...
Maybe for smooth ramping current and voltage step settings are not fine but for simple UI with stepped ramping or simple current presets it will be great choise.

In fact as quadrupel ask to have digital software control in future it will be the best choise. Years ago I read about digital power control most cases is used PI or PID feedback control. With I2C chips that will be easy because in fact when you control FB voltage reference you will control also current via LED. For that we will also need another current sense amplifier because most of ADC of MCU doesn’t have great low voltage resolution, also software for that.

thefreeman
thefreeman's picture
Online
Last seen: 2 min 10 sec ago
Joined: 01/06/2020 - 09:56
Posts: 875
Location: France

There are a few regulators with I2C current control but usually it’s large steps like 50mA, not suited for our application. For voltage control it seems to be often 10mV steps which is maybe fine enough ? Not sure . It would require software regulation and to read Vsense, the easy way is a current sense amplifier (which has the advantage of producing a GND referenced voltage from a non GND referenced one, allowing to do high side current sensing), or the hard way Inferion implemented it in YLP lights (high resolution DSM ADC).

The thing is there aren’t that many attractive regulator/converters for our application, if you add I2C to the mix that severely restrict your choices. The little 6A buck converter I’m using here is excellent and with AFAIK no I2C equivalent in size, efficiency, simplicity of implementation .
For boost converters (integrated switches) there are like two that I consider to be great for small drivers, again, no I2C.

This is too restrictive, just to gain 3 resistors.

Quadrupel
Quadrupel's picture
Offline
Last seen: 5 hours 20 min ago
Joined: 12/03/2017 - 10:40
Posts: 731
Location: Lithuania

What about direct FET swiching control with IC?

Mike C
Mike C's picture
Offline
Last seen: 3 days 5 hours ago
Joined: 01/22/2014 - 08:03
Posts: 2584
Location: Sweden

Quadrupel wrote:
What about direct FET swiching control with IC?

Why?
Quadrupel
Quadrupel's picture
Offline
Last seen: 5 hours 20 min ago
Joined: 12/03/2017 - 10:40
Posts: 731
Location: Lithuania

Simple schematics, cheaper, any size and power mosfets can be used?

gchart
gchart's picture
Offline
Last seen: 10 hours 20 min ago
Joined: 03/19/2016 - 11:57
Posts: 3158
Location: Central IL

Since we’ve been PWM’ing FETs forever, I have to imagine you’re referring to something else. Since you’ve talked about it before, do you meaning trying to use the MCU to operate the FET linearly without using an op-amp (à la YLP)? I’d like to explore that at some point, but I’m sure it won’t be a walk in the park.

JaredM
JaredM's picture
Offline
Last seen: 9 hours 3 min ago
Joined: 10/31/2011 - 13:33
Posts: 2245
Location: Pittsburgh, Pennsylvania

Would a simple parallel R+C between the mcu pwm pin and gnd create a variable voltage controlled by duty cycle?

gchart
gchart's picture
Offline
Last seen: 10 hours 20 min ago
Joined: 03/19/2016 - 11:57
Posts: 3158
Location: Central IL

JaredM wrote:
Would a simple parallel R+C between the mcu pwm pin and gnd create a variable voltage controlled by duty cycle?

Yup. That scheme has been employed by Emisar in the recent linear drivers as well as the FireFlies Lume1 drivers (LoneOceans design). But those feed the RC-filtered voltage into an op-amp instead of directly into the FET (or in the case of the Lume1, the buck regulator).
Quadrupel
Quadrupel's picture
Offline
Last seen: 5 hours 20 min ago
Joined: 12/03/2017 - 10:40
Posts: 731
Location: Lithuania
We need a right code to run mosfets in way we like. I ques its all about coding, to keep circuit simple, cheap and reliable as possible.
Mike C
Mike C's picture
Offline
Last seen: 3 days 5 hours ago
Joined: 01/22/2014 - 08:03
Posts: 2584
Location: Sweden

Quadrupel wrote:
Simple schematics, cheaper, any size and power mosfets can be used?

Have you calculated the capacitor requirements for higher output (>5 amps) with the low switching frequency from ATtiny’s? Of coarse you can use lower capacity on them but then you have a load of ripple, not a very good driver.

Seems like a bunch of work for a driver that will work worse so why bother? If you think it’s worth it, make it.

Quadrupel
Quadrupel's picture
Offline
Last seen: 5 hours 20 min ago
Joined: 12/03/2017 - 10:40
Posts: 731
Location: Lithuania

For 5A (30W!) output you will need big host with plenty space inside anyway. And its big question will you see PWM at hi output, because human eyes see no difference in bright light changes. I’d like to make it, but its all about code and i have no skills. BTW some reading about TI buck -boost led dimming.

Mike C
Mike C's picture
Offline
Last seen: 3 days 5 hours ago
Joined: 01/22/2014 - 08:03
Posts: 2584
Location: Sweden

If you want to use SMD capacitors, then the cost of the boost ICs is replaced by large capacitors instead, only for a driver not working as good. I’m not saying it’s not an interesting idea, myself and others might at least be interested in discussing it but perhaps you should create your own thread and the discussion can continue there instead of posting this suggestion in all other driver threads.

And about about not having coding skills, I can assure you that no one here had any coding skills before they started learning how to code either.

Agro
Agro's picture
Online
Last seen: 1 min 49 sec ago
Joined: 05/14/2017 - 11:16
Posts: 6821
Location: Ślōnsk

Mike C wrote:
And about about not having coding skills, I can assure you that no one here had any coding skills before they started learning how to code either.

This sounds a bit harsh….I think there’s nothing wrong with Quadrupel offering some of the skills needed to make a driver that he’d like to make while asking for a collaborator to fill the rest.
Maybe he won’t find such person and then it will indeed boil down to whether he wants to invest this much time to learn a new major skill.
But maybe someone will chime in.
icpart
Online
Last seen: 3 min 41 sec ago
Joined: 04/15/2019 - 01:13
Posts: 334
Location: Bulgaria

Some time ago I posted here in BLF as Quadruppel I think he also posted the DC/DC converter based only on MCU. It is very nice idea and there is achieved in YLP Unicorn as well in LED drivers from Tamagochi user from Fonarevka. The hardware is easy to make but difficult part is software. Also AVR are not the best MCU for that. PIC mcu have better candidates for that. In simple solution you will need some MOSFET and coil and sense resistor. If we don’t use external amplifier wee will need 16-bit ADC at least for good performance. Another problem is switching frequency which will be low anyway. There will be needed chips with fast PWM with higher PWM resolution to achieve better efficiency with higher frequency and control.

thefreeman
thefreeman's picture
Online
Last seen: 2 min 10 sec ago
Joined: 01/06/2020 - 09:56
Posts: 875
Location: France

The Unicorn/gekko/panda 4 use a linear driver, not DC-DC, but yes Tamagotchi’s driver is what Quadrupel was likely talking about, I don’t know if he has ever made higher power boost drivers than his H03/H04 ones, and with synchronous rectification, because his were asynchronous unfortunately.
Gate drivers will also be probably needed because I doubt the MCU can drive the mosfets without significant switching losses especially at higher frequencies (which as you mentioned an Attiny isn’t probably the best). In the end I don’t think we can really gain anything in space, cost, efficiency.
Here the buck converter I used is synchronous, all N-FETs with an integrated charge pump so it’s capable of 100% duty cycle, very high switching frequency of 2.4 MHz allowing to use a small inductor and low capacitance (I actually oversized both) while still having very low switching losses.
It might be a cool project but it’s likely a long road ahead to achieve that 95~97% efficiency without huge components.

icpart
Online
Last seen: 3 min 41 sec ago
Joined: 04/15/2019 - 01:13
Posts: 334
Location: Bulgaria

thefreeman wrote:
The Unicorn/gekko/panda 4 use a linear driver, not DC-DC, but yes Tamagotchi’s driver is what Quadrupel was likely talking about, I don’t know if he has ever made higher power boost drivers than his H03/H04 ones, and with synchronous rectification, because his were asynchronous unfortunately.
Gate drivers will also be probably needed because I doubt the MCU can drive the mosfets without significant switching losses especially at higher frequencies (which as you mentioned an Attiny isn’t probably the best). In the end I don’t think we can really gain anything in space, cost, efficiency.
Here the buck converter I used is synchronous, all N-FETs with an integrated charge pump so it’s capable of 100% duty cycle, very high switching frequency of 2.4 MHz allowing to use a small inductor and low capacitance (I actually oversized both) while still having very low switching losses.
It might be a cool project but it’s likely a long road ahead to achieve that 95~97% efficiency without huge components.

You right. Best solution so far is to be implemented DAC and I2C support in Anduril. The freeman do you have idea if temperature sensor in 1616 is better from external one. Loneoceans use external one, I think in your driver it maybe will be better choise for large host in which PCB is large and MCU package will heat up I think very slow compared to external sensor. Also most of cases one of ground pins of external chip I think is used for thermal probe. i2c can be used for example for external DAC or ADC chips or another LED drivers. I can give you simple Idea for that. If main MCU support i2c it will be easy to be achieved PD charging with main controller. Most of USB-C enabled flashlights doesn’t support USB-C to C charging.

Pages