Hotwire Regulator Design Collaboration Project Part 2

Status
Not open for further replies.

Alan B

Flashlight Enthusiast
Joined
Nov 19, 2007
Messages
1,963
Location
San Francisco Bay Area
Hotwire Regulator Design Collaboration Project part 2

The Programmable Hotwire Driver, as it has come to be called, has spawned some application specific projects. Basic design continues in this thread, and specific implementation threads are linked at the bottom of this posting.

The third section of this design thread continues here: https://www.candlepowerforums.com/posts/2803333

Now on to this, the second half of the Design thread:

(From the first post of the first thread, with changes:)

Now that I've built a M@g85 I can see the value of a soft starting regulator for incan. But I don't see much availability. I see JimmyM and AW planning to do something soon. I see old stuff but not currently available. Did I miss any? Soft starting with a thermistor is nice, but not enough.

Being the electronics and software engineer that I am makes me think of how to build a simple regulator. With today's microprocessors having PWM, ADCs, temperature detection and just about everything else (memory, clock, ram, etc) built in, it would seem to me that very few parts are required. I have done projects with AVR and PIC microprocessors. It is amazing what can be done with a single small low lead-count chip. (The design developed here uses only about a dozen parts).

Requirements that I would like to see:

Primary Features:

1) soft start
2) regulated RMS bulb voltage by PWM for high efficiency
3) provide battery overdischarge protection
4) provide overtemperature protection for the electronics
5) provide selectable voltage levels (programmable Vbulb)

(10/4/08, above items are coded and tested, the FET power driver is tested)

6) have a lock off sequence for safety - secret unlock sequence to prevent accidental turnon (or provide a 'normal' flashlight Vbulb mode that would run the bulb at a lower setting that is very safe, and keep the turbo mode for expert access)
7) provide a 'timeout' feature to dim and shutdown to limit runtimes when desired
8) make it user reprogrammable, with free software tools and simple/inexpensive PC interface
9) have some public open sourcecode so folks could play with the user interface and make customized versions
10) have a public pcb layout available so folks could roll their own small batch if needed
11) one or more folks can make the hardware (and sell it), over time if they become unavailable someone new can step in and make hardware that will work with the same or slightly modified software
12) be a simple enough design to allow a builder to make one without a pcb (DIY dead-bug style, etc)

Secondary Features (possibly developed later):

1) provide one button reprogramming in the field for voltage settings, etc
2) provide a minimum off timer to reduce bulb wear from over clicking friends
3) auto-detect battery type and set voltage protection
4) other ideas??

It seems to me that it would not take a lot of parts to do this. A good Power FET directly driven from an AVR or PIC micro PWM output, and a way to measure the actual voltage across the filament, plus some calculations to determine the effective (RMS) voltage and adjust smoothly to the desired value. Possibly a second ADC channel on the battery side to keep track of the battery voltage (if needed). Approximately three processor I/O pins are required:

1) pushbutton input (option, some designs don't need this)(need on-switch detection in some cases)
2) pwm out
3) battery voltage (loaded battery V is bulb peak V)

-) bulb RMS voltage (calculate from bulb peak V and duty cycle of PWM)

This would place square wave current pulses into the filament, but the frequency can be selected to be high enough to avoid problems, but low enough to manage losses in the switching FET. The thermal inertia of the filament provides the filtering, so pulses must be short enough for the temperature to be essentially constant from pulse to pulse.

I don't know if any of the existing available designs work precisely this way. JimmyM's soft start is not a micro. AW's is but I don't know much about the design. Most others I find (AWR et al) are no longer available.

Anyone interested in something like this? I don't have the time to do the whole project, but I may be able to do some part of it. Perhaps it could be some kind of group project?

Any interest? Any important requirements or concerns about this simple approach?? Anyone want to work on this???

If you have any links to similar projects (past or present), post them in this thread so we can review them and give them credit.

If you have done similar work or have ideas, chime in and let us know!

-- Alan


Today (10/4/2008) we start part 2 of the thread.

Part 1 is here:


https://www.candlepowerforums.com/threads/186291

Part 3 is here:

https://www.candlepowerforums.com/posts/2803333


Project Status: (10/4/2008)

We have a schematic and two circuit boards have been designed. One has been produced and tested. See the directory linked below. We have a sketch of a "Regulator Sled" that would slide into a D mag and replace the switch with the regulator PCB and a tactile momentary switch. There can be other electrical and mechanical designs, but this is what we have thus far.

