Polish project: Extended version of Nanjg 105C driver based on Attiny25V

56 posts / 0 new
Last post
JonnyC
JonnyC's picture
Offline
Last seen: 2 months 2 weeks ago
Joined: 01/14/2011 - 19:12
Posts: 1147
Location: Green Bay, WI - USA

DrJones wrote:

Yes. Smile 

Uhhh...so why are they not making the 105C's w/ the 25v from the start?  Just cost?

EDIT:  Or just jump to the 85v?

JackCY
JackCY's picture
Offline
Last seen: 5 years 5 months ago
Joined: 12/28/2012 - 16:30
Posts: 588
Location: Czech

They don’t need it for the simpler programs and cost is different.
Place an order to the factory and they might make it. It’s all about what shops want to sell and buy or order from the factories/distributors.

For DIY most people go with Attiny85 in this package.

Bocian
Bocian's picture
Offline
Last seen: 1 month 3 weeks ago
Joined: 01/17/2014 - 13:12
Posts: 79
Location: Poland

Here is the SALES THREAD

DrJones
DrJones's picture
Offline
Last seen: 4 years 5 months ago
Joined: 01/05/2011 - 13:30
Posts: 1044
Location: Frankfurt, Germany

Hi Bocian,

thanks Smile I spent a lot of hours optimizing code to get all the functionality into the 1kB of ATtiny13. I occasionally used ATtiny25 and 85, also experimented with off-time memory (using a cap and a 100k discharge resistor; yours is the simplest off-time memory setup I've seen; nice idea to use the internal resistance. I'll have to investigate further), but my premises were not to mod the hardware.

I really wish they had used ATtiny25 or better.

However recently I begun to design my own boards, clearly not using the ATtiny13 Smile After so many hours of writing compact code, I feel sort of guilty when writing 'expensive' (in terms of program space) lines of code, even though the 85 has plenty of space. Smile

How do you make the 0.2% and 0.015%? Just by PWM levels or something more tricky? I found that the real brightness at the lowest PWM levels strongly depends on hardware variations. With some luck I get a nice very low low, the same value in another driver/LED combo (same models) may be much brighter - or won't even light up.

Bocian
Bocian's picture
Offline
Last seen: 1 month 3 weeks ago
Joined: 01/17/2014 - 13:12
Posts: 79
Location: Poland

DrJones sorry for a mess, but I’ve answered Your question in sales thread 0:)

Maybe if Your custom project is not very advanced yet You should think about using current regulation based on operational amplifiers instead of common AMC7135. That gives You lower drop Voltage for a constant current regulation and possibility to mix digital control PWM and analog output (no flickering and using LED advantages in lm/W when low powered). Currently I’m developing Headlamp XP-G2 S2 mod using such solution and it works wonderful (those efficiencys when powered 0,2-20mA and more)l 8)

JonnyC
JonnyC's picture
Offline
Last seen: 2 months 2 weeks ago
Joined: 01/14/2011 - 19:12
Posts: 1147
Location: Green Bay, WI - USA

Ok, about the cap on the input pin.  I was reading this thread, http://budgetlightforum.com/node/20059#comment-400487, which outlines what DrJones was referring to with a discharge resistor.  Does an I/O pin have a specified state when power is disconnected from the MCU?  According to the diagram in the datasheet (what PilotPTK referenced), although not a complete diagram of the circuit, it looks like the cap would discharge immediately when the device is powered off.  I tried measuring the resistance of the pins, but different pins came up with different numbers and the resistance changed over the time that my DMM was connected.

It's great that adding a simple SMD cap can give us "off-time" mode switching, I just don't see how it will work besides just trial and error (add a cap and see how long it takes to discharge).  It would be nice to know what state the pin is in, and what the resistance is, when the battery is disconnected.

DrJones
DrJones's picture
Offline
Last seen: 4 years 5 months ago
Joined: 01/05/2011 - 13:30
Posts: 1044
Location: Frankfurt, Germany

Bocian: I'll reply here though Smile

Interesting; I didn't know the ATtiny25 can handle the lowest modes more reliably. I'll try that. And yes, one of my next drivers will have 2 channels, one with only 1*7135, the other with the remaining ones. I'll also try an AMC7136 based driver for a change.

