#### ## ## ## ## ## ## ####
#### ## ## ## ####
__ __ \ \ / / \ V / | | |_|
_____ / __ \ | / \/ | | | \__/\ \____/
_____ | __ \ | | | | | | | | | |__| | |_____/
IMPORTANT: enter the case-INsensitive alphabetic (no numbers) code AND WRITE SOME SHORT summary of changes (below) if you are saving changes. (not required for previewing changes). Wiki-spamming is not tolerated, will be removed, so it does NOT even show up in history. Spammers go away now. Visit Preferences to set your user name Summary of change: problem --- 3 analog inputs from 0 to 5 volts 1 output from 0 - 5 volts ---- 3 inputs defined as i1,i2,i3 1 output defined as o1 if i1 =0 and i2 = 4 and i3 =0.1 then o1 = 1.1 if i1 =0 and i2 = 2 and i3 =0.1 then o1 = 1.2 if i1 =3 and i2 = 4 and i3 =0.2 then o1 = 3.1 if i1 =1 and i2 = 4 and i3 =0.3 then o1 = 2.1 many of these contraint: no DAC or microprocessor. Obviously they want an OPA solution. I expected to find a linear relationship which is damn easy with OPA-s: <code> octave:1> o=[1.1 , 1.2, 3.1, 2.1]; octave:2> x=[0, 4, 0.1; 0,2,0.1; 3,4,0.2; 1,4,0.3]; check only a 3x3 (upper sub-) matrix so inverse can be calculated: octave:3> o1=[1.1 , 1.2, 3.1]; octave:4> x1=[0, 4, 0.1; 0,2,0.1; 3,4,0.2]; a1=inverse(x1) * o1' a1 = 0.233333 -0.050000 13.000000 quick verification with 3d line: octave:13> 3*0.23333 + 4*-0.05 + 0.2*13 ans = 3.1000 OK. Let's see if 4th line also matches: octave:14> 1*0.23333 + 4*-0.05 + 0.3*13 ans = 3.9333 No, this is not 2.1. </code> The trick is to make an additive offset. Unfortunately to find this offset is non-trivial in matrix operations. You can experiment a little, and maybe there is a one-step octave solution as well, that just requires lower beer-level. Optional: Add document to category: Wiki formatting: * is Bullet list ** Bullet list subentry ... '''Bold''', ---- is horizontal ruler, <code> preformatted text... </code> See wiki editing HELP for tables and other formatting tips and tricks.