[time-nuts] uC ADC resolution (was: Poor man's oven)

Bob kb8tq kb8tq at n1k.org
Sat Jun 10 15:20:35 EDT 2017


Hi

At least in my experience, a properly functioning OCXO will rarely (if ever) be outside +/- 1 degree of the 
set point when in full PID (integrator enabled) mode. You may well use a custom set of control parameters
for the warmup phase. You might even use a non-PID based control (shut off all power when these things 
happen. Then coast to the set point …). I suppose that like many of my posts, the term “fuzzy logic” could
easily be used in more than one way :)

Bob


> On Jun 10, 2017, at 3:10 PM, Magnus Danielson <magnus at rubidium.dyndns.org> wrote:
> 
> Hi,
> 
> Very good point Poul-Henning, very good point.
> The mux is there, we don't need the resolution far out, and with only a little though code-wise and hardware wise we get the best of resolution and range where we need it.
> 
> Cheers,
> Magnus
> 
> On 06/10/2017 09:06 PM, Poul-Henning Kamp wrote:
>> --------
>> In message <3897C09A-D76C-474C-8907-9EA25F8C3451 at n1k.org>, Bob kb8tq writes:
>> 
>>> The “limited range” part of it is why the op-amp makes so much
>>> sense. If the ADC can “see” +/-10C that’s way more than will ever be useful.
>> 
>> Most uC's have a pile of mux'ed ADC inputs, so do all of the above:
>> 
>> AI0 = Full range
>> 
>> AI1 = +/- 10C
>> 
>> AI2 = +/- 2C
>> 
>> A big upside to this is that you will not need to invent heuristics
>> for clamped inputs in your PI(D) controller, something which is a bit
>> harder than most people realize.
>> 
>> Assuming a 10-bit ADC, the code will look something like this:
>> 
>> 	double
>> 	get_temp(void)
>> 	{
>> 
>> 		T = read_AI2();
>> 		if (T > 50 && T < 975) {
>> 			T += T2_offset;
>> 			T *= T2_scale;
>> 			return (T);
>> 		}
>> 		T = read_AI1();
>> 		if (T > 50 && T < 975) {
>> 			T += T1_offset;
>> 			T *= T1_scale;
>> 			return (T);
>> 		}
>> 		T = read_AI0();
>> 		if (T > 50 && T < 975) {
>> 			T += T0_offset;
>> 			T *= T0_scale;
>> 			return (T);
>> 		}
>> 		abort("You have problems...");
>> 	}
>> 
> _______________________________________________
> time-nuts mailing list -- time-nuts at febo.com
> To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
> and follow the instructions there.



More information about the time-nuts mailing list