Project Status: (12/2008)

wquiles and JimmyM have started application specific projects for derivative versions of what has come to be known as the PHD (Programmable Hotwire Driver) regulator, and have threads pertaining to the details. General and specific design discussions continue in this thread. Links to the new threads are at the bottom of this posting. JimmyM has released a development/test PC board.

Project Status: (1/2009)

Alan has built a prototype into a D M@g and is about to build and test the second generation PCB for the M@gSled. There is an interest thread for that variant as well as JimmyM and wquiles versions.

Schematic

http://akbeng.com/flash/hwreg/hrdc1d.bmp


We have Code and Hardware Working:

gate%20and%20drain%20wa1185%20load.gif



The above is an actual scope capture of the output of the CPU driving PWM to the FET gate (in blue), and the output of the FET (in red) while driving a WA1185 bulb on Alan's test M@G D Sled prototype PC Board.

We have prototype hardware running. Alan B's sled board, and wquiles' protoboard. At this point (10/4/2008) we are working on software and calibration, and have worked through a couple of minor problems. Alan built and tested the USBtinyISP programmer. This is a $22 kit for programming the micro. This will be useful for loading the software, changing the parameters, and trying out different versions of the software. Advanced users and builders will want a programmer to have complete control over the software in their flashlights.

Alan has developed software using the Atmel STK500 board. This board has the programming capability, a socket for the CPU, and an LED and switch that can be jumpered to the chip. Using this Alan has developed software that does most of the basic functions - variable levels, voltage regulation, temperature and low battery cutout, etc. This is still in work, but it is doing most of the important functions required for this project.

Prototypes of the hardware are working. JimmyM and Alan are both working on pc boards. Alan's board is made and working, and Jim's test board is designed but not cut yet.

We have a couple of user interfaces including VariLevel Ramped with optional double-click boost, and On/Off. We have soft start. We have RMS feedback regulation.


Next Step:

The calibration problem appears to be solved, so it is about time to package this in a flashlight, and make some 'operational' software versions. The dynamic calibration needs to be finished up. Perhaps a multilevel interface option would be useful. Possibly one or more small PCBs designed to fit inside "C", "D" M@gs or SF M6's. High Power bulb testing would be interesting. Will wants to work on a one button interface and a SF M6 version. Jim wants to try a "high power" version with a driver.


Signup Sheet:

Send me a pm if you want to be added to this list:

Hardware Design: mostly done, here on the forum, by Alan B, JimmyM and That_Guy; with lots of helpful input and encouragement by folks like LuxLuthor, and others.

Hardware Prototyping: Alan B, JimmyM and wquiles working on.

Application Specific versions - wquiles is working on the SF M6 version, and JimmyM is working on a D M@G version to fit under a KIU base.

High Power Testing - Possibly Jim and LuxLuthor?

Software Development: The software is pretty far along at this point. Based on AVR-GCC in WinAVR and AVR Studio for this. All Free software tools. Thus far Software is by Alan B with input and feedback from lots of others.


Test Programs: (these are done)

* FP1: Toggle the FET Gate Output (very slow or 100 hz, 50% duty cycle)
* FP2: Electronic Pushbutton Switch (on/off)
* FP3: Always On, Fixed PWM, Soft Start
* FP4: Pushbutton, Fixed PWM, Soft Start
* FP5: Pushbutton, VariLevel PWM, Soft Start
* FP6: Always On, Regulated, Calibrated, Soft Start
* FP7: Pushbutton, Regulated, Calibrated, Soft Start
* FP8: Test Suite for ADC, PWM, Regulation Algorithms
* FP9: Functional Flashlight Control program with many features


More to come.


Design File Area: (schematics, code, scope traces, data)

http://akbeng.com/flash/hwreg/


References:

The Lightbrain 2002 DIY regulator is very similar to the design goals for this project:
http://lasertagparts.com/lightbrain/free_regulator.htm

AWR HotDriver (soft start, linear):
http://www.cpfmarketplace.com/mp/showthread.php?t=107783

PIR1 PWM Regulator Thread:
https://www.candlepowerforums.com/threads/107211

PIR1 Regulator Manual:
http://greenengineering.se/PIR1/PIRmanual.pdf

