pwm_driver_kicad/pwm_driver_spice_simulation_models/Potentiometer_SW.lib (579B)
1 * Potentiometer with switch 2 * _ 3 * 4-- o `-o --5 4 * _____ 5 * 1--|_____|--3 6 * | 7 * 2 8 * 9 * Nodes: 10 * 1 = CCW 11 * 2 = Wiper 12 * 3 = CW 13 * 4 = Switch terminal 1 14 * 5 = Switch terminal 2 15 16 .subckt POT_SW 1 2 3 4 5 17 + PARAMS: R=10k POS=0.5 SW_ON=0 18 19 * Potentiometer (linear) 20 R1 1 2 {R*(1-POS)} 21 R2 2 3 {R*POS} 22 23 * Switch as low or high impedance 24 RSW 4 5 R={if(SW_ON>0.5, 0.05, 1e9)} 25 26 * Switch with control voltage (0 or 1V) 27 * BCTRL CTRL 0 V={SW_ON} 28 * 29 * Switch model 30 * .model SWMOD SW(Ron=0.1 Roff=1Meg Vt=0.5 Vh=0.1) 31 * 32 * Switch instance 33 * S1 4 5 CTRL 0 SWMOD 34 35 .ends POT_SW