I thought about an OpAmp linear driver, too, PWM filtered with an RC low-pass (maybe second order), but I'm not enough of an electronics engineer to know how to choose a suitable OpAmp for those small voltages down to some µV for the low modes. There's quite a gap between understanding the principles and really building a working circuit (depending on the complexity of course).

 

JonnyC: I tried measuring the resistance of star4 to GND; depending on the multimeter used I get ~5 MOhm or 30 MOhm - they measure at different voltages. I'll probably try an oscilloscope soon.

JackCY
JackCY's picture
Offline
Last seen: 5 years 5 months ago
Joined: 12/28/2012 - 16:30
Posts: 588
Location: Czech

It is in off state and the resistance is dynamic, not the same value at different voltages. I asked before, Bocian did not like the questions.

Yes a capacitor is enough if you have a big enough capacitor and big enough resistance in the MCU when it is off so the capacitor does not discharge too fast. The specs don’t say these values like resistance of different pins in an off state.

The way it is implemented in BLF-VLD thread is by adding a resistor and using a smaller capacitor, to charge the capacitor fast there is a diode to bypass the resistor. All you need really is a capacitor if you can find big enough one for your MCUs resistance.

Johhny, 1st page, I got: 66kOhm on 3 samples of Nanjg105C with ATtiny13A, on all pins, 200k range on DMM, minus on ground. If I put minus on pin the resistance was 27kOhm. Resistance was higher when I used 20MOhm on the DMM, maybe 1.3MOhm, I did not note it down. It is really a bit of a trial and error unless you can make a graph of resistance vs voltage.

From Bocian’s values of capacitors I calculated/guessed a resistance of about 1MOhm for the capacitors to have some reasonable voltage left after 0.5-1s. Although beware he uses 25V not 13A, may not be that comparable.

JonnyC
JonnyC's picture
Offline
Last seen: 2 months 2 weeks ago
Joined: 01/14/2011 - 19:12
Posts: 1147
Location: Green Bay, WI - USA

JackCY - Sorry, I totally passed over your exchange with Bocian and then asked basically the same question, ha Foot in Mouth.  I looked through the datasheet and searched the AVR forums and couldn't find any info on the state of pins when the device is powered down.  So it really does just seem like a crap shoot on picking a capacitor that would work.

RaceR86
RaceR86's picture
Offline
Last seen: 4 years 8 months ago
Joined: 02/22/2012 - 08:32
Posts: 3777
Location: Norway

Is there a maximum amount of 7135s this can control/be a master too?

BLF LED database – collaboration spreadsheet and latest news about where to buy LEDs
http://budgetlightforum.com/node/19342

Bocian
Bocian's picture
Offline
Last seen: 1 month 3 weeks ago
Joined: 01/17/2014 - 13:12
Posts: 79
Location: Poland

In my opinion: 1-2 or max. 3 of additional AMCs on board (105C) should not cause a problem (if You correctly cooling them in flashlight). But You must keep in mind that the electrical connections in this driver was not designed for currents like 4-6A.

PS. I can always (if remove orginal MCU anyway) drill a hole in PCB + connection to other side of driver and solder there copper wire from one side to another. Also can solder better connections between AMC current stabilized ground Smile

RaceR86
RaceR86's picture
Offline
Last seen: 4 years 8 months ago
Joined: 02/22/2012 - 08:32
Posts: 3777
Location: Norway

Ive done a total of 16 before on more than one occasion. 5,9A on a single 105C (Qlite). I have seen others go higher on a single board...

I have seen master/slave setups around the 15A range. (Something I will do soon too, not with the one Im buying from you, but I might try that out too.)

If that can be done with a regular 105C, I would assume yours can handle it just as well?

Do you or anyone know if there is an upper limit if you master/slave 105C drivers with 8-12x7135 on each board? Can a 20A driver be made? 0:) (Im aware of possible issues with switch, spring, etc ..)

(picture from DrJones)

BLF LED database – collaboration spreadsheet and latest news about where to buy LEDs
http://budgetlightforum.com/node/19342

sixty545
Offline
Last seen: 8 months 3 weeks ago
Joined: 10/25/2010 - 14:15
Posts: 702
Location: Denmark (GMT + 1)

JonnyC wrote:

I looked through the datasheet and searched the AVR forums and couldn't find any info on the state of pins when the device is powered down.  So it really does just seem like a crap shoot on picking a capacitor that would work.

Oh, let me help.

This has been discussed before - in the big mammuth thread Wink - from post #164 (look here) thru post #177 (Especially read #171).

JonnyC
JonnyC's picture
Offline
Last seen: 2 months 2 weeks ago
Joined: 01/14/2011 - 19:12
Posts: 1147
Location: Green Bay, WI - USA

sixty545 wrote:

JonnyC wrote:

I looked through the datasheet and searched the AVR forums and couldn't find any info on the state of pins when the device is powered down.  So it really does just seem like a crap shoot on picking a capacitor that would work.

Oh, let me help.

This has been discussed before - in the big mammuth thread Wink - from post #164 (look here) thru post #177 (Especially read #171).

Ah, thanks!  I figured it had to be somewhere in the monster thread.

JackCY
JackCY's picture
Offline
Last seen: 5 years 5 months ago
Joined: 12/28/2012 - 16:30
Posts: 588
Location: Czech

Thanks sixty.

RaceR86: why not use direct drive for outputs above 5A?
Seems silly to me to stack many boards to get a current that you can get with a single FET.
Unless of course you specifically need the current limited to a certain value.

Bocian
Bocian's picture
Offline
Last seen: 1 month 3 weeks ago
Joined: 01/17/2014 - 13:12
Posts: 79
Location: Poland