Willie Hunt Light Bulb Regulator:
http://www.cs.indiana.edu/~willie/lvr.html

That_Guy Regulator (similar to LightBrain):
http://img169.imageshack.us/img169/5875/pwmregulatorff7.png
http://rapidshare.com/files/87979929/PWM_Regulator.zip.html

JimmyM JM-SST Soft Start:
https://www.candlepowerforums.com/threads/181866

AW Soft Start:
http://candlepowerforums.com/vb/showthread.php?t=166223

Kiu Bipin Socket:
https://www.candlepowerforums.com/threads/171607

(Destructive) Bulb Testing - lots of bulb data:
https://www.candlepowerforums.com/threads/179748

More Bulb Data (for the SF M6, but useful for others):
https://www.candlepowerforums.com/threads/204157

Atmel Tiny85 Microprocessor Info:
http://www.atmel.com/dyn/products/product_card.asp?part_id=3612

Atmel AVR ISP USB Programming Adapter:
http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail?name=ATAVRISP2-ND

AvrFreaks on the Tiny85:
http://www.avrfreaks.net/index.php?module=Freaks Devices&func=displayDev&objectid=102

Low Cost USB programmer (tested, works):
http://www.ladyada.net/make/usbtinyisp/

AvrDude Programming Software (included in WinAVR):
http://www.ladyada.net/make/usbtinyisp/avrdude.html


Application Projects based on this Project's Design:

D M@g Drop-in by Alan B:
https://www.candlepowerforums.com/threads/218506

SF M6 thread by wquiles:
https://www.candlepowerforums.com/threads/215806

D M@g under Kiu Base thread by JimmyM:
https://www.candlepowerforums.com/posts/2743186


eof
 
Last edited:

Alan B

Flashlight Enthusiast
Joined
Nov 19, 2007
Messages
1,963
Location
San Francisco Bay Area
Looks like we overflowed.

I updated the copy of the first post in this thread, the old thread is locked.

This is a pretty good breakpoint, things are working well now.

What do folks want to tackle next?

-- Alan
 
Last edited:

wquiles

Flashaholic
Joined
Jan 10, 2005
Messages
8,459
Location
Texas, USA, Earth
Good summary above Alan - nicely done ;)

As to what do to next, I want to measure a few more things, including the initial surge current peak. I did it last time by differentially measuring the voltage across a 0.01 precision 4-terminal resistor, but of course, I want to do this with a higher power bulb, probably my 1185 and with real batteries (I still don't want to base much on a PS, no mater how good it might be).

Alan, question: have you tried calibrating the ADC using the Vcc input instead of the internal 2.56Vref? I was looking at the specs on the 5V (Vcc) regulator, and they seem a lot tighter than those in the internal 2.56Vref.

Will
 

Alan B

Flashlight Enthusiast
Joined
Nov 19, 2007
Messages
1,963
Location
San Francisco Bay Area
Good summary above Alan - nicely done ;)

As to what do to next, I want to measure a few more things, including the initial surge current peak. I did it last time by differentially measuring the voltage across a 0.01 precision 4-terminal resistor, but of course, I want to do this with a higher power bulb, probably my 1185 and with real batteries (I still don't want to base much on a PS, no mater how good it might be).

Alan, question: have you tried calibrating the ADC using the Vcc input instead of the internal 2.56Vref? I was looking at the specs on the 5V (Vcc) regulator, and they seem a lot tighter than those in the internal 2.56Vref.

Will

It would be nice to see current measurements. I agree on the battery testing. That is the real answer.

I thought about using the 5V but have not tried it. There are a few downsides:

1) it would double the standby current if we maintain the same input impedance to the ADC

2) it would decrease our ESD protection for the ADC input by a factor of two

3) it would probably have more noise on it than the Vref (a guess)

Unless it is good enough to totally avoid calibration, then it isn't really a help. Not sure if it is that good. How good does it have to be? Perhaps plus or minus 0.05V at Vbulb?

I have run the 1185 bulb quite a bit with 10 NiMH C cells, it works quite nicely. Perhaps I can put together a beta flashlight code soon. I'm going to be pretty busy for the next 2 weeks so we'll see what I can get done. I really would like to cut some metal and mount a proto Msled in a M@g, but not sure when I'll be able to do that.

