Position/shape control
	Shape specified:
		analytically
			R=R0+a*cos[theta+delta*sin(theta)-lambda*sin(2*theta)]
			z=z0+a*kappa*sin(theta)
		or drawn
	Coils used in position and shape control: the combinations that make
	  up the actuators must be orthogonal; a set of remaining orthogonal 
	  combinations is then controlled by feedback on the current 
	  combinations themselves
		the combinations (including those that are not used because
		  replaced by the position controls, although in fact they are
		  all used in the first matrix) must be orthogonal; in addition,
		  the corresponding G matrix elements constitute the transpose
		  matrix, with factors adjusted so that A*G = unity (for the
		  16 coil current observers only)
		note about current signs (for normal Ip):
			+F2+F3+F4+F5+F6+F7 increases r
			-F2-F3+F6+F7 increases z
			+F2-F4-F5+F7 increases kappa
	   iscramb=1
		coils:
			z=-0.23:	mu3=F2, mu4=F5
			z=0:		mu3=F3, mu4=F6
			z=+0.23:	mu3=F4, mu4=F7
		A matrix (and reference)
			+mu3-mu4 coil currents -> observer #mu3
			+mu3+mu4 coil currents -> observer #mu4
			all other coil currents -> observer w. same number
		G matrix
			vertical observer -> +mu3-mu4 coil currents
			radial observer -> +mu3+mu4 coil currents
			observers #mu3 and #mu4 -> unused
			all other coil current observers -> coil w. same number
			when vert. and radial turned off (first matrix):
				observer #mu3 -> +mu3-mu4 coil currents
				observer #mu4 -> +mu3+mu4 coil currents
	   iscramb=2
		coils:
			z=-0.23:	moh1=F1, mu3=F2, mu4=F5, moh4=F6
			z=0:		moh1=F2, mu3=F3, mu4=F6, moh4=F7
			z=+0.23:	moh1=F3, mu3=F4, mu4=F7, moh4=F8
		A matrix (and reference)
			+moh1-mu3 coil currents -> observer #moh1
			+moh4-mu4 coil currents -> observer #moh4
			+moh1+mu3 coil currents -> observer #mu3
			+moh4+mu4 coil currents -> observer #mu4
			other 12 coil currents -> observer w. same number
		G matrix
			vertical observer -> -moh1-mu3+mu4+moh4 coil currents
			radial observer -> +moh1+mu3+mu4+moh4 coil currents
			observer #moh1 -> +moh1-mu3 coil currents
			observer #moh4 -> +moh4-mu4 coil currents
			observers #mu3 and #mu4 -> unused
			other 12 coil current observers -> coil w. same number
			when vert. and radial turned off (first matrix):
				observer #mu3 -> +moh1+mu3 coil currents
				observer #mu4 -> +moh4+mu4 coil currents
	   iscramb=3
	     z>0
		A matrix (and reference)
			-F2-F3+F7+F8 coil currents -> observer 16
			+F2+F4+F6+F8 coil currents (w. weights) -> observer 12
			+F2-F3+F7-F8 coil currents -> observer 10
			+F2-F4-F6+F8 coil currents (w. weights) -> observer 11
			-F4+F6 coil currents -> observer 14
			+F3+F7 coil currents -> observer 15
			other 10 coil currents -> observer w. same number
		G matrix
			vertical observer -> -F2-F3+F7+F8 coil currents
			radial observer -> +F2+F4+F6+F8 coil currents (w. 
			  weights)
			observer 10 -> +F2-F3+F7-F8 coil currents 
			observer 11 -> +F2-F4-F6+F8 coil currents (w. weights)
			observer 14 -> -F4+F6 coil currents
			observer 15 -> +F3+F7 coil currents
			observers 16 and 12 -> unused
			other 10 coil current observers -> coil w. same number
			when vert. and radial turned off (first matrix):
				observer 16 -> -F2-F3+F7+F8 coil currents
				observer 12 -> +F2+F4+F6+F8 coil currents (w.
				  weights)
	     z<0
		A matrix (and reference)
			-F1-F2+F6+F7 coil currents -> observer 16
			+F1+F3+F5+F7 coil currents (w. weights) -> observer 12
			+F1-F3+F6-F7 coil currents -> observer 10
			+F1-F4-F5+F7 coil currents (w. weights) -> observer 11
			-F3+F5 coil currents -> observer 14
			+F2+F6 coil currents -> observer 15
			other 10 coil currents -> observer w. same number
		G matrix
			vertical observer -> -F1-F2+F6+F7 coil currents
			radial observer -> +F1+F3+F5+F7 coil currents (w. 
			  weights)
			observer 10 -> +F1-F2+F6-F7 coil currents 
			observer 11 -> +F1-F3-F5+F7 coil currents (w. weights)
			observer 14 -> -F3+F5 coil currents
			observer 15 -> +F2+F6 coil currents
			observers 16 and 12 -> unused
			other 10 coil current observers -> coil w. same number
			when vert. and radial turned off (first matrix):
				observer 16 -> -F1-F2+F6+F7 coil currents
				observer 12 -> +F1+F3+F5+F7 coil currents (w.
				  weights)
	   iscramb=4
		A matrix (and reference)
			-F1-F2+F7+F8 coil currents -> observer 16
			+F2+F3+F6+F7 coil currents -> observer 11
			-F1+F2-F7+F8 coil currents -> observer 10
			+F2-F3-F6+F7 coil currents -> observer 9
			-F3+F6 coil currents -> observer 14
			+F1+F8 coil currents -> observer 15
			other 10 coil currents -> observer w. same number
		G matrix
			vertical observer -> -F1-F2+F7+F8 coil currents
			radial observer -> +F2+F3+F6+F7 coil currents 
			observer 10 -> -F1+F2-F7+F8 coil currents 
			observer 9 -> +F2-F3-F6+F7 coil currents 
			observer 14 -> -F3+F6 coil currents
			observer 15 -> +F1+F8 coil currents
			observers 16 and 11 -> unused
			other 10 coil current observers -> coil w. same number
			when vert. and radial turned off (first matrix):
				observer 16 -> -F1-F2+F7+F8 coil currents
				observer 11 -> +F2+F3+F6+F7 coil currents 
	   iscramb=5
		A matrix (and reference)
			-F3-F4+F6+F7 coil currents -> observer 16
			+F2+F4+F6+F8 coil currents (w. weights) -> observer 12
			-F3+F4-F6+F7 coil currents -> observer 10
			-F2+F4+F6-F8 coil currents (w. weights) -> observer 11
			-F2+F8 coil currents -> observer 14
			+F3+F7 coil currents -> observer 15
			other 10 coil currents -> observer w. same number
		G matrix
			vertical observer -> -F3-F4+F6+F7 coil currents
			radial observer -> +F2+F4+F6+F8 coil currents (w. 
			  weights)
			observer 10 -> -F3+F4-F6+F7 coil currents 
			observer 11 -> -F2+F4+F6-F8 coil currents (w. weights)
			observer 14 -> -F2+F8 coil currents
			observer 15 -> +F3+F7 coil currents
			observers 16 and 12 -> unused
			other 10 coil current observers -> coil w. same number
			when vert. and radial turned off (first matrix):
				observer 16 -> -F3-F4+F6+F7 coil currents
				observer 12 -> +F2+F4+F6+F8 coil currents (w.
				  weights)
	   iscramb=6
		A matrix (and reference)
			-F3-F4+F5+F6 coil currents -> observer 16
			+F1+F3+F6+F8 coil currents (w. weights) -> observer 12
			+F3-F4+F5-F6 coil currents -> observer 11
			-F1+F3+F6-F8 coil currents (w. weights) -> observer 9
			-F1+F8 coil currents -> observer 13
			+F4+F5 coil currents -> observer 14
			other 10 coil currents -> observer w. same number
		G matrix
			vertical observer -> -F3-F4+F5+F6 coil currents
			radial observer -> +F1+F3+F6+F8 coil currents (w. 
			  weights)
			observer 11 -> +F3-F4+F5-F6 coil currents 
			observer 9 -> -F1+F3+F6-F8 coil currents (w. weights)
			observer 13 -> -F1+F8 coil currents
			observer 14 -> +F4+F5 coil currents
			observers 16 and 12 -> unused
			other 10 coil current observers -> coil w. same number
			when vert. and radial turned off (first matrix):
				observer 16 -> -F3-F4+F5+F6 coil currents
				observer 12 -> +F1+F3+F6+F8 coil currents (w.
				  weights)
	   iscramb=7
		A matrix (and reference)
			+F3-F4 coil currents -> observer 11
			-F6+F7 coil currents -> observer 15
			+F3+F4 coil currents -> observer 12
			+F6+F7 coil currents -> observer 14
			other 12 coil currents -> observer w. same number
		G matrix
			vertical observer -> -F3-F4+F6+F7 coil currents
			radial observer -> +F3+F4+F6+F7 coil currents
			observer 11 -> +F3-F4 coil currents
			observer 15 -> -F6+F7 coil currents
			observers 12 and 14 -> unused
			other 12 coil current observers -> coil w. same number
			when vert. and radial turned off (first matrix):
				observer 12 -> +F3+F4 coil currents
				observer 14 -> +F6+F7 coil currents
	   iscramb=8
		A matrix (and reference)
			-F4-F5+F6+F7 coil currents -> observer 13
			+F4+F5+F6+F7 coil currents (w. weights) -> observer 14
			+F4-F5+F6-F7 coil currents -> observer 12
			+F4-F5-F6+F7 coil currents (w. weights) -> observer 15
			other 12 coil currents -> observer w. same number
		G matrix
			vertical observer -> -F4-F5+F6+F7 coil currents
			radial observer -> +F4+F5+F6+F7 coil currents (w. 
			  weights)
			observer 12 -> +F4-F5+F6-F7 coil currents
			observer 15 -> +F4-F5-F6+F7 coil currents (w. weights)
			observers 13 and 14 -> unused
			other 12 coil current observers -> coil w. same number
			when vert. and radial turned off (first matrix):
				observer 13 -> -F4-F5+F6+F7 coil currents
				observer 14 -> +F4+F5+F6+F7 coil currents (w.
				  weights)
	   iscramb=9
		A matrix (and reference)
			-F3-F4+F7+F8 coil currents -> observer 16
			+F4+F5+F6+F7 coil currents (w. weights) -> observer 13
			-F3+F4-F7+F8 coil currents -> observer 12
			+F4-F5-F6+F7 coil currents (w. weights) -> observer 11
			-F5+F6 coil currents -> observer 14
			+F3+F8 coil currents -> observer 15
			other 10 coil currents -> observer w. same number
		G matrix
			vertical observer -> -F3-F4+F7+F8 coil currents
			radial observer -> +F4+F5+F6+F7 coil currents (w. 
			  weights)
			observer 12 -> -F3+F4-F7+F8 coil currents 
			observer 11 -> +F4-F5-F6+F7 coil currents (w. weights)
			observer 14 -> -F5+F6 coil currents
			observer 15 -> +F3+F8 coil currents
			observers 16 and 13 -> unused
			other 10 coil current observers -> coil w. same number
			when vert. and radial turned off (first matrix):
				observer 16 -> -F3-F4+F7+F8 coil currents
				observer 13 -> +F4+F5+F6+F7 coil currents (w. 
				  weights)
	   iscramb=10
		A matrix (and reference)
			-F5-F6+F7+F8 coil currents -> observer 14
			+F5+F6+F7+F8 coil currents (w. weights) -> observer 15
			+F5-F6+F7-F8 coil currents -> observer 13
			+F5-F6-F7+F8 coil currents (w. weights) -> observer 16
			other 12 coil currents -> observer w. same number
		G matrix
			vertical observer -> -F5-F6+F7+F8 coil currents
			radial observer -> +F5+F6+F7+F8 coil currents (w. 
			  weights)
			observer 13 -> +F5-F6+F7-F8 coil currents
			observer 16 -> +F5-F6-F7+F8 coil currents (w. weights)
			observers 14 and 15 -> unused
			other 12 coil current observers -> coil w. same number
			when vert. and radial turned off (first matrix):
				observer 14 -> -F5-F6+F7+F8 coil currents
				observer 15 -> +F5+F6+F7+F8 coil currents (w.
				  weights)
	   iscramb=12
		coils:
			z=-0.23: moh1=F1,mu3=F2,moh2=F3,moh3=F4,mu4=F5,moh4=F6
			z=0:	 moh1=F2,mu3=F3,moh2=F4,moh3=F5,mu4=F6,moh4=F7
			z=+0.23: moh1=F3,mu3=F4,moh2=F5,moh3=F6,mu4=F7,moh4=F8
		A matrix (and reference)
			-moh1-mu3+mu4+moh4 coil currents -> observer #moh3
			+moh1+mu3+moh2+moh3+mu4+moh4 coil currents -> observer 
			  #moh1
			+moh1-moh2-moh3+moh4 coil currents -> observer #moh4
			-moh1+mu3-mu4+moh4 coil currents -> observer #mu3
			-moh2+moh3 coil currents -> observer #moh2
			+moh1-2*mu3+moh2+moh3-2*mu4+moh4 coil currents -> 
			  observer #mu4
			other 10 coil currents -> observer w. same number
		G matrix
			vertical observer -> -moh1-mu3+mu4+moh4 coil currents
			radial observer -> +moh1+mu3+moh2+moh3+mu4+moh4 coil 
			  currents
			kappa observer -> +moh1-moh2-moh3+moh4 coil currents
			observer #mu3 -> -moh1+mu3-mu4+moh4 coil currents
			observer #moh2 -> -moh2+moh3 coil currents
			observer #mu4 -> +moh1-2*mu3+moh2+moh3-2*mu4+moh4 coil 
			  currents
			observers #moh3, #moh1 and #moh4 -> unused
			other 10 coil current observers -> coil w. same number
			when vert. and radial turned off (first matrix):
				observer #moh3 -> -moh1-mu3+mu4+moh4 coil 
				  currents
				observer #moh1 -> +moh1+mu3+moh2+moh3+mu4+moh4 
				  coil currents
			when kappa turned off (all but fifth matrix):
				observer #moh4 -> +moh1-moh2-moh3+moh4 coil
				  currents
	   iscramb=13
	   	[this is probably not complete: there should be separate 
		  weighting of E vs. F and radial near vs. far; instead there is
		  only one weighting parameter]
		A matrix (and reference)
			-F2-F3+F7+F8 coil currents -> observer 16
			+E2-E4-E6+E8+F2+F4+F6+F8 coil currents (w. weights) ->
			  observer 12
			+E2+E4+E6+E8 coil currents -> observer 6
			+F2-F3+F7-F8 coil currents -> observer 10
			+F2-F4-F6+F8 coil currents (w. weights) -> observer 11
			+E2-E4-E6+E8-F2-F4-F6-F8 coil currents (w. weights) ->
			  observer 8
			-F4+F6 coil currents -> observer 14
			+F3+F7 coil currents -> observer 15
			+E2-E8 coil currents -> observer 2
			+E4-E6 coil currents -> observer 4
			other 6 coil currents -> observer w. same number
		G matrix
			vertical observer -> -F2-F3+F7+F8 coil currents
			radial observer -> +E2-E4-E6+E8+F2+F4+F6+F8 coil 
			  currents (w. weights)
			observer 6 -> +E2+E4+E6+E8 coil currents 
			observer 10 -> +F2-F3+F7-F8 coil currents
			observer 11 -> +F2-F4-F6+F8 coil currents (w. weights)
			observer 8 -> +E2-E4-E6+E8-F2-F4-F6-F8 coil currents
			  (w. weights)
			observer 14 -> -F4+F6 coil currents
			observer 15 -> +F3+F7 coil currents
			observer 2 -> +E2-E8 coil currents
			observer 4 -> +E4-E6 coil currents
			observers 16 and 12 -> unused
			other 6 coil current observers -> coil w. same number
			when vert. and radial turned off (first matrix):
				observer 16 -> -F2-F3+F7+F8 coil currents
				observer 12 -> +E2-E4-E6+E8+F2+F4+F6+F8 coil 
				  currents (w. weights)
	   iscramb=14
		A matrix (and reference)
			-F1-F2+F7+F8 coil currents -> observer 16
			+E1-E4-E5+E8+F2+F3+F6+F7 coil currents (w. weights) ->
			  observer 11
			+E1+E4+E5+E8 coil currents -> observer 5
			-F1+F2-F7+F8 coil currents -> observer 10
			+F2-F3-F6+F7 coil currents -> observer 9
			+E1-E4-E5+E8-F2-F3-F6-F7 coil currents (w. weights) ->
			  observer 8
			-F3+F6 coil currents -> observer 14
			+F1+F8 coil currents -> observer 15
			+E1-E8 coil currents -> observer 1
			+E4-E5 coil currents -> observer 4
			other 6 coil currents -> observer w. same number
		G matrix
			vertical observer -> -F1-F2+F7+F8 coil currents
			radial observer -> +E1-E4-E5+E8+F2+F3+F6+F7 coil 
			  currents (w. weights)
			observer 5 -> +E1+E4+E5+E8 coil currents 
			observer 10 -> -F1+F2-F7+F8 coil currents
			observer 9 -> +F2-F3-F6+F7 coil currents 
			observer 8 -> +E1-E4-E5+E8-F2-F3-F6-F7 coil currents
			  (w. weights)
			observer 14 -> -F3+F6 coil currents
			observer 15 -> +F1+F8 coil currents
			observer 1 -> +E1-E8 coil currents
			observer 4 -> +E4-E5 coil currents
			observers 16 and 11 -> unused
			other 6 coil current observers -> coil w. same number
			when vert. and radial turned off (first matrix):
				observer 16 -> -F1-F2+F7+F8 coil currents
				observer 11 -> +E1-E4-E5+E8+F2+F3+F6+F7 coil 
				  currents (w. weights)
	   iscramb=15
		A matrix (and reference)
			-F3-F4+F6+F7 coil currents -> observer 16
			+F2+F3+F4+F6+F7+F8 coil currents (w. weights) -> 
			  observer 12
			-F2+F4+F6-F8 coil currents (w. weights) -> observer 14
			+F3-F4+F6-F7 coil currents -> observer 11
			-F2+F8 coil currents -> observer 10
			+F2-2*F3+F4+F6-2*F7+F8 coil currents (w. weights) -> 
			  observer 15
			other 10 coil currents -> observer w. same number
		G matrix
			vertical observer -> -F3-F4+F6+F7 coil currents
			radial observer -> +F2+F3+F4+F6+F7+F8 coil currents (w. 
			  weights)
			kappa observer -> -F2+F4+F6-F8 coil currents (w. 
			  weights)
			observer 11 -> +F3-F4+F6-F7 coil currents
			observer 10 -> -F2+F8 coil currents
			observer 15 -> +F2-2*F3+F4+F6-2*F7+F8 coil currents (w. 
			  weights)
			observers 16, 12 and 14 -> unused
			other 10 coil current observers -> coil w. same number
			when vert. and radial turned off (first matrix):
				observer 16 -> -F3-F4+F6+F7 coil currents
				observer 12 -> +F2+F3+F4+F6+F7+F8 coil currents
				  (w. weights)
			when kappa turned off (all but fifth matrix):
				observer 14 -> -F2+F4+F6-F8 coil currents (w. 
				  weights)
	   iscramb=16
		A matrix (and reference)
			-F3-F4+F5+F6 coil currents -> observer 15
			+F2+F3+F4+F5+F6+F7 coil currents (w. weights) -> 
			  observer 12
			-F2+F4+F5-F7 coil currents (w. weights) -> observer 13
			+F3-F4+F5-F6 coil currents -> observer 11
			-F2+F7 coil currents -> observer 10
			+F2-2*F3+F4+F5-2*F6+F7 coil currents (w. weights) -> 
			  observer 14
			other 10 coil currents -> observer w. same number
		G matrix
			vertical observer -> -F3-F4+F5+F6 coil currents
			radial observer -> +F2+F3+F4+F5+F6+F7 coil currents (w. 
			  weights)
			kappa observer -> -F2+F4+F5-F7 coil currents (w. 
			  weights)
			observer 11 -> +F3-F4+F5-F6 coil currents
			observer 10 -> -F2+F7 coil currents
			observer 14 -> +F2-2*F3+F4+F5-2*F6+F7 coil currents (w. 
			  weights)
			observers 15, 12 and 13 -> unused
			other 10 coil current observers -> coil w. same number
			when vert. and radial turned off (first matrix):
				observer 15 -> -F3-F4+F5+F6 coil currents
				observer 12 -> +F2+F3+F4+F5+F6+F7 coil currents
				  (w. weights)
			when kappa turned off (all but fifth matrix):
				observer 13 -> -F2+F4+F5-F7 coil currents (w. 
				  weights)
	   iscramb=19
		A matrix (and reference)
			-F3-F4+F7+F8 coil currents -> observer 14
			+F3+F4+F5+F6+F7+F8 coil currents (w. weights) -> 
			  observer 12
			+F4-F5-F6+F7 coil currents -> observer 15
			+F3-F4+F7-F8 coil currents -> observer 11
			-F5+F6 coil currents -> observer 13
			-2*F3+F4+F5+F6+F7-2*F8 coil currents (w. weights) -> 
			  observer 16
			other 10 coil currents -> observer w. same number
		G matrix
			vertical observer -> -F3-F4+F7+F8 coil currents
			radial observer -> +F3+F4+F5+F6+F7+F8 coil currents (w. 
			  weights) 
			kappa observer -> +F4-F5-F6+F7 coil currents
			observer 11 -> +F3-F4+F7-F8 coil currents
			observer 10 -> -F5+F6 coil currents
			observer 16 -> -2*F3+F4+F5+F6+F7-2*F8 coil currents (w. 
			  weights) 
			observers 14, 12 and 15 -> unused
			other 10 coil current observers -> coil w. same number
			when vert. and radial turned off (first matrix):
				observer 14 -> -F3-F4+F7+F8 coil currents
				observer 12 -> +F3+F4+F5+F6+F7+F8 coil currents
				  (w. weights) 
			when kappa turned off (all but fifth matrix):
				observer 15 -> +F4-F5-F6+F7 coil currents
	   iscramb=25
		A matrix (and reference)
			-F3-F4+F6+F7 coil currents -> observer 16
			+F2+F3+F4+F6+F7+F8 coil currents (w. weights) -> 
			  observer 12
			-F2+F4+F6-F8 coil currents -> observer 14
			+F2-F3+F4-F6+F7-F8 coil currents -> observer 11
			+2*F2+F3-F4+F6-F7-2*F8 coil currents -> observer 10
			+F2-F3+F4+F6-F7+F8 coil currents (w. weights) -> 
			  observer 15
			other 10 coil currents -> observer w. same number
		G matrix
			vertical observer -> -F3-F4+F6+F7 coil currents
			radial observer -> +F2+F3+F4+F6+F7+F8 coil currents (w. 
			  weights)
			kappa observer -> -F2+F4+F6-F8 coil currents
			observer 11 -> +F2-F3+F4-F6+F7-F8 coil currents
			observer 10 -> +2*F2+F3-F4+F6-F7-2*F8 coil currents
			observer 15 -> +F2-F3+F4+F6-F7+F8 coil currents (w. 
			  weights)
			observers 16, 12 and 14 -> unused
			other 10 coil current observers -> coil w. same number
			when vert. and radial turned off (first matrix):
				observer 16 -> -F3-F4+F6+F7 coil currents
				observer 12 -> +F2+F3+F4+F6+F7+F8 coil currents
				  (w. weights)
			when kappa turned off (all but fifth matrix):
				observer 14 -> -F2+F4+F6-F8 coil currents
	   iscramb=26
		A matrix (and reference)
			-F3-F4+F5+F6 coil currents -> observer 15
			+F2+F3+F4+F5+F6+F7 coil currents (w. weights) -> 
			  observer 12
			-F2+F4+F5-F7 coil currents -> observer 13
			+F2-F3+F4-F5+F6-F7 coil currents -> observer 11
			+2*F2+F3-F4+F5-F6-2*F7 coil currents -> observer 10
			+F2-F3+F4+F5-F6+F7 coil currents (w. weights) -> 
			  observer 14
			other 10 coil currents -> observer w. same number
		G matrix
			vertical observer -> -F3-F4+F5+F6 coil currents
			radial observer -> +F2+F3+F4+F5+F6+F7 coil currents (w. 
			  weights)
			kappa observer -> -F2+F4+F5-F7 coil currents
			observer 11 -> +F2-F3+F4-F5+F6-F7 coil currents
			observer 10 -> +2*F2+F3-F4+F5-F6-2*F7 coil currents
			observer 14 -> +F2-F3+F4+F5-F6+F7 coil currents (w. 
			  weights)
			observers 15, 12 and 13 -> unused
			other 10 coil current observers -> coil w. same number
			when vert. and radial turned off (first matrix):
				observer 15 -> -F3-F4+F5+F6 coil currents
				observer 12 -> +F2+F3+F4+F5+F6+F7 coil currents
				  (w. weights)
			when kappa turned off (all but fifth matrix):
				observer 13 -> -F2+F4+F5-F7 coil currents 
	   iscramb=36
		A matrix (and reference)
			-F3-F4+F5+F6 coil currents -> observer 14
			+F3+F4+F5+F6 coil currents -> observer 12
			-F3+F4+F5-F6 coil currents -> observer 13
			+F3-F4+F5-F6 coil currents -> observer 11
			other 12 coil currents -> observer w. same number
		G matrix
			vertical observer -> -F3-F4+F5+F6 coil currents
			radial observer -> +F3+F4+F5+F6 coil currents 
			kappa observer -> -F3+F4+F5-F6 coil currents
			observer 11 -> +F3-F4+F5-F6 coil currents
			observers 14, 12 and 13 -> unused
			other 12 coil current observers -> coil w. same number
			when vert. and radial turned off (first matrix):
				observer 14 -> -F3-F4+F5+F6 coil currents
				observer 12 -> +F3+F4+F5+F6 coil currents
			when kappa turned off (all but fifth matrix):
				observer 13 -> -F3+F4+F5-F6 coil currents 
	   iscramb=61 (snowflake TOP configuration - 4 coils)
			nfast = -4 not supported 
		coils:
			F5, F6, F7, F8
		A matrix (and reference)
			+13-14 coil currents -> observer #13
			+16-15 coil currents -> observer #16
			+13+14 coil currents -> observer #14
			+16+15 coil currents -> observer #15
			other 12 coil currents -> observer w. same number
		G matrix
			vertical observer -> -13-14+15+16 coil currents (20)
			radial observer -> +13+14+15+16 coil currents (18) 
			observer #13 -> +13-14 coil currents
			observer #16 -> +16-15 coil currents
			observers #14 and #15 -> unused
			other 12 coil current observers -> coil w. same number
			when vert. and radial turned off (first matrix):
				observer #14 -> +13+14 coil currents
				observer #15 -> +16+15 coil currents
	   iscramb=62 (snowflake BOT configuration - 4 coils)
			nfast = -4 not supported 
		coils:
			F3, F4, F5, F6
		A matrix (and reference)
			+11-12 coil currents -> observer #11
			+14-13 coil currents -> observer #14
			+11+12 coil currents -> observer #12
			+14+13 coil currents -> observer #13
			other 12 coil currents -> observer w. same number
		G matrix
			vertical observer -> -11-12+13+14 coil currents (20)
			radial observer -> +11+12+13+14 coil currents (18) 
			observer #11 -> +11-12 coil currents
			observer #14 -> +14-13 coil currents
			observers #12 and #13 -> unused
			other 12 coil current observers -> coil w. same number
			when vert. and radial turned off (first matrix):
				observer #12 -> +11+12 coil currents
				observer #13 -> +14+13 coil currents
