Thank you for an excellent write up.
I am worried about how I am using the onboard temperature sensor, which tries to regulate a heat source several millimeters away. I may be too decoupled from the heat source and think I ought to use a thermistor right up against the heat source for a much more accurate and precise PI controlling mechanism.
Currently, in my application I am not calibrating anything. I am not using the bandgap value in any way. I use processor expert to set up my AD signals. My current set up is the following:
A/D Resolution: 12 Bits
Conversion Time: 3.548387 µs
Low-Power Mode: Disabled
High-speed conversion mode: Enabled
Asynchro clock output: Disabled
Sample time: 0 = short
System Clocks
Core clock: 47.972352 MHz
Bus clock: 23.986176 MHz
All I do is take a AD measurement every 50 milliseconds and run the returning 12 bit value into a PI controller routine where the setpoint for my routine is set as a number to compare against the OnBoard Temperature Sensor AD reading.
I have an excel table with a long set of possible AD values for the temperature sensor. In the adjacent column are the temperature values representing those AD values. I am assuming a fixed Vref of 3.2V (I know this can vary and is the cause for much of my accuracy, but let's ignore that for now and assume ±0V tolerance on my reference).
So if my AD value is 838, my temperature on the sensor should be 62.5°C ±X°C. I don't know my X.
Temp = 25 - [(Vtemp - Vtemp25) / m)]
Vtemp = 838 * 3.2V / 4096
Vtemp = 0.654688
Temp = 25 - [(0.654688 - 0.719) / 0.001715]
Temp = 62.5°C
So in my code I just set my setpoint to 838 for the PI controller.
Now if I have several devices with this algorithm running, they all settle out at different powers but all have the same setpoint value. Therefore I believe that from device to device the microcontroller in each interprets the AD reading of 838 as different temperatures. I have not established the accuracy of my on board temperature sensor.
I believe if I move to using a thermistor right next to my heat source, then I am no longer restrained to the accuracy of my reference voltage since my voltage supplying power through the thermistor would be an output from the microcontroller and a 1% resistor for my thermistor divider. This way it is nothing more than a ratio of my voltage reference for specific temperatures.
Any comments or suggestions?
Thanks