How much room is there in the M6 physically for a PCB? Is it similar to C M@G KIU base? The diameter is large but space is at a premium. Perhaps a PCB with components around the outside and contacts in the center can be sandwiched between bulb springs and battery pack...

-- Alan
 
Last edited:

wquiles

Flashaholic
Joined
Jan 10, 2005
Messages
8,459
Location
Texas, USA, Earth
Alan,

The other thing we need to work on, unless you already have it implemented, is on an usable soft start in the 50-100mS range. For a light that needs to occasionally need to be used for signaling in an emergency, a 1+ second soft start is excessively long. After using the Willie Hunt LVR and the HDM6, I have to agree that the 50-100mS is the "right" target - anything longer takes away from any posible use as a signaling device. There might be other applications that needed the quicker startup, but if Willie Hunt selected 50mS for his LVR and for the Surefire A2, I have to trust his judgement that there is a good reason for it ;)

Will
 

wquiles

Flashaholic
Joined
Jan 10, 2005
Messages
8,459
Location
Texas, USA, Earth
As far as the M6 (& other setups) room, it somewhat depends on the bulb setup & batteries. For example this DM51 shootout has a wide set of variables.

That is exactly why I wanted to tread the M6 as a separate sub-project - talk about options. Plus once you have a regulated soft-start solution such as the PhD, you can then venture into solutions with higher battery voltages that are not possible now due to risk of insta-flash. I am also expecting that the soft-start will allow the use of protected LiIon cells that don't work today due to the protection device triggering upon the initial current surge ;)

Will
 

wquiles

Flashaholic
Joined
Jan 10, 2005
Messages
8,459
Location
Texas, USA, Earth
It would be nice to see current measurements. I agree on the battery testing. That is the real answer.

I thought about using the 5V but have not tried it. There are a few downsides:

1) it would double the standby current if we maintain the same input impedance to the ADC

2) it would decrease our ESD protection for the ADC input by a factor of two

3) it would probably have more noise on it than the Vref (a guess)

Unless it is good enough to totally avoid calibration, then it isn't really a help. Not sure if it is that good. How good does it have to be? Perhaps plus or minus 0.05V at Vbulb?

I have run the 1185 bulb quite a bit with 10 NiMH C cells, it works quite nicely. Perhaps I can put together a beta flashlight code soon. I'm going to be pretty busy for the next 2 weeks so we'll see what I can get done. I really would like to cut some metal and mount a proto Msled in a M@g, but not sure when I'll be able to do that.

How much room is there in the M6 physically for a PCB? Is it similar to C M@G KIU base?

-- Alan

I really think the Vcc regulation "could" be that good, and that it might allow us to forgo the calibration (or use a simpler procedure). At least I feel it might be good enough and make the PhD easier to use.

1) it would double the standby current if we maintain the same input impedance to the ADC
=> We could use the Tiny85's sleep function so current draw would still be insignificant while not in use. While in use, it would not mater, as the drain in the batteries would be at least one or more orders of magnitude larger.

2) it would decrease our ESD protection for the ADC input by a factor of two
=> All circuits we use in flashlights are ESD sensitive - we just have to be carefull.

3) it would probably have more noise on it than the Vref (a guess)
=> From what I measured on my scope, the Vcc was really clean, and did not have any movement/spikes while the FET was switching.

I will try to do more measurements on the Vcc line to gather more data. I just feel it is worth exploring before we require the use to do external calibration.

Will
 

Alan B

Flashlight Enthusiast
Joined
Nov 19, 2007
Messages
1,963
Location
San Francisco Bay Area
I really think the Vcc regulation "could" be that good, and that it might allow us to forgo the calibration (or use a simpler procedure). At least I feel it might be good enough and make the PhD easier to use.

1) it would double the standby current if we maintain the same input impedance to the ADC
=> We could use the Tiny85's sleep function so current draw would still be insignificant while not in use. While in use, it would not mater, as the drain in the batteries would be at least one or more orders of magnitude larger.

2) it would decrease our ESD protection for the ADC input by a factor of two
=> All circuits we use in flashlights are ESD sensitive - we just have to be carefull.

3) it would probably have more noise on it than the Vref (a guess)
=> From what I measured on my scope, the Vcc was really clean, and did not have any movement/spikes while the FET was switching.

I will try to do more measurements on the Vcc line to gather more data. I just feel it is worth exploring before we require the use to do external calibration.

