solve system of equations for 2 point gain offset compensation [closed]
Thanks for the hint.
Subtracting the offset: $$ {V_{measured2} - V_{measured1} = GV_{ref2}-GV_{ref1}} + offset - offset$$ $$ {V_{measured2} - V_{measured1} = GV_{ref2}-GV_{ref1}}$$ $$ {V_{measured2} - V_{measured1} = G(V_{ref2}-V_{ref1}})$$ $$ G = {V_{measured2} - V_{measured1}\over V_{ref2}-V_{ref1}}$$
Solving offset by putting G in the first equation: $$V_{measured1} ={V_{measured2} - V_{measured1}\over V_{ref2}-V_{ref1}}V_{ref1}+offset$$
I got stuck not knowing how to optimize the equation. This is done by removing the denominator and removing the double term.
$$V_{measured1}(V_{ref2}-V_{ref1}) =({V_{measured2} - V_{measured1}})V_{ref1}+offset(V_{ref2}-V_{ref1})$$
$$V_{measured1}V_{ref2} \mathbf{ -V_{measured1}V_{ref1}} ={V_{measured2}V_{ref1} \mathbf{- V_{measured1}V_{ref1}}} +offset(V_{ref2}-V_{ref1})$$
Rearrange:
$$V_{measured1}V_{ref2} ={V_{measured2}V_{ref1}} + offset(V_{ref2}-V_{ref1})$$ $$V_{measured1}V_{ref2} - {V_{measured2}V_{ref1}} = offset(V_{ref2}-V_{ref1})$$
$$offset = {V_{measured1}V_{ref2}-V_{measured2}V_{ref1} \over V_{ref2} - V_{ref1} }$$