Two improvements have been made:
- increased speed of PWM
- thermal protection now works more smoothly (hardly noticeable to the eye when reducing brightness)
We are thinking also about implementing additional/alternative method of temperature treshold adjustment (after some multicliks driver turns on in 100% mode, then by touch, when sense max. safe temperature You click and from now on this “touched temperature” is written as a max. temperature treshold. What U think fellows?

DrJones
DrJones's picture
Offline
Last seen: 4 years 5 months ago
Joined: 01/05/2011 - 13:30
Posts: 1044
Location: Frankfurt, Germany

Ah, I had the same idea (for setting the temperature limit) a few days ago and had noted it on my to-do list for my bigger drivers. So obviously I like it Smile The user should be advised to do that temperature threshold configuration with full batteries.

I personally like to see a noticeable step in brightness when thermal protection kicks in, but that's just my taste.

What's the reason for increasing the PWM speed?

 

 

Bocian
Bocian's picture
Offline
Last seen: 1 month 3 weeks ago
Joined: 01/17/2014 - 13:12
Posts: 79
Location: Poland

DrJones wrote:
What’s the reason for increasing the PWM speed?

Because, it was in my opinion, a little bit too much audible in previous version of thermal protection mechanism (therefore we modified both) Smile
Bort
Bort's picture
Offline
Last seen: 2 months 1 week ago
Joined: 06/01/2012 - 17:15
Posts: 7460
Location: Holding the proverbial flashlight

Bocian wrote:
Two improvements have been made:
- increased speed of PWM
- thermal protection now works more smoothly (hardly noticeable to the eye when reducing brightness)
We are thinking also about implementing additional/alternative method of temperature treshold adjustment (after some multicliks driver turns on in 100% mode, then by touch, when sense max. safe temperature You click and from now on this “touched temperature” is written as a max. temperature treshold. What U think fellows?

how about some kind of notification that output is being reduced due to temperature, it would be nice to know that heat shedding is not sufficient, and one can even test different environments to figure out how long the light can maintain output before temperature induced reduction (and even compare between lights)

The Journal of Alternative Facts TM

"It is critical that there is a credible academic source for the growing and important discipline of alternative facts. This field of study will just keep winning, and we knew that all the best people would want to be on board. There is a real risk in the world today that people might be getting their information about science from actual scientists"

 

Werner
Werner's picture
Offline
Last seen: 1 year 1 month ago
Joined: 10/19/2012 - 15:00
Posts: 3679
Location: Germany

Oh man I get headache just for reading all the modes and configuring stuff…a factory reset seems like a good idea(drJones should also build this feature in his drivers, hint hint Wink )
I am away from all these configurable modes and stuff because I always got confused from it.
I just use some plain brightness levels or the ramping…

One question do you also solder a bigger wire between VCC and the plate, or just the plate on top of the stock spring?

The one click/two click mode change seems to be a really good thing, that is the best. It impresses me.

Bocian
Bocian's picture
Offline
Last seen: 1 month 3 weeks ago
Joined: 01/17/2014 - 13:12
Posts: 79
Location: Poland

Sorry but I am little busy today Sad About springs and contacts: Put this into translator: avoiding voltage drop at the terminals

DrJones
DrJones's picture
Offline
Last seen: 4 years 5 months ago
Joined: 01/05/2011 - 13:30
Posts: 1044
Location: Frankfurt, Germany

Bocian: Didn't you already use 16kHz? I definitely can't hear that. But younger ears can hear higher frequencies. So what frequency do you use now?

Werner: Yes, my bigger firmwares (i.e. those not restricted to ATtiny13's 1kB) have a factory reset.

 

 

Markow
Offline
Last seen: 5 years 7 months ago
Joined: 09/09/2013 - 03:27
Posts: 36
Location: Finland

This is fantastic project Smile

Does the zener modification work in order to use two cells with this driver? Some features disabled?

RaceR86
RaceR86's picture
Offline
Last seen: 4 years 8 months ago
Joined: 02/22/2012 - 08:32
Posts: 3777
Location: Norway

JackCY wrote:
RaceR86: why not use direct drive for outputs above 5A?

Feel free to guide me to any decent direct drive drivers that I can buy.

BLF LED database – collaboration spreadsheet and latest news about where to buy LEDs
http://budgetlightforum.com/node/19342

Bocian
Bocian's picture
Offline
Last seen: 1 month 3 weeks ago
Joined: 01/17/2014 - 13:12
Posts: 79
Location: Poland

Final version of extended Attiny25V driver has been established. Final PWM speed is 16,5kHz. Added: auto-calibration of temperature safety treshold invoked by 9-clik (when assembled in flashlight: driver start in 100% mode, lamps head getting warm, then by touch, when sense max. safe temperature, by any click this “touched temperature” is written as a max. temperature treshold).

Final version of programmable Attiny13A driver has been established. Final PWM speed is 18kHz. Decription below:

Navigating between modes works two-way. One click makes you move to another mode in the loop, double click takes you back to the previous one. It allows us to; for instance, reduce brightness without clicking through stronger modes in the loop. After reaching the verge of the loop, moving further will cause „a jump” to the next verge of the loop.

The programming procedure of a given mode is elicited by 6-click, while being in the mode we wish to change. Displaying the sequence occurs in the lowest mode (signaled by one twinkle) upwards. Every mode displays for about 1,5 of a second. After reaching 100% there’s one twinkle, then it displays modes downwards. The mode is programmed during the display invoked by a click or by the mechanism of turning off the switcher. If we cease to do anything during the procedure of presenting modes upwards and downwards, the light brightness will remain as previously set.

Brightness level palette available in the programming process:

0,02% (not always visible – depends on variability of electronic components parameters ).
0,15%
1%
4%
10%
18%
25%
32%
50%
70%
100%

Stroboscope (The strobo) mode is invoked by 3-click. The intensity of the flashes is the same as in the mode we have invoked the stroboscope, and has an optimal frequency 2Hz.

Simplified battery cell voltage measurement under full load is invoked by a 4-click. After invoking a 4-click, the lamp flashes for a short moment in 100%, then the measurement happens. After that, with a number of flashes in 20% mode, the driver informs us about detected voltage range:

- 5 flashes means 3,8-4,0V
- 4 flashes means 3,6-3,8V
- 3 flashes means 3,4-3,6V
- 2 flashes means 3,2-3,4V
- 1 flash means 3,0-3,2V
- no flash means 3,0V (in a moment there will be low battery cell voltage warning starts).

RESET to factory settings (modes to: 0,15%; 10%; 32%; 100%. Inovoked by 8-click.

The low battery cell voltage warning starts when the cell, in a working mode reaches about 2,9-3,0V. Then a single flash appears and a reduction to another, lower level from the programmable modes palette (we reach ~2,9V in the given mode, and after a flash, we drop to another, lower mode). This works to the level 3 (1%). When this happens the lamp will retain this level, flashing periodically every 10 seconds. After reaching 2,8V you will experience the last mode reduction to 2 (0,15%). After reaching critically low voltage 2,6V, the driver 4 flashes and goes into sleep mode.

Pages