Will

Note that the ADC scaling resistors use current all the time, and they use more than 10x the current of the sleeping CPU. It is not the CPU that is dominating the off current. If there is a 'master off' switch this does not occur. If we changed to the 1.1V Vref we could lower the off current so perhaps we should consider that as well.

Note that we are not locked into the 2.56V Vref, we can support both modes quite easily. In fact, using the R1=47K value with 5V Vcc Vref will put the ADC max voltage to about 25V.

Changing to the Vcc Vref is trivial to try, only two things need to be changed in the software. I will leave that as an exercise for others for the moment while I pursue some code cleanup and completion. Simplifying calibration is part of that, I need to finish the dynamic calibration. I believe calibration will be necessary, so making it easy is a requirement.

Calibration

Calibration is a process the BUILDER needs to complete to adjust for the actual component values used in the circuit - to compensate for the resistors and the CPU chip manufacturing variations. If the regulator is a kit, then the kit builder will need to calibrate it. If built by a vendor, the vendor will complete this calibration and the end user will not be burdened.

Here is an example simple calibration process:

1) Measure battery voltage with a normal averaging DC Multimeter. In a precalculated chart look up the battery voltage and get the Average Calibration Value to adjust to.

2) Plug a resistor into the bulb socket (instead of a bulb), and connect the DC Multimeter across the resistor.

3) Adjust the calibration until the Multimeter reads the chart value.

-- Alan
 

Alan B

Flashlight Enthusiast
Joined
Nov 19, 2007
Messages
1,963
Location
San Francisco Bay Area
Alan,

The other thing we need to work on, unless you already have it implemented, is on an usable soft start in the 50-100mS range. For a light that needs to occasionally need to be used for signaling in an emergency, a 1+ second soft start is excessively long. After using the Willie Hunt LVR and the HDM6, I have to agree that the 50-100mS is the "right" target - anything longer takes away from any posible use as a signaling device. There might be other applications that needed the quicker startup, but if Willie Hunt selected 50mS for his LVR and for the Surefire A2, I have to trust his judgement that there is a good reason for it ;)

Will

I have this implemented, but not fully tested.

-- Alan
 

wquiles

Flashaholic
Joined
Jan 10, 2005
Messages
8,459
Location
Texas, USA, Earth
Thanks much Alan - I did not realized the 10x factor in current :ohgeez:

Let us know when your code is ready for the next round of testing :twothumbs

Question: What is the current plan for the external calibration: Is the calibration going to be implemented with an external pot, or via additional "+" and "-" push buttons? How will the builder put the PhD in and out of "calibration mode"? If using buttons, some multiple button combination, such as pressing the "+" and "-" at the same time?

Will
 

Alan B

Flashlight Enthusiast
Joined
Nov 19, 2007
Messages
1,963
Location
San Francisco Bay Area
Thanks much Alan - I did not realized the 10x factor in current :ohgeez:

Let us know when your code is ready for the next round of testing :twothumbs

Question: What is the current plan for the external calibration: Is the calibration going to be implemented with an external pot, or via additional "+" and "-" push buttons? How will the builder put the PhD in and out of "calibration mode"? If using buttons, some multiple button combination, such as pressing the "+" and "-" at the same time?

Will

Let's review the current and see if I did that right. 25V/110K = 225uA. At 12V it is better if you are using 100K, but if using 47K it is about the same. If we go to 5V and maintain the same impedance to the ADC pins we have to double the current to achieve 5V across the 10K. 10K is the recommended impedance to feed the ADC. We can probably go higher, that would be something to try out and see how it affects regulation and noise. It should increase noise a bit, but it may not be too bad. Something to try.

My Msled has three pushbuttons on a separate plug-in board used for calibration and programming. I'll do that one first. UP cal, Down cal and Control buttons. Since that board gets removed for operation the cal buttons can be 'live' all the time, but it only makes sense to cal at VLO and VHI since anywhere else there's no reference to cal against, so I limit the cal operation to those moments when Vbulb is at VLO and VHI.

For the single button folks I was thinking about a jumper on the programming pins that would put it into the cal mode and output a cal value which would be VHI. In this mode each push-hold of the control button would change the cal factor in the opposite direction. So by tap-holding you could get any cal value. Then Idle the light for a few seconds to make sure the cal factor is saved in eeprom (saves when idle), then remove power, remove jumper.