A matrix/references
		A1 output added to references (1-24 = Wavegen B 1-16 + 33-40),
		  sent to A2 output, added, sent to A3 output, added
			Wavegen B traces can be defined absolutely (10 V scale) 
			  or proportional to plasma current
				this is defined in \pcs::load_wave_gen_b:refs by
				  recipe
			channels for A output/references (the first is the
			  physics matrix convention in Mgams etc., the second 
			  are the physical channels for both):
				1-8/1-8 = E1-E8 currents 
					1 is OH current when mvloop=1, 2, 5, 15
					  or 25; Vloop when  mvloop=11
					2 is OH current correction when mvloop=2
					  (reference only, no signal -
					  correction is applied in G matrix)
					3 is signal to be differentiated for
					  fast vertical feedback when ikriz=2
					  and inova=4
				9-16/9-11,20,19,14-16 = F1-F8 currents or in 
				  some cases linear combinations of adjacent 
				  ones: these are for the coils that are used
				  for position and shape control (see "shape
				  control" above)
				17/17 = delta_ioh
				18/18 = radial displacement
				19/13 = plasma current
				20/12 = current times vertical displacement (P,
				  D)
				21/21 = density
				22/22 = kappa (always available from 12/1/07)
					uses integrated probe signals (physical
					  inputs 1-38), loop voltages (39-76),
					  coil currents (77-94); B-field 
					  backoff correction (120) added by
					  add_backoffs recipe
				23/23 = signal to be differentiated for
				  fast vertical feedback (when inova.ne.4), for
				  slow one (inova=4) or for both (inova=2,3)
				  when ikriz=2 and nfast.ne.-5
				24/24 = signal to be differentiated for
				  fast vertical feedback (and also for slow one
				  when inova=2 or 3) when ikriz=2 and 
				  nfast=-5 (but not implemented, because no 
				  reference)
			loadable matrix (calculated by mat_do.pro): physical
			  matrix (MKSA) times input gain (defined in 
			  pcs_invgains) divided by output gain (defined in 
			  fbte18)
				input gains stored in \hybrid::mat_a_in_scale
				  (in MGAMS order)
	24 A3 outputs to programmable amplifiers (bottom bay 04), then to gates
	  ("commutateurs")
		Gains (1, 2, 4 or 8) are defined by
		  recipe (\pcs::load_feed_gains) and put into
		  Vsystem (operatordb::gain:chan_001 etc.) by pcs_setup.pro
			gains and gate states can be changed through Vdraw 
			  window (PCS)
		I, P, and D gains also (from left to right)
			these are Vsystem shot design channels (not hardware!)
			  used by JBL recipes: read by triang*, which is also
			  called by PCS tests, and put into MDS+ nodes
			  (\pcs::load_tau:d,i,p) which define the physical gains
			  in this scheme
			in FBTE18 the \pcs::load_tau:d,i,p nodes are simply put
			  to zero, and the loadable gains appear to be defined
			  instead as \hybrid::pid_d,i,p; I do not know where
			  they are set though
			physical gains are hardwired
			ch. 24 has different values because of extra component
			  at output of A matrix (and derivative component is
			  open)
	Current error signal generated by A3 ch. 13, sent through patch at 
	  bottom of bay 03 to Wavegen B; then both this signal, its derivative,
	  and the output of A3 ch. 12 (vertical observer error) are sent to 
	  comparators (bottom bay 03): comparator output (disruption signal) 
	  sent to gates ("commutateurs") and to RT (real time) node (BitBus 3, 
	  middle of bay 03) --> gates are opened
		disruption signal on \hybrid::misc:output_008 (goes low when
		  disruption comes)
		error signal added to reference from Wavegen to have one
		  hardware current signal (recorded anywhere?)
		Ip signal must always be on physical ch. 13 because of 
		  disruption detector
	24 outputs from gates go to PID in bay 04 (same crate as A3)
		Most P gains = 10
G matrix
	G matrix (bay 02): same modules as A
		G1: 24x24 (input = 24 I outputs, output sent to G2 output)
		G2: 24x24 (input = 24 P outputs added to 24 perturbations
		  [Wavegen B 17-32+49-56], output sent to G3 output)
		G3-1/2: 24x24 (input = 24 D outputs, output sent to telephone
		  patch panel behind bay 04; this also receives 18 poloidal
		  currents [transducers])
		G physical inputs 1-24 are connected to corresponding A physical
		  outputs 1-24, no variations are allowed
		max gain +- 2.005
		this is for going from observables to actuators
			in FBTE, normal output order is E1-8, F1-8, OH1-2, Ip
			  (no direct actuator so matrix elements all zero),
			  Ip*z (no direct actuator so matrix elements all
			  zero), gas, FPS
				with mvloop=5, 6, 25 or 26 first element is
				  RHVPS A
				with mvloop=15 or 16 first element is RHVPS B
				with mvloop=25 or 26 second element is RHVPS B
			physical outputs simply defined (unchanging) as 1-24
		several matrices in time
			current feedback from before t=0
		loadable matrix (calculated by mat_do.pro): physical matrix
		  (MKSA) times input gain (=output A gain) divided by
		  programmable amplifier gain, PID gain and output gain
		  (first, second and fourth [same for G1, G2, G3] defined in 
		  fbte18, third ~constant), times -1
		there is a sign inversion between error signal (acquired as
		  A3 output) and G output
M matrix
	M matrix (bay 02)
		44x20 (15 multiplier cards)
		42 inputs from G patch panel
			24 G3 outputs + 18 poloidal currents (these are for the
			  resistive correction)
			order of physical cabling:
				1-16 G3 outputs, E1-8 currents, F1-8 currents,
				  17-20 G3 outputs, OH1-2 currents, 21-22 G3
				  outputs
			order of matrix in Mgams:
				1-22 G3 outputs, E1-8 currents, F1-8 currents,
				  OH1-2 currents
		outputs (18 poloidal coil voltages, gas, FPS voltage)
		  + 8 phoney "outputs" channeled through from Wavegen A: go
		  through first patch in bay 05 then to telephone panel on bay
		  08
			normal physical cabling: E1-E8, F1-F8, OH1-OH2
			  voltages; gas; FPS voltage
				with mvloop=5, 6, 25 or 26 first element is
				  RHVPS A
				with mvloop=15 or 16 first element is RHVPS B
				with mvloop=25 or 26 second element is RHVPS B
				cables "PCS3" (1-16) and "PCS4" (17-32)
			Mgams order = same (note that in PCS test shot it is
			  not the same: OH1-OH2, E1-E8, F1-F8, gas, FPS)
		this is for mutual coupling between actuators, to generate
		  actual voltages
		max gain +- 2.005
		fastm (FPS gain) is in M matrix (most other feedback gains go
		  in G matrix)
		loadable matrix (calculated by mat_do.pro): physical matrix
		  (MKSA) times input gain (for channels coming from G matrix, =
		  G matrix output gain; for current channels: physical gains,
		  provided by pcs_invgains) divided by output gain 
		  (\hybrid::output_scales_* channels, not defined in recipes)
		positive sign between G output and M output
Feedback loops
		only integral term (possibly) = density
		only derivative terms (possibly) = vertical control and density
		G matrices:
			first (until 0.01 s): no position/shape feedback
			second (0.01-0.07 s): position/shape feedback comes on,
			  gas gain is reduced to gain=6
			third (0.07->): gas gain back as requested, FPS comes
			  on, (if iprmax=1, for iscramb=1,2,7,8,10 radial 
			  control 
			  is removed, and for iscramb=1,2,4,7,8,9,10 vertical
			  control is removed - but not replaced by coil 
			  combinations, so one or two feedback conditions are 
			  missing)
			fourth (usually after shot): OH feedback is removed
			  (mvloop=7) or done on OH current (mvloop=1, 2, 5, 6,
			  15 or 16) or on Vloop (mvloop=11)
			fifth (used for iscramb=12,15,16,19,25,26 or 36): like 
			  third but with kappa feedback added, starting at 0.3
			  s; or, when mvloop=1, 2, 5, 6, 11,
			  15 or 16, both OH current (or
			  Vloop) feedback and kappa feedback, at given times
		density: gain, <= 30
			FIR channel used is determined by hardware
			at high density gain should be lower (~12 or so)
			integral gain = ggain, derivative gain = hgain (usually
			  =0)
		vertical + radial, choice of coils
			z=+40
				iscramb=10: 4 coils, tight spacing for small
			  	  plasmas; radial coils weighted by alpha
			z=+23
				iscramb=1: 2 coils
				iscramb=2: 4 coils, medium spacing
				iscramb=8: 4 coils, tight spacing for small
				  plasmas, adjacent coils in opposition; radial
				  coils weighted by alpha
				iscramb=9: 4 coils, vert. like iscramb=2 but
				  tight radial for small plasmas; radial
				  coils weighted by alpha
				iscramb=12: vertical same as 2, kappa w. medium
				  spacing, radial w. 6 coils
				iscramb=19: vert. and radial same as 12, kappa
				  w. tighter spacing; radial coils weighted by 
				  alpha
			z=+11.5
				iscramb=3: 4 coils, broad spacing for vert.;
				  radial coils weighted by alpha
				iscramb=5: 4 coils, tighter spacing for vert.;
				  radial coils weighted by alpha
				iscramb=7: 4 coils, like iscramb=5 but radial
				  coils same as vert.
				iscramb=15: like 5 and 7 for vert., broader for
				  kappa, radial w. 6 coils; radial coils
				  weighted by alpha, counter-weighting on kappa
				  coils
				iscramb=25: like 15, but no weighting on kappa
			z=0
				iscramb=4: 4 coils, broad spacing for vert.,
				  tighter for radial
				iscramb=2: 4 coils, medium spacing
				iscramb=6: 4 coils, tight spacing for vert.,
				  broader for radial; radial coils weighted by 
				  alpha
				iscramb=12: vertical same as 2, kappa w. medium
				  spacing, radial w. 6 coils
				iscramb=16: vert. same as 6, kappa and radial 
				  same as 12; radial coils weighted by alpha,
				  counter-weighting on kappa coils
				iscramb=26: like 16, but no weighting on kappa
				iscramb=36: tight spacing for vert., radial and
				  kappa
			z=-11.5
				iscramb=3: 4 coils, broad spacing for vert.;
				  radial coils weighted by alpha
			z=-23
				iscramb=1: 2 coils
				iscramb=2: 4 coils, medium spacing
				iscramb=12: vertical same as 2, kappa w. medium
				  spacing, radial w. 6 coils
			nzaxre: equilibrium used for z axis reference
		vertical:
		   general:
			domain in space of slow gains (P and D) is
			  teardrop-shaped and increases with fastm, but beyond a
			  certain limit stability is lost
			ikriz = 2: when nfast.ne.0 makes a different vertical
			  observer (v.o.) available on output 23 of A matrix
			  (or on output 3 if inova=4): this is
			  used by G matrix for derivative feedback for FPS;
			  if inova=2 or 3, nfast.ne.-1 and iscramb.ne.1, this is
			  used also for slow derivative terms); 
			  a corresponding reference (regardless of nfast) is 
			  put on ch. 23 (ch. 3 if inova=4);
			  if inova=4, the regular v.o. is put on output 23 for
			  the slow derivative feedback (so this is equivalent
			  to inova=2 for derivative part)
				if nfast=-2, observer + reference are
				  consistently calculated from probes alone
				if nfast=-3, observer + reference are the
				  probes' part of an observer that is calculated
				  including the loops
				if nfast=-4, observer + reference are zero
				  (bug?)
				if nfast=-5, observer + reference are like
				  nfast=-3; in addition, the probes' part of the
				  observer is used to construct an observer for
				  the instantaneous probe signals on output 24
				  (used for the proportional part of FPS, with
				  the derivative one set to 0: conceptually
				  equivalent to integrated probe signals +
				  derivative f.b.); but not implemented, because
				  no reference
			nfast:
				0: no FPS; v.o.= sum{I*(z-z0)} with least
				  squares calculation from loops and probes;
				  correction term subtracted from reference
				  takes into account coil currents alone
				-1: rampt adjusts weight of loops and probes
				  (0.5 for equal weight); correction term for
				  coil currents + vessel currents is subtracted
				  from reference; FPS has derivative gain only
				  (uses gainvz in G matrix, then fastm gain in M
				  matrix)
					  ikriz must be 0
				-2: like -1; if ikriz=2, derivative observer is
				  calculated self-consistently for probes alone
				  (put on ch. 23)
				-3: like -1; if ikriz=2, derivative observer +
				  reference (ch. 23) are the probes' part of an
				  observer that is calculated including the
				  loops (more complicated calculation available
				  but commented out), and uc1 defines
				  coefficients of probes under fast coils (14
				  and 26)
				-4: like -1, but different calculation for ch.
				  20 observer + reference if nelz=2 and
				  iscramb=2
				-5: like -3; if ikriz=2, the probes' part of the
				  observer is used to construct an observer for
				  the instantaneous probe signals on output 24;
				  but not implemented, because no reference
				+1: like -1, but no slow f.b., only FPS, with
				  both proprtional and derivative terms (using
				  gainz and gainvz, on ch. 20)
					  ikriz must be 0
			boost is coefficient in v.o. (A output = 20 only) of
			  probes under fast coils (14 and 26)
			reference (both 20 and 23, depending on parameters) is
			  constructed as the sum of these elements:
				(z-z_axis)*I_p (z_axis of equilibrium #nzaxre)
				delipz
				aipipz*5000 for t>0 (aipipz changes sign in
				  program when I_p<0)
				zeecorr*I_p^2 [MA] (zeecorr changes sign in
				  program when I_p<0)
				negative correction term for observer from coil
				  and vessel currents (negative because *not
				  included* in observer) except part included in
				  observer (all corrections are included in 
				  observer, thus none in reference, for inova=3
				  or 4, but only for proportional part); 
				  when A output 23 and 24 are used, the
				  corrections for those are calculated 
				  consistently with observer
				additional correction term for reference from
				  Ohmic coils multiplied by +ohcorr for OH1 and
				  -ohcorr for OH2
			because reference has partial coil + vessel correction
			  terms, or conversely because observer is not fully
			  corrected (for inova.ne.3 and .ne.4), the reference 
			  cannot be 
			  interpreted directly as Ip*z: it is merely a function
			  of it
		   slow:
			gainz (P), gainvz (D)
			gainz rarely changed (could reduce slightly when
			  low-frequency oscillations)
				0.15-0.19
			gainvz: increase by 10% steps if low frequency (20 Hz)
			  oscillations, decrease if high frequency (250 Hz)
				~6-12
			corresponding gains for E coils (gainze and gainvze) are
			  not used (=0)
		   fast:
			fastm (0.25-0.45) [in M matrix], scaled by gainvz in G
			  matrix
			must go down if Ip*z oscillates (3.5 kHz), up if
			  exponential
			nfast designates usage of fast coils (.ne.0)
			nfast = -3, ikriz = 2, rampt = 0.5 recommended when
			  using FPS
		radial:
			gain = gainr; rarely changed
			flux difference between an outer and an inner loop, with
			  corrections for distance between loop and edge based
			  on adjacent probe measurements: directly based on
			  measurements, without inversions necessary
			psi_edge_in = psi_in+2*pi*B_in*R_in*gapin
			psi_edge_out = psi_out+2*pi*B_out*R_out*gapout
			Observer = (psi_edge_out-psi_edge_in)*psifac
				(gapin, gapout, psifac are Mgams parameters)
			Reference = [(psi_edge_out-psi_edge_in)*dpsfac-dpszero+
			   Ip*rshift+Ip^2*rshift3]*psifac
				where rshift is a linear trace going from
				  rshift1 at t=0 to rshift2 at the discharge end
				rshift1, rshift2, rshift3, dpsfac, dpszero are
				  Mgams parameters
				positive towards the outside
			iscale determines the pair of flux loops and B-probes
			  used
				|iscale| < 3
				inboard loop and probe number = N+iscale
				outboard loop and probe number = M-iscale
				for z>0.11, |z|<0.11, z<-0.11,
					N = 3, 1, 37; M = 18, 20, 22
				should be 2 for z=0.45, 1 for z=0.34, 0 for
				  |z|<=0.23, -1 for z=-34
			current and radial loops are coupled: correction is
			  vertical field, and its change causes a Vloop
				could be eliminated by using inside coils as
				  well, but this is not done on TCV (idea is
				  implemented in iscramb=13 and 14)
		current (if mvloop=7): aipgain; rarely changed
			relovo: dI_OH/dt [kA/s] = 15.504*relovo
			aipgain(2) is integral gain
		I_OH (if mvloop=1, 2, 5, 6, 15, 16, 25 or 26)
			ton, toff, tlast, ioh, ioh1 (for mvloop=2), diohdt in
			  eccd_fbte18 recipe
			gain=aipgain(2) (0.39 by default, when =0 [for backward
			  compatibility])
			relovo=0
			feedback gains are g2sw(17,1,4) and g2sw(18,1,4) in
			  mvloop.eq.1 conditional in [hofmann.qqq]ggg18.for ->
			  mac:[coda.mgams.qqq]
			relative resolution of ioh and ioh1 set by
			  amat_out_scale in fbte18.pro: ioh1 resolution
			  optimized based on actual trace
			current must not go below -26 kA
		V_loop
			mvloop=11: V_loop on A output channel 1, gain of
			  100 (~10000*aipgain in FH's time, e.g. shot 17298) in
			  G2(17,1) and G2(18,1)
			aipgain(2) is proportional gain, aipgain(3) integral:
			  by default 100 and 0 respectively, 5000 is a good
			  value for latter
				[I tried this and it gave horrendous overflows,
				  so something's not right]
			Note that input gain of ch. 119 in matrix A is 4.0164
			Mgams:
				aaa(1,119)=1
				g2sw(17,1,4)=g2sw(18,1,4)
				g1sw(17,1,4)=g1sw(18,1,4)
			FBTE18:
				amat_out_scale(0)=10.
		kappa feedback:
			iscramb=12 (also =22, but no Wavegen, no matrix
			  switching - test case) or 15 or 16 or 19 or 25 or 26 
			  or 36
			ifour=6 for observer = flux at right and left minus at
			  top and bottom (four points picked from equilibrium
			  #nzaxre); ifour=5: sum of Ip*z^2 (this
			  observer always available for any iscramb)
				add 10 (ifour=15 and 16) to include coil
				  correction in observers
				performance is similar
				ifour=6 slightly less sensitive if nelz, zlp or
				  zup not right; however, analysis shows that
				  it isn't very good: reconstructed flux varies
				  a lot around plasma perimeter
				ifour=5 seems much more robust with ECCD
			gainext=gain (0.025-0.05)
				up to 0.175 without ill effects
			reference trace = cayref
				goes up with kappa in all cases (for observer
				  without coil corrections)
			nelz=3, zup and zlp must be +-b (otherwise nonsense)
			nzaxre and nzaxel should be set to "best" equilibrium
			  (typ. flattop, or biggest plasma in case of kappa
			  ramp)
			reference=22 (i.e. Wavegen B ch. 38)
			systematic +60 mV offset at matrix A output # 22
			typ. 30 mV DC error in observer (i.e. reference must be
			  increased by 30 mV)
		ECRH
		   {see plans and Web site for mission 662}
			mvloop=5, 15 or 25 for Ip control through RHVPS A 
			  and/or B
			mvloop=6, 16 or 26 for kappa control through RHVPS A
			  and/or B
