Behavioral Model Using Current in Equation Causes Time Step too Small Errors

Thread Starter

luckyPatrick

Joined Jun 28, 2018
1
Hi,
I am trying to behavioral model a Wideband Linear Four-Quadrant Multiplier (MC1595). The SPICE code is below. For some reason when I put the current (i.e. "1/I(RScaleFactor)") into behavioral voltage source 1 equation it causes "time step tooo small error" in other parts of my circuit. Can you please help?

Thank you,
Patrick

.SUBCKT MC1595 V+ -Vy_OFFSET_ADJUST +Vy Ry5 Ry6 SCALE_FACTOR_TRIM V- +Vo -Vo +Vx -Vx_OFFSET_ADJUST Rx11 Rx10 R_+_GND PARAMS: RL=0 Rx=0 Ry=0

*this equation cause 'time step to small' errors in other parts of my circuit
*B§V1 N001 0 V=Kr*(1/I(RScaleFactor))*(V(+Vx)-V(-Vx_OFFSET_ADJUST))*(V(+Vy)-V(-Vy_OFFSET_ADJUST))
*this equation works fine
B§V1 N001 0 V=Kr*(V(+Vx)-V(-Vx_OFFSET_ADJUST))*(V(+Vy)-V(-Vy_OFFSET_ADJUST))

B§V2 -Vo 0 V=-V(Vo)/2
B§V3 +Vo 0 V=V(Vo)/2
RScaleFactor SCALE_FACTOR_TRIM 0 500
R1 -Vy_OFFSET_ADJUST 0 10Meg
R2 +Vy 0 10Meg
R3 +Vx 0 10Meg
R4 -Vx_OFFSET_ADJUST 0 10Meg
R5 0 Ry5 5k
R6 0 Ry6 5k
R7 Vo N001 10
C1 Vo 0 1µ
R8 V+ 0 10Meg
R9 V- 0 10Meg
R10 0 Rx11 5k
R11 0 Rx10 5k
R12 0 R_+_GND 5k
.PARAM Kr = {(2*RL)/(Rx*Ry)}
.backanno
.end
 

Bordodynov

Joined May 20, 2015
2,890
B§V1 N001 0 V=Kr*(1/I(RScaleFactor))*(V(+Vx)-V(-Vx_OFFSET_ADJUST))*(V(+Vy)-V(-Vy_OFFSET_ADJUST))
to
B1 0 N001 i=Kr*(1/I(RScaleFactor))*(V(+Vx)-V(-Vx_OFFSET_ADJUST))*(V(+Vy)-V(-Vy_OFFSET_ADJUST)) Rpar=1 Cpar=10n
 
Top