How much do you trust your software?

  • Thread starter Topher925
  • Start date
  • Tags
    Software
In summary, the software Spice models for amplifier components are not always correct and can give results that are far from what is actually happening in the circuit.
  • #1
Topher925
1,566
7
I've been delving a little deeper into electrical theory in terms of noise and low signal measurement as I'm working on some rather sensitive stuff and the back of my napkin calculations isn't cutting it anymore as I need to account for things like opamp input bias, voltage offset, etc. I thought I would do some spice based circuit simulations using NI Multisim to see if I could predict the same results I get in the lab. The software is no where even close to what's actually happening on the workbench. I'm measuring a current based signal of about a few pico-amps which is then going to a low-bias op-amp and is giving me a rms voltage of about a few micro-volts with a SNR of about 1:1. Mutlisim predicts a voltage of about 9,000V with a SNR of 10:1.

My simple napkin calculations in MATLAB give a result to within about 30% of what I'm measuring on the oscilloscope in terms of signal and noise magnitude. What the hell is going on here? I double checked all my numbers and schematics in the software and everything appears to be correct. The only thing I can think of is that the spice models for the amplifier components are wrong but I took those directly from the manufacturer (Analog Devices). Are spice based software packages always this off or am I doing something wrong?
 
Engineering news on Phys.org
  • #2
You're doing the right things. It's important to get agreement between calculations, simulations and measurements. They should eventually be very close to each other, once all the subtleties (and sometimes software bugs) are worked out.

Are you able to post more information so that we can try to check the simulation results? There may be an issue with the SPICE model that you have downloaded -- it wouldn't be the first time that a model had issues.
 
  • #3
Are you running your circuit using Transient Analysis or Sweep Analysis? Sweep analysis isn't concerned with power supply voltages and often you get voltages out that are higher than the power supply voltage.
 
  • #4
skeptic2 said:
Are you running your circuit using Transient Analysis or Sweep Analysis? Sweep analysis isn't concerned with power supply voltages and often you get voltages out that are higher than the power supply voltage.

I'm running a transient analysis. I didn't think Multisim has a sweep analysis. :confused:

I attached an image of the results my code gives me (first pic) and the schematic with the simulation running (second pic). The spice models for the opamps came from Analogs Multisim free download thing on their website.

As you can see the multisim model just kind of goes off into oblivion while the MATLAB script I wrote gives more realistic results. I'm still fine tuning it a bit but its getting there. I can post code or what ever else if wanted.
 

Attachments

  • SignalModel.png
    SignalModel.png
    20.6 KB · Views: 451
  • MultisimModel.jpg
    MultisimModel.jpg
    32.4 KB · Views: 420
  • #5
It does look like the simulator is having trouble with the tiny currents and huge resistances. Can you ratio the values back to more nominal values to see if the math errors stop at some point?
 
  • #6
berkeman said:
It does look like the simulator is having trouble with the tiny currents and huge resistances. Can you ratio the values back to more nominal values to see if the math errors stop at some point?

Yes. If I scale the feedback resistor down to around the 1Mohm range and bump up the photodiode current to the microamp range it starts to behave normally. This range of values is of course completely useless for my application.

I think I'm just going to stick with my MATLAB calculations and not deal with any fancy software. With my code I at least know exactly what's going on what needs to be tuned in order to get the results to agree with experimental measurements.
 

Related to How much do you trust your software?

1. How do you test the trustworthiness of your software?

As a scientist, I use a variety of methods to test the trustworthiness of my software. This includes conducting thorough code reviews, running automated tests, and performing manual testing to identify any potential bugs or vulnerabilities.

2. Can you guarantee that your software is completely trustworthy?

While I strive to ensure that my software is as trustworthy as possible, I cannot guarantee that it is completely free of any errors or vulnerabilities. However, I continuously work to improve and strengthen the security and reliability of my software.

3. What steps do you take to prevent security breaches in your software?

I take several precautions to prevent security breaches in my software. This includes using secure coding practices, regularly updating and patching any known vulnerabilities, and implementing strict access controls to limit potential attack vectors.

4. How do you handle unexpected errors or bugs in your software?

When unexpected errors or bugs arise in my software, I immediately investigate and address the issue. This may involve fixing the code, running additional tests, or seeking assistance from other experts in the field.

5. How often do you update and maintain your software?

I regularly update and maintain my software to ensure that it remains secure and reliable. This may involve releasing new versions or updates to address any known issues or to add new features and functionality.

Similar threads

  • Electrical Engineering
Replies
12
Views
1K
  • Electrical Engineering
Replies
3
Views
960
Replies
9
Views
2K
  • Electrical Engineering
Replies
9
Views
995
  • Electrical Engineering
Replies
15
Views
4K
Replies
2
Views
1K
  • Programming and Computer Science
Replies
10
Views
3K
  • Electrical Engineering
Replies
6
Views
2K
  • Electrical Engineering
Replies
1
Views
1K
Replies
3
Views
5K
Back
Top