PSPICE invalid number error

Discussion in 'Homework Help' started by J_Rod, Feb 27, 2015.

  1. J_Rod

    Thread Starter Member

    Nov 4, 2014
    109
    6
    e4 op amp.png e4 erroneous.png

    Good evening,
    Here is a question on simulation in PSPICE.
    I have the inverting op amp built in Cadence Capture CIS PSPICE program in the picture. Now a DC sweep is to be set up which is shown on line 26 in the code diagram, with a nested parametric sweep shown on line 27. The parameter is the resistor RF with value of a global variable {rvar} = 1000,2000,4000 as on line 27. Now. I have imported the library necessary for the op amp 741 subcircuit. But I cannot get rid of this error message line 43, which is "Invalid number." Since there is no more helpful information of where the invalid number is, I don't know what is wrong in the simulation. Some theories I had were {rvar} should be just rvar somewhere, but when I change that it only adds more error messages. So it is probably not a problem with the parameter list, rvar.
    Thanks for reading. Any information would be very valuable if you have any experiences in Cadence Capture CIS, or other PSPICE...
     
  2. WBahn

    Moderator

    Mar 31, 2012
    17,716
    4,788
    It's been a long time since I've done this, so this might be a while goose chase.

    Look at Line 42. That is trying to point out just where the problem came in, which is at 'rvar' in Line 41.

    Have you tried

    .PARAM r1={rvar}

    If that doesn't work, simply the circuit down to something with just basic stuff and make sure that works. Then add in the parameterized things one at a time until the problem comes back.
     
    J_Rod likes this.
  3. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    This is easy in LTSpice. Read the generated netlist to see the syntax of how the stepped parameter is passed. At the netlist level, LTSpice produced netlists are compatible with PSpice.

    I dont have a model for a 741 on this computer so I used the most simplistic opamp model in its place.

    156.gif
     
    J_Rod likes this.
  4. J_Rod

    Thread Starter Member

    Nov 4, 2014
    109
    6
    Turns out I hadn't defined rvar in the PARAMETERS: box at all... op amp PARAM sweep.png
    Now the slope is negative because the inverting op amp has gain -Rfeedback /Rinput, right? Then the Vout signal is 180° out of phase with the Vin signal?
     
  5. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    Correct.

    Try connecting the left end of your R3 to Gnd, and then connect your variable input source Vin to pin 3 of the opamp in place of the Gnd. Rerun your sim, and explain the result.
     
  6. J_Rod

    Thread Starter Member

    Nov 4, 2014
    109
    6
    e4 experimens.png
    The plot begins at the lower bound of the op amp output, -5V, and increases to the upper bound 5V, determined by the supply voltages to pins 4 and 7 of the 741 op amp. There is a feedback voltage from Vout to the inverting input of the op amp. This indicates that as the non-inverting input due to Vin varying from -5V to 5V in the simulation, the potential drop between the op amp inputs is not going to be Vin, because a signal is being fed back into the inverting input that is not simply ground anymore. The slope is positive on the graph, so the gain of the op amp circuit is now positive. Using the voltage divider, the voltage above R3 with respect to ground is:
    VR3 = Vout *R3/(R3 +RF)
    and so Vout is
    Vout = VR3 (R3 +RF)/R3
    and the gain is
    A = Vout/Vin = VR3/Vin *(R3 +RF)/R3
    Vin varies in the simulation from -5V to 5V, and VR3 must have the same sign as Vin for the slope of the graph to be positive. The gain is also
    Vout = A(Vin -VR3)
    A = Vout/(Vin -VR3) = ((R3 +RF)/R3) *VR3/(Vin -VR3) = ((R3 +RF)/R3) *1/(Vin/VR3 -1)
    This means Vin/VR3 -1 > 0, Vin/VR3 > 1, Vin > VR3
     
  7. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    Very good!

    It is usual to state the voltage gain of this configuration as (positive) (1+Rf/R3)
     
    J_Rod likes this.
  8. J_Rod

    Thread Starter Member

    Nov 4, 2014
    109
    6
    Ah, okay. I messed up in the post above
    Vout = VR3 (R3 +RF)/R3
    VR3 should equal Vin because in the ideal op amp approximation the voltage difference between inputs is 0, right?
    RF = 1000 ohm, A = 1 +1000/10000 = 1.1
    RF = 2000 ohm, A = 1 +2000/10000 = 1.2
    RF = 4000 ohm, A = 1 +4000/10000 = 1.4
     
    Last edited: Feb 28, 2015
Loading...