pspice 'No recognized product configuration selected.' ad620 op amp

Discussion in 'The Projects Forum' started by moorea21, Sep 5, 2010.

  1. moorea21

    Thread Starter Member

    Sep 5, 2010
    30
    0
    Hi,

    Total novice Pspice user (using 9.1capture student)...

    Tried to run a dc sweep on my amp circuit using an ad620 op amp (.cir file from farnell.co.uk), got this error:-

    --------------- Simulation Profile: SCHEMATIC1-ad620sim ---------------
    Simulation running...
    No recognized product configuration selected.
    ** Profile: "SCHEMATIC1-ad620sim" [ C:\Documents and Settings\r\Desktop\nt-SCHEMATIC1-ad620sim.sim ]
    Reading and checking circuit
    Subcircuit AD620A used by X_U1 is undefined
    Circuit has errors ... run aborted
    See output file for details
    Simulation aborted

    The ad620 appears on the schematic screen, I 'wired it up' correctly as far as I can see, so I must have missed something out, not sure what. I assumed if I could see it on the screen it was all okay to run the simulation on it. Apparently not... can anyone enlighten me? Bear in mind I only started using this program today!

    If anyone needs me to post more info in order to answer this, let me know which files I need to post,

    Thanks,

    Richard B
     
  2. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Well, you probably just renamed a symbol to AD610A, and didn't bother to INCLUDE a library or subcircuit file that contained a .subckt AD610A node1 node2 etc. statement.

    You'll need to find a SPICE model for the AD610A.
     
  3. moorea21

    Thread Starter Member

    Sep 5, 2010
    30
    0
    Okay, what I did was:

    Started project again under a different name.

    Located ad620.cir online, downloaded and opened it in Pspice model editor student, saved it as AD620A.CIR.LIB, did something that I now don't recall that created AD620A.CIR.OLB, added it to the library in project 'nt', and placed it into the schematic.

    I then set up a simulated dc sweep, varying V2 from 0V to 10mV in 0.1mV increments. Pressed run. Got the same error message.

    All files from project attached. And AD620A.CIR, AD620A.CIR.LIB, and AD620A.CIR.OLB. Those 3 were saved to my desktop, as was folder 'wnk'.

    Would appreciate some input as to why this is not working, and what I might do to fix it, thanks,

    Richard B
     
  4. gootee

    Senior Member

    Apr 24, 2007
    447
    50
    The AD620 is an instrumentation amplifier, not an opamp. But that's not your main problem.

    You should be able to not worry about libraries and it should work if you just put this spice directive into your schematic:

    .include ad620a.cir

    (assuming spice can FIND that file, at runtime)

    If that doesn't work, is it possible for you to simply paste the entire text of the AD620.cir file onto your schematic, somewhere off to the side (or wherever)? That should make it unnecessary to worry about using "include" to reference it correctly, so you can find out if that is what you are doing wrong.

    Since you have the Prefix and the Instance Name already set (X and U1), you might only need to set the "Value" field to "AD620A". In LTspice you would be able to just right-click on the symbol in the schematic, and set the "value" field to "AD620A" (or whatever is defined in the ".subckt" line in your .cir file), and it should then work. I don't know how Pspice would differ. Sorry.

    Where did you get the schematic symbol for it? It is not the same as an opamp:

    * Node assignments
    * non-inverting input
    * | inverting input
    * | | positive supply
    * | | | negative supply
    * | | | | output
    * | | | | | ref
    * | | | | | | rg1
    * | | | | | | | rg2
    * | | | | | | | |
    .SUBCKT AD620A 1 2 99 50 46 20 7 8

    You can put an external resistor Rg between pins rg1 and rg2 to set the gain to G = 1 + (49.4k/Rg). With no Rg connected, the gain is 1.

    There is also a Ref terminal which can be used to define the zero output voltage, or add an offset, up to within 2V of the supplies I think. The datasheet is at analog.com .

    Anyway, you might have to edit the schematic symbol and make sure that the netlist/node numbers for the pins match the numbers in the subckt line in the .cir file, and would probably want to set it to display the proper names (and/or maybe the DIP package pin numbers) for the pins, on the schematic.
     
    Last edited: Sep 6, 2010
  5. moorea21

    Thread Starter Member

    Sep 5, 2010
    30
    0
    Hi Gootee,

    THanks, not sure what this means:-

    'You should be able to not worry about libraries and it should work if you just put this spice directive into your schematic:

    .include ad620a.cir'

    Does that mean I should open a file (don't know which one) in, say, notepad, and paste in the '.include' line somewhere? Anywhere in particular?

    'Where did you get the schematic symbol for it? It is not the same as an opamp'

    Erm, i by schematic symbol you mean the graphical picture of the chip as it appears in the schematic page1, I just clicked on AD620A in the parts list and placed it there. not sure if that's what you meant, though.

    'You can put an external resistor Rg between pins rg1 and rg2 to set the gain to G = 1 + (49.4k/Rg). With no Rg connected, the gain is 1.' On my schematic drawing in 'capture student', there is a 100 ohm resistor between pins 0 and 4 (1 and 8 on the datasheet), to give a gain of 495.

    I didn't realise ad620 was not an op amp. I think of any IC that consists entirely of some form of amplifier to be an op amp. Poorly educated! Will learn.

    Richard B
     
  6. gootee

    Senior Member

    Apr 24, 2007
    447
    50
    I use LTspice so I don't know how Pspice does it, but look in the Help section or the manual and find out how to insert a Spice Directive on your schematic. OR, if you can insert TEXT on your schematic, try inserting the .include line I gave you, anywhere on the schematic.
     
  7. moorea21

    Thread Starter Member

    Sep 5, 2010
    30
    0
    Hmm...

    If I get a copy of LTspice I'll try it withthe same circuit and let you know what happens. Looks like it's free, too which is always a popular option!

    Richard B
     
  8. gootee

    Senior Member

    Apr 24, 2007
    447
    50
    You can do it with pspice, I'm sure. RTFM, as they say.

    On the other hand, I have heard that LTspice is superior to all others, and having used it a whole lot, and having been involved a bit on the LT_Spice discussion group at yahoogroups, I am extremely impressed by it.
     
  9. moorea21

    Thread Starter Member

    Sep 5, 2010
    30
    0
    I thought RTFM was a radio station!...

    I have LTspice on the pc now, but as I'm on the mac laptop now I can't test it. Not until tomorrow anyway.

    Okay, so if I use LTspice, open 'ad620a.cir' in notepad, save it as 'ad620a.sub' in the lib/sub folder in 'C:\Program Files\LTC\LTspiceIV\lib\sub', and then add '.LIB ad620a.sub' anywhere on the schematic itself...

    Will this then be listed as an opamp?

    If that's all there is to getting a new component ready to simulate in LTspice, then I'd be pretty impressed at how simple that is. We shall see!

    Thanks gootee!

    Rich B
     
  10. gootee

    Senior Member

    Apr 24, 2007
    447
    50
    RTFM = something similar to "Read The Fine Manual". ;-)

    No, I don't think that will quite do it. In LTspice, you have to create a .asy symbol file for the part. Luckily, in this case, I have one already made for the AD620A.

    Here's what you need to do:

    1. Download the AD620a.exe self-extracting zip file into the folder where you will be working, in LTspice. RIght-click on the link below and select Save Target As. Unzip it by double-clicking on it, or running it. Have it put the files into the main LTspice folder, or in a subfolder there.

    http://www.fullnet.com/~tomg/ad620a.exe

    It includes three files: ad620.asy, ad620a.cir, and my test-circuit ad620a_test.asc.

    You don't need to rename the .cir file. The program doesn't care about the filename extension. (But if you do change it, you would also need to change the name in the "include" statement, in the .asc file that contains the circuit that uses the component.)

    2. Go into LTspice and open ad620a_test.asc.

    3. You can click the "running man" button, to run it.

    Have fun.

    P.S. I usually leave the "official" components folders as they were, and put my stuff in my working folders. When you click on the "add component" button, you can go to any folder. So they can be found, wherever they are. But, usually, I end up just copying and pasting from another circuit, anyway, since, for a custom component, it saves right-clicking on the component and doing the setup for a new instance of it.

    Tom
     
    Last edited: Sep 10, 2010
  11. moorea21

    Thread Starter Member

    Sep 5, 2010
    30
    0
    Hi gootee,

    Well that's a step in the right direction. Glad I asked.

    I ran the simulation on the test circuit you sent me, thanks. a lot of information there.

    I cut and pasted the ad620 itself into a blank schematic, wired it up as per my original circuit, and attempted a dc sweep on it (.dc V1 0 10mV 0.1mV).

    Not what I expected! An endless status bar message reading something like 'Stepping Source:94.8156% step size=7.11029e-005 N-R iterations: 49 fill-ins:239 (Press ESC to quit)'

    I did press ESC, a lot, but it wouldn't quit. I think my sweep parameters are wrong. Should be 0 to 10mV in 0.1V increments, so that I can see the output change in a linear way from 0 to 0.5V.

    I've attached the files. Any chance you could take a look? Not sure what's going on...

    Thanks,
    Rich B
     
  12. moorea21

    Thread Starter Member

    Sep 5, 2010
    30
    0
    Couldn't see the attachment, so trying again...
     
  13. moorea21

    Thread Starter Member

    Sep 5, 2010
    30
    0
    Hi gootee,

    Total idiot... didn't put an earth in the circuit! Ignore previous post. Now the simulation runs, sort of...

    Update:-

    It turns out I hadn't earthed the negative rail of the simulated strain gauge output, either. Even more basic than that, I didn't include a resistance across which to measure the output... shame! That's 2 weeks of frustration dissolved in about 5 minutes. I've attached a working schematic this time, so you can see the results of your advice, which is a circuit to give a linear output from 2 to 4 volts from an input of 0 to about 3mV.

    Many thanks for your patience and expertise, maybe one day I can be that useful!

    Richard B
     
  14. gootee

    Senior Member

    Apr 24, 2007
    447
    50
    No problem. Glad I could actually be of help.

    Looked at your circuit. It looks like you would want to either increase the 5V supply or put a voltage divider before the input, or, change the gain of the AD620A. A 10k and then a 3.3k in series from V1 to ground, with the AD620A's + input taken from after the 10k (and before the 3.3k), will let your circuit respond to the entire range of input values, without pegging to the rail when the input reaches about 3.5 mV.

    Alternatively, changing R4 from 100 Ohms to 390 Ohms would be perfect, and still gives you a full output range, of from 1.9 to 3.3 volts, for 0-10mV input.

    Whoops! It looks like your reference voltage isn't very stiff! With the two 10k resistors dividing the supply, the Vref voltage changes from about 1.87 V to 2.00 V as your input changes from 0 to 10 mV. (Apparently the current drawn by the Vref pin changed the expected 2.5 V to 1.87 V, and then it also changes as the input changes.)

    With two 1K resistors there, the Vref only changes from 2.42 V to 2.44 V as the input changes from 0 mV to 10 mV. The splitter is then drawing a little over 2.5 mA from the supply, and the 1K resistors are dissipating around 6.5 and 6 mW. (Hold down ALT and then click on a component, to plot its power dissipation!) The output now goes from 2.44 V to 3.73 V.

    Using two 470 Ohm resistors to set Vref, Vref only varies from 2.464 V to 2.47 V as the input goes from 0 to 10 mV. The output goes from 2.48 V to 3.76 V. The Vref divider draws about 5.4 mA now, and the 470 Ohm resistors are dissipating about 13.7 mW and 13 mW.

    You could always add a small additional resistance to the lower (R2) resistor, if you needed Vref to be closer to exactly half of the supply voltage. But since the tolerances are going to make the values imprecise, anyway, you'd probably be better off inserting a low-value (maybe 100 Ohms) trimmer potentiometer in between the two 470 Ohm resistors, with the wiper going to the Vref pin.

    P.S. I changed to a transient simulation, and went to the Advanced setting for V1 and used PWL type, with settings t1 = 0, v1 = 0, t2 = 1, v2 = 0.01 (i.e. 10 mV). The simulator automatically puts a smooth line between the specified (time, voltage) points, which in this case ramped the voltage from 0 to .01 over 1 second. (While you're in there, set the "AC Amplitude" to 1, in case you want to do an AC Analysis later.) I then selected Simulate on the main menu, then Edit Simulation Command, and selected the Transient tab, and entered a Stop Time of 2. If higher frequencies were involved, I'd also set the maximum timestep to something small-enough.

    I also right-clicked on the plot pane and added a second one, so I could plot Vout and Vref in separate plot panes. (I had also added labels to the Vout and Vref nodes.)

    Note, also, that you WILL want to add decoupling capacitors across the power pins of the AD620A, probably the standard 0.1 uF ceramic and 10 uF electrolytic (unless the datasheet suggests otherwise), in parallel, as close to the pins as possible and with leads as short as possible, especially for the 0.1 uF.

    And if I were you, I would add an RC lowpass filter just before the input, to help block any RF (radio frequency). 10 Ohms in series followed by a 0.22 uF polyester or polypropylene film cap to ground should be OK. I would also stick two 100 Ohm resistors in series with the output, with a 0.022 uF film cap to ground from between them. And if you don't need to respond faster than about 10 Hz, you could increase both of those capacitor values by a factor of ten, which would change the flat part of the overall response from about 10 kHz to about 1 kHz. There's no point in letting in any frequencies that are higher than you need. But it's a good idea to respond to about 100x of your anticipated highest legitimate input frequencies. (Also see the datasheet, for a proper differential RF input filtering scheme.)

    Cheers,

    Tom
     
    Last edited: Sep 11, 2010
  15. gootee

    Senior Member

    Apr 24, 2007
    447
    50
    Oh, I forgot to mention that you should _always_ use the "plotwinsize" spice directive that I had, in my test circuit.
     
  16. moorea21

    Thread Starter Member

    Sep 5, 2010
    30
    0
    Okay, thanks.

    Again, lots to think about!

    'Alternatively, changing R4 from 100 Ohms to 390 Ohms would be perfect, and still gives you a full output range, of from 1.9 to 3.3 volts, for 0-10mV input.'

    This sounds like a simple enough solution, will try.

    'Using two 470 Ohm resistors to set Vref, Vref only varies from 2.464 V to 2.47 V as the input goes from 0 to 10 mV. The output goes from 2.48 V to 3.76 V'

    This also sounds good; I hadn't realised the Vref was misbehaving. Am I right in thinking the trimming potentiometer would only be needed to fine tune the Vref to a particular level? It may not be necessary to do that, not sure:-

    The output from the AD620 will need to be digitised, but in a specific way;
    I intend to use it to drive a 1 transistor common emitter amp, with a high gain, so that when the output from the ad620 reaches a predetermined value, the output from this second stage will 'flip' from 0V to 5V. When the ad620 output again falls below this value, the second stage output will return to logic 0. How to adjust the predetermined value, I'm not sure; probably just attenuate the ad620 output with a potentiometer.

    This logic signal would indicate whether the pressure measured by the strain gauge had reached 'X' value, at which point the logic 1 signal passes to the microcontroller, telling it to switch off a dispensing pump. The controller is an NCpod, which is a CNC controller. The software for the machine is Mach 3 CNC.

    So now you know!

    I'll read the datasheet and gen up on decoupling capacitors. Hadn't done much to consider noise reduction. Would cycling the 'excite' voltage across the load cell (wheatstone bridge) help? that way, any noise present when the supply is +ve would be subtracted when it goes to -ve. If the frequency of this was a lot higher than the ad620 would read, it should give input voltage to the ad620 with input noise subtracted. Just a thought.

    'And if I were you, I would add an RC lowpass filter just before the input, to help block any RF (radio frequency). 10 Ohms in series followed by a 0.22 uF polyester or polypropylene film cap to ground should be OK. I would also stick two 100 Ohm resistors in series with the output, with a 0.022 uF film cap to ground from between them.'

    By input, do you mean the positive voltage input to (g1) pin on the ad620?
    I'll study the datasheet in more depth, too. This circuit will operate very close to 3 busy stepper motors. Would that influence my noise reduction strategy?

    Okay, lunch time!

    Thanks again, I'm learning loads here,

    Rich
     
  17. gootee

    Senior Member

    Apr 24, 2007
    447
    50
    That's right.

    Use a component called a Comparator, like an LM339 (see datasheet at national.com), or whetever suits your rail voltages. You use two or three resistors to set it up and set the threshold voltage. You put a resistor or a divider from a power rail to the output, making the output snap to the rail (or divider voltage) when the input is above the threshold you set.

    Yes. The + input of the AD620A.

    Have to run. Will look at noise-reduction strategy later. Input filter should help. Nearby steppers = bad. Don't share grounds with them. See AD620 datasheet for specific grounding strategy when used with subsequent digitization. Later! -Tom

     
    Last edited: Sep 12, 2010
  18. moorea21

    Thread Starter Member

    Sep 5, 2010
    30
    0
    Hi gootee/Tom...

    Will do all of that, thanks. I had originally thought comparator; it's just that I have spare transistors left over. Comparators are cheap enough though, so I may yet do that.

    The ground for the amp won't be shared with the motors.

    Rich
     
  19. gootee

    Senior Member

    Apr 24, 2007
    447
    50
    Nearby steppers might be bad. Always think about Faraday's Law. Any geometric area enclosed by a conductive loop will cause the loop to have time-varying currents induced in it, by any coincident time-varying magnetic (or electromagnetic) fields. So, for natural loops like input and input ground return, power and power ground, output and output ground, etc etc, keep the conductors of each pair as close to each other as possible, everywhere. If using wires instead of PCB traces, tightly twist the wires together. Better yet, also put them inside a shielded cable, with the shield grounded to the chassis at the input end only. The "transmitter" loops/pairs are just as important as the "receiver" loops/pairs, since Faraday's Law works in reverse, too, such that time-varying currents in a loop will cause EM fields to radiate. So also tightly twist together AC mains pairs, transformer secondary pairs, etc.

    Search for "star grounding". But also look carefully at the ground scheme presented in the AD620 datasheet, for when an ADC is used. Ground-return conductors have both distributed resistance and distributed inductance. When a current flows back to the power supply, it induces a voltage that appears back at the NON-ground end of the ground conductor! The voltage from the resistance is just proportional. But the inductance induces a voltage that's proportional to the rate-of-change of the current. So fast-changing dynamic currents, even if small amplitude, can induce relatively large, dynamic "ground" voltages.

    Now imagine that your amplifier input's ground-reference point shares a ground-return conductor with decoupling caps, or digital logic pulses, all the way back to the power supply. The "ground" voltage, back at the non-ground ends of ALL of the ground-return conductors that share a return path will be bouncing around! And your amplifier's input "sees" what? It sees the difference between its input pin and its input ground reference. So that means that the bouncing ground voltage will be ARITHMETICALLY SUMMED with your amplifier input signal! That, as they say, is "a BAD thing".

    Using "Star Grounding" can help, greatly, to avoid that. Generally, that means running separate ground-return conductors, whenever necessary, all the way back to a central star ground point. (Or run a separate ground return for everything, if unsure.) In things like audio amplifiers, that point might be between the ground pins of the power supply smoothing caps. In mixed digital/analog circuits, it can be different. With multi-layer PCBs, it's usually much different (and often much better), since multiple ground planes can be used (i.e. entire inner layers that are solid copper, for ground, and also whole solid layers just for each power rail) In your case, the AD620 datasheet has a scheme that they suggest, which I looked at briefly, which seems to have the star ground point at the ADC. That might be able to be adapted to your circuit. We'll have to see. You can model the ground return conductors in LTspice with a resistor having .001 Ohm per inch of conductor in series with an inductor having 25 nH per inch of conductor. Or you can figure out what your actual conductors' resistance and inductance would be and use that. I have some stuff you can copy and paste for that, at http://www.fullnet.com/~tomg/gooteesp.htm .

    Another thing that comes to mind, when dealing with threshold switching, is hysteresis. i.e. You need some. The comparator should enable you to set the hysteresis. That way, your circuit might not have to sit right at the threshold and switch the comparator on and off more rapidly than you would like. (You might also end up coinsidering using a low-pass filter, somewhere in thge loop, to limit how fast the circuit can respond or how fast the input can change.)

    P.S. I would use a real comparator, instead of transistors. You could also use a spare opamp. But the comparator will be much better than either of those. It's tailor-made for the job.


    Cheers,

    Tom
     
    Last edited: Sep 12, 2010
  20. moorea21

    Thread Starter Member

    Sep 5, 2010
    30
    0
    Hi Tom,

    Okay, so grounding is critical.

    The circuit could be mounted away from the steppers, but then the long signal wires carrying tiny voltages would maybe suffer greater resistive losses. Plus I think longer wires will mean picking up longer radio frequencies, too. Twisted, shielded paired wires sounds sensible, especially for the input.

    Star grounding...this means all components having their own ground wires to a common point, yes? The digital (controller) power supply is a 220V to 5V phone charger.I was thinking of running the strain gauge etc on rechargeable batteries, as I thought that would help noise problems; the 5V supply from the controller for this was causing a stepper motor to step on it's own... The power supply for the motors and drivers is a torroidal transformer (36V DC) with one large smoothing cap, can't see the value as I mounted it upside down... could I ground the strain gauge input to there, (assuming not using batteries) via it's own set of wires? Only trouble is, that's about 7ft distance, ie inductance of about 2.1uH, I think.

    I wasn't sure where to look on your page you linked to, do you mean I should use your "DUAL 22V REGULATED DC POWER SUPPLY
WITH LOW RIPPLE AND SOFT START"as a starting point for modelling my power supply? I have no test equipment, so I can't measure anything beyond what my DVM tells me. Hence the spice modelling!

    Didn't realise my ground voltage would be so messy, potentially (no pun intended!)

    "In your case, the AD620 datasheet has a scheme that they suggest, which I looked at briefly, which seems to have the star ground point at the ADC."

    From the datasheet P14, 'grounding':-

    "It would be convenient
    to use a single ground line; however, current through
    ground wires and PC runs of the circuit card can cause hundreds
    of millivolts of error."

    This level of error would be disasterous at the input end of things, but... The overall effect of all this sensing and converting, etc is to regulate the amount of paint squeezed out of a syringe. The amount could vary by as much as +-20% before it causes any major problems. So the threshold for logic state change could vary by that much, too, which I think means that hundreds of millivolts with a 5V or 9V supply would not be totally unworkable.

    I have to say, I don't understand the diagram under 'grounding', P14. Is Figure 35 the one you mean for grounding with an ADC? Does this still apply if there is a comparator rather than an ADC? I did a radio and tv servicing course 15 years ago, and haven't been near anything electronic since then, so a lot of background is missing for me, unfortunately.

    Hysteresis sounds like a good idea. The macro that runs the dispenser pump in Mach 3 runs 5 times per second, so a fairly large time delay would be acceptable, ie 2-20ms? That's 10x to 100x the 'sample rate' of the software, then. The low pass filter could really be anywhere from the ad620 input to the comparator input? Or maybe use 2, in case any noise gets induced in the meantime? That's a guess...

    You didn't mention if you thought the switching excite voltage idea would help. Is it no good?

    Hopefully today I will post a revised circuit, based on what I think I understand from this and your previous post.

    Thanks for taking the time,

    Richard B
     
Loading...