The external pot cal is always possible. You can do that right now. Add the pot, adjust the program, and you're there. Screwdriver cal. Jim may want to put that on his test board as well, then that board has complete options.

How does that sound?

-- Alan
 

wquiles

Flashaholic
Joined
Jan 10, 2005
Messages
8,459
Location
Texas, USA, Earth
Let's review the current and see if I did that right. 25V/110K = 225uA. At 12V it is better if you are using 100K, but if using 47K it is about the same. If we go to 5V and maintain the same impedance to the ADC pins we have to double the current to achieve 5V across the 10K. 10K is the recommended impedance to feed the ADC. We can probably go higher, that would be something to try out and see how it affects regulation and noise. It should increase noise a bit, but it may not be too bad. Something to try.

My Msled has three pushbuttons on a separate plug-in board used for calibration and programming. I'll do that one first. UP cal, Down cal and Control buttons. Since that board gets removed for operation the cal buttons can be 'live' all the time, but it only makes sense to cal at VLO and VHI since anywhere else there's no reference to cal against, so I limit the cal operation to those moments when Vbulb is at VLO and VHI.

For the single button folks I was thinking about a jumper on the programming pins that would put it into the cal mode and output a cal value which would be VHI. In this mode each push-hold of the control button would change the cal factor in the opposite direction. So by tap-holding you could get any cal value. Then Idle the light for a few seconds to make sure the cal factor is saved in eeprom (saves when idle), then remove power, remove jumper.

The external pot cal is always possible. You can do that right now. Add the pot, adjust the program, and you're there. Screwdriver cal. Jim may want to put that on his test board as well, then that board has complete options.

How does that sound?

-- Alan


OK, sounds like playing with Vref = Vcc could be a little interesting. If I decide to play with it, have to change the #define VREF from 2.56 to 5.0, and on the ADMUX register, I should delete both bits REFS2 and REGS1 to select Vcc - is that it?

That Msled of yours is cool with the extra buttons - nice going. As to the single button interface, yes, that would be outstanding. Using a single jumper to get it in that mode, and then using the single button to get any value. Brilliant, and safe, as once done, you remove the jumper, so during use there would be no problem getting into this mode by "accident" :D

I would prefer the extra button or single jumper to program the calibration factor than the external pot, but that is just me. I guess boards can be built both ways depending on individual preferences ;)

Will
 
Last edited:

Alan B

Flashlight Enthusiast
Joined
Nov 19, 2007
Messages
1,963
Location
San Francisco Bay Area
OK, sounds like playing with Vref = Vcc could be a little interesting. If I decide to play with it, have to change the #define VREF from 2.56 to 5.0, and on the ADMUX register, I should delete both bits REFS2 and REGS1 to select Vcc - is that it?

That Msled of yours is cool with the extra buttons - nice going. As to the single button interface, yes, that would be outstanding. Using a single jumper to get it in that mode, and then using the single button to get any value. Brilliant, and safe, as once done, you remove the jumper, so during use there would be no problem during operation :D

I would prefer the extra button or single jumper to program the calibration factor than the external pot, but that is just me. I guess boards can be built both ways depending on individual preferences ;)

Will

On Vcc Vref, that sounds about right - I didn't check the bits, but that's where the change needs to be, and the define, as you noted. Put one of the test programs into ADC to PWM output mode and vary the supply voltage and correlate it with the PWM ontime to see what the ADC is getting. It should be about half the usual value.

On the cal pot - it can be provided for on the PCB and just jumpered out when not used.

-- Alan
 

wquiles

Flashaholic
Joined
Jan 10, 2005
Messages
8,459
Location
Texas, USA, Earth
Alan,

I changed those two statements to try using Vcc. Just to check the initial divergence, I am using Vcal=1.0. R1 is now 47K (from 100K) since I need a larger voltage at the ADC input. Using:
#define VRED 5.0,
#define VOLTAGES,
#define SCOPETRIG, and
#define INTEGRAL options.

At startup (voltage on Fluke): 0.180 Volts (low accuracy)
Press (volts on Fluke):
1 0.324 Volts (larger, but still low accuracy)
2 1.69 Volts (here we go)
3 2.79 Volts
4 3.77 Volts
5 4.78 Volts
6 5.75 Volts
7 6.79 Volts
8 7.77 Volts
9 8.73 Volts
10 9.73 Volts
11 10.72 Volts
12 11.68 Volts
13 0.180 Volts (goes back to startup)

