--------
In message <3897c09a-d76c-474c-8907-9ea25f8c3...@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...");
        }

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
p...@freebsd.org         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.
_______________________________________________
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.

Reply via email to