Would it help to put some small current sense resistors in series with the led on the driver.
Not to measure current flow just to generate some heat so the mcu can respond quicker?
Would it help to put some small current sense resistors in series with the led on the driver.
Not to measure current flow just to generate some heat so the mcu can respond quicker?
Thank you Ma’am, this worked perfectly!
Thank you too Tom for making the easy to read pinout diagram.
Would it help to put some small current sense resistors in series with the led on the driver.
Not to measure current flow just to generate some heat so the mcu can respond quicker?
It seems to get the measurements fast enough on most lights… but it probably helps if the LED wires are thick and the MCU is close to the copper pours for BAT+/LED+. Heat travels through those wires and traces into the feet of the MCU.
I’ve been gathering courage over the last few months; to give firmware code/editing another go. I’m not there yet, but I do have a question about a feature
How much code/work would it require to make Anduril have the option to do a “soft off” ?
When clicking once when on, instead of the light turning off instantly after the tiny delay:
I would love to make it do a really quick ramp down from the ramp level it was on. And THEN turn off completely.
I mean, “we have the technology”. So why not add another fancy feature
User revdns did this mod back in 2016. Same concept. source
How much code/work would it require to make Anduril have the option to do a “soft off” ?
I tried adding a soft-on and soft-off feature once. It wasn’t very hard to add, but there’s a catch. If the user clicks during the ramp-up or ramp-down period, things can get a little tricky. It needs a way to abort the animation. This is probably at least a little bit easier now though, since I built automatic abort into the nice_delay function any time a button is pressed.
So it’s not a lot of code, but it may take some experimenting to find a good way of dealing with interruptions.
Does anybody know if Andúril has a reset function implemented yet?
(hold the switch while connecting the battery)
Or is this only planed?
Edit:
Not at the moment, maybe in the future
Toykeeper I know what PID is and how it works
But even if I put a pot of water on my hotplate that is 30K above set point it wont start very quick to do a 70% duty cycle its likely starting about 10K above to heat up again,
but your PID even starts to increase current 40 or 50K above set point
I know even before you hit the Temperature ceiling if temp is climbing it is throtteling the output
That Video was made under Lab conditions, the heat up (I know it was way too fast) was in this test totally irrelevant
It was way more interesting what happens when the driver cools down slowly
The fact that the driver is starting to increase current even 30 or 40°C above the temperature set point is causing the heat up bug TA, Matemineco and myself has seen in multiple tets
in the video I could clearly show that it went up to 70% FET duty cycle when the temperature is falling but still 20-25°C above temperature ceiling
.
All what has to be done is keep the PID regulating to Ceiling +5K then disable it for safety reasons till ther light cooled down enough
(current PID model seems not to work so well for flashlights, when its getting hotter than set point, it wents into some sort of oscillation heating up more and more)
instead ramp down current down to MIN_THERM_STEPDOWN and stay at that level till it falls below temp ceiling
This would be sort of “Soft Turbo dropdown” dependant on temperature
Another question is about Lowering the PWM frequency on Moonlight to like 2kHz like you do which code is responsible for that
I would also like that in NarsilM some day
I am currently working on a CC FET driver and I also want to try getting on low levels the PWM to the OPV constantly at this frequency to see if this can be used to dim more
its not working on 15kHz with NarsilM
I have in main.c
#define BLINK_AT_RAMP_FLOOR
#define MOON_TIMING_HINT
enabled but it does not blink Astrolux wants it
I got round to flash Anduril onto my D4S and I think I bricked it.
I just simply copied the command from the first post without reading more about it and now I wish I did…
That’s what I did. Now after pressing the button only aux LEDs blink in low mode.
C:\avrdude -p t85 -c usbasp -u -Uflash:w:d4s.hex:a -Ulfuse:w:0x75:m -Uhfuse:w:0xFF:m
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: AVR device initialized and ready to accept instructionsReading | ################################################## | 100% 0.04s
avrdude: Device signature = 0x1e930b
avrdude: NOTE: “flash” memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: reading input file “d4s.hex”
avrdude: input file d4s.hex auto detected as Intel Hex
avrdude: writing flash (7372 bytes):Writing | ################################################## | 100% 6.48s
avrdude: 7372 bytes of flash written
avrdude: verifying flash memory against d4s.hex:
avrdude: load data flash data from input file d4s.hex:
avrdude: input file d4s.hex auto detected as Intel Hex
avrdude: input file d4s.hex contains 7372 bytes
avrdude: reading on-chip flash data:Reading | ################################################## | 100% 5.07s
avrdude: verifying …
avrdude: 7372 bytes of flash verified
avrdude: reading input file “0x75”
avrdude: writing lfuse (1 bytes):Writing | ################################################## | 100% 0.02s
avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0x75:
avrdude: load data lfuse data from input file 0x75:
avrdude: input file 0x75 contains 1 bytes
avrdude: reading on-chip lfuse data:Reading | ################################################## | 100% 0.01s
avrdude: verifying …
avrdude: 1 bytes of lfuse verified
avrdude: reading input file “0xFF”
avrdude: writing hfuse (1 bytes):Writing | ################################################## | 100% 0.02s
avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against 0xFF:
avrdude: load data hfuse data from input file 0xFF:
avrdude: input file 0xFF contains 1 bytes
avrdude: reading on-chip hfuse data:Reading | ################################################## | 100% 0.01s
avrdude: verifying …
avrdude: verification error, first mismatch at byte 0x0000
0xdf != 0xff
avrdude: verification error; content mismatchavrdude done. Thank you.
After this MCU doesn’t respond to anything
C:\avrdude -p t85 -c usbasp -n
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: error: programm enable: target doesn’t answer. 1
avrdude: initialization failed, rc=–1
Double check connections and try again, or use -F to override
this check.avrdude done. Thank you.
Can I still rescue it somehow or do I have to replace ATTiny on the driver?
Forgive me if that’s something obvious but I’m really not too educated on this stuff…
You used totally wrong fuse bits
Only a high voltage flasher may reset the MCU
Doesn’t help if its not flashable anymore you got to replace it
I may send you from Germany a flashed MCU
Best is to carefully unsolder one side leg by leg then folding up a few times to break other side legs
I was gonna say I might be closer and could send you an MCU, but then I realized your in Poland lol.
Sorry, it sucks to brick an MCU. Been there, done that, you’re not alone at least.
You live and learn. Eh…
Could you explain how to do it correctly for the future reference?
Will probably use your offer Lexel and place that long overdue order for couple drivers and get MCU straight away.
Actually how would it work with new ATTiny, do they come preprogrammed or how does one place initial firmware on it?
Excuse stupid questions but have no experience with it.
there are 2 ways of programming
pre solder with a SOIC socket adapter
or past reflow with an SOIC clip pusching on the MCU from above the PCB
indutrially with a pre reflow flashing robot that may be also able to retube/rerail the MCUs after flashing for PCBA machines feeder
Lexel, can you also slightly modify the code of Anduril/Ramping IOS V2 in such a preflashed MCU? With a appropriate remuneration of course.
In Poland it seems almost no one is capable of doing ui flashing related stuff.
Lexel, can you also slightly modify the code of Anduril/Ramping IOS V2 in such a preflashed MCU? With a appropriate remuneration of course.
In Poland it seems almost no one is capable of doing ui flashing related stuff.
I always work with NarsilM and Anduril constantly doing small easy code modification regarding replacing numbers or switching features on or off
But I can not write code itself like changing original code sections
Does anybody know if Andúril has a reset function implemented yet?
(hold the switch while connecting the battery)
No, not yet. I was trying to find a method which would work for FW3A, but it can’t detect the switch until quite a while after power is connected… and I haven’t added it yet for other lights where it’s easier to do.
So far I only have it on my lightsaber.
Could you explain how to do it correctly for the future reference?
Sorry about the bricked MCU. It sucks when that happens… and there’s no easy way to fix it.
Normally, it’s best not to set fuse values at all. Just let them stay as is, and there’s virtually no risk of bricking the MCU. But if you do flash them, I recommend using the bin/flash-*.sh
scripts in the firmware repository. They have the correct fuse values; just pick a script which matches your MCU type.
Another question is about Lowering the PWM frequency on Moonlight to like 2kHz like you do which code is responsible for that
I would also like that in NarsilM some day
It’s in a few parts of the code — anything which refers to dynamic underclocking. Since it’s a compile-time option, the exact relevant parts of the code are already marked.
So far I only have it on my lightsaber.
Okay, may we see your lightsaber? I wonder if you lean towards the light, or a bit towards the darkness It seems the darksiders have all the cool toys
I’ve not purchased/ made one yet, but I’m waning. Strangely enough, I feel it’s impractical. Doesn’t do anything more than be a cool thing. Of course I’m also the guy with a bunch of flashlights just sitting on a shelf in my office…
may we see your lightsaber? I wonder if you lean towards the light, or a bit towards the darkness
You mean this one?
Here’s a closer look at two sabers I use… green for the good days, purple for the not-so-good days:
The one I’m using a custom driver in, though, is a rainbow saber. It is all colors… sometimes even at the same time.
Good answer! Those are top notch.
Funny, I don’t remember seeing the middle one in the movies though