So it looks like it tracks just OK, and just like you expected, even using Vcc would require some calibration factor :shakehead

Not all lost - at least I learned a little bit more about the Tiny85's registers ;)

Will
 

wquiles

Flashaholic
Joined
Jan 10, 2005
Messages
8,459
Location
Texas, USA, Earth
I played with it some more (using Vcc as a ref), and it looks like I need VCAL equal to about 1.03

At startup (voltage on Fluke): 0.180 Volts (low accuracy)
Press (volts on Fluke):
1 0.324 Volts (larger, but still low accuracy)
2 1.89 Volts (here we go)
3 2.92 Volts
4 3.87 Volts
5 5.01 Volts
6 5.99 Volts
7 6.99 Volts
8 7.96 Volts
9 8.97 Volts
10 10.07 Volts
11 11.06 Volts
12 12.02 Volts
13 0.180 Volts (goes back to startup)

So bottom line, from this very limited data sample, I "still" need a correction factor, but the value is smaller (1.03) than when using the internal 2.56V reference (1.115). Maybe not worth the trouble to change the ref, but it was fun to do ;)

Will
 

Alan B

Flashlight Enthusiast
Joined
Nov 19, 2007
Messages
1,963
Location
San Francisco Bay Area
I played with it some more (using Vcc as a ref), and it looks like I need VCAL equal to about 1.03

...
So bottom line, from this very limited data sample, I "still" need a correction factor, but the value is smaller (1.03) than when using the internal 2.56V reference (1.115). Maybe not worth the trouble to change the ref, but it was fun to do ;)

Will

Excellent experiment and congratulations on your first "mod" to the software. I have done some work on the code but it is not complete nor have I tested it for more than compiler errors yet.

I would think that putting in the actual measured values for Vcc and the resistors should yield pretty close calibration.

-- Alan
 

Alan B

Flashlight Enthusiast
Joined
Nov 19, 2007
Messages
1,963
Location
San Francisco Bay Area
MagSled%20in%20Test.JPG


Above is a recent photo of the M@gSled Prototype in Test. The Programming/Calibration daughterboard is plugged in and the three pushbuttons and programming jack are visible toward the left. The USBtinyISP programming cable is visible low center.

-- Alan
 

wquiles

Flashaholic
Joined
Jan 10, 2005
Messages
8,459
Location
Texas, USA, Earth
Excellent experiment and congratulations on your first "mod" to the software. I have done some work on the code but it is not complete nor have I tested it for more than compiler errors yet.
Thank - I am getting more comfortable and adventurous with the Tiny85. But the biggest help is that you took the time to write good in-line documentation :thumbsup:



I would think that putting in the actual measured values for Vcc and the resistors should yield pretty close calibration.
I will try that tonight. It will be interesting to see how "close" we can get ;)



...

Above is a recent photo of the M@gSled Prototype in Test. The Programming/Calibration daughterboard is plugged in and the three pushbuttons and programming jack are visible toward the left. The USBtinyISP programming cable is visible low center.
That looks "really" cool :twothumbs
 

wquiles

Flashaholic
Joined
Jan 10, 2005
Messages
8,459
Location
Texas, USA, Earth
I would think that putting in the actual measured values for Vcc and the resistors should yield pretty close calibration.

Here is the data using the actual Vcc and resistor values that I have:
Vcc=4.967Volts
R1=46.2K (instead of 47K)
R3=9.98K (instead of 10K)
Vcal = 1.0 (no adjustment - just for this experiment)

At startup (voltage on Fluke): 0.179 Volts (low accuracy)
Press (volts on Fluke):
1 0.322 Volts (larger, but still low accuracy)
2 1.89 Volts (here we go)
3 2.92 Volts
4 3.87 Volts
5 4.86 Volts
6 5.87 Volts
7 6.89 Volts
8 7.87 Volts
9 8.97 Volts
10 9.96 Volts
11 10.93 Volts
12 11.93 Volts
13 0.180 Volts (goes back to startup)

Not right on the money, but not bad either. I imagine that with a tiny bump (Vcal = 1.01) we might be spot on again ;)

Will
 
Status
Not open for further replies.
Top