How to simulate Op-Amp in MATLAB

  • Context: MATLAB 
  • Thread starter Thread starter jean28
  • Start date Start date
  • Tags Tags
    Matlab Op-amp
Click For Summary

Discussion Overview

The discussion revolves around simulating an operational amplifier (op-amp) in Simulink, focusing on the configuration of blocks, signal types, and troubleshooting errors encountered during the simulation process. Participants explore both theoretical and practical aspects of building the model.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Homework-related
  • Experimental/applied

Main Points Raised

  • One participant inquires about simulating an op-amp using two adders and a gain block, expressing uncertainty about the setup.
  • Another participant suggests setting a high gain (e.g., 10,000) and using a saturation block to limit output, indicating that real op-amps saturate at power supply levels.
  • Concerns are raised about difficulties connecting resistors and capacitors to the sum block, with a participant noting that the signal types may not match.
  • A participant explains that resistors and capacitors require voltage signals, while the sum block needs pure numerical signals, suggesting the use of a voltage measurement block and a variable voltage source for conversion.
  • Further questions arise regarding the need for converters to connect to the saturation block for measuring output voltage.
  • One participant shares a link to an image of their current simulation setup and requests help to fix an error encountered.
  • Another participant clarifies that the voltage measurement block measures voltage differences and emphasizes the need to connect both inputs, while also recommending a controlled voltage source block for converting outputs to voltage signals.
  • A participant expresses continued issues with errors after making suggested connections and questions whether the voltage measurement blocks were connected correctly.

Areas of Agreement / Disagreement

Participants exhibit a mix of agreement on the types of blocks needed for the simulation and the issues related to signal types, but there remains uncertainty regarding specific connections and troubleshooting steps, indicating that the discussion is not fully resolved.

Contextual Notes

Participants mention limitations related to signal compatibility between different blocks, but do not provide specific resolutions to the errors encountered in the simulation.

Who May Find This Useful

This discussion may be useful for individuals interested in simulating electronic components in MATLAB/Simulink, particularly those working with operational amplifiers and related signal processing challenges.

jean28
Messages
83
Reaction score
0
Good day. Could anyone tell me how to simulate an equivalent Operational Amplifier in Simulink? I read somewhere that I had to do it with 2 adders and a gain block, but I don't know how. Thanks.
 
Physics news on Phys.org
---(-ve Input)----
......| (- +)SUM | ----|-Gain-> --- |Saturation Block| ---> (output)
---(+ve Input)---

Set gain very high, like 10,000. Saturation Block is used to limit the output to within certain range; for real hardware op-amps the output would saturate at power supply voltage levels.
 
I_am_learning said:
---(-ve Input)----
......| (- +)SUM | ----|-Gain-> --- |Saturation Block| ---> (output)
---(+ve Input)---

Set gain very high, like 10,000. Saturation Block is used to limit the output to within certain range; for real hardware op-amps the output would saturate at power supply voltage levels.
Ok thanks for that. Now, for some reason the resistors and capacitors don't want to connect to the Sum block. I tried the SimpowerSystems and Simscape blocks and they don't connect. Do you know why?
 
Blocks are very restrictive of what type of signals are input and what types are output.
Resisters and capacitors take 'voltage' signals as input but the 'sum' block needs pure signal (number) as input. 'Voltage Measurement Block' and 'Variable Voltage source' can convert signal of one form to other.
In short, the blocks don't connect because the signal types don't match.
 
I_am_learning said:
Blocks are very restrictive of what type of signals are input and what types are output.
Resisters and capacitors take 'voltage' signals as input but the 'sum' block needs pure signal (number) as input. 'Voltage Measurement Block' and 'Variable Voltage source' can convert signal of one form to other.
In short, the blocks don't connect because the signal types don't match.

That is great information. Is there any specific source or book that you can recommend me to learn all of these things?

I'll try to set up the whole model later on and tell you if I need any help.

P.S. Does the saturation block require another converter?
 
I_am_learning said:
Blocks are very restrictive of what type of signals are input and what types are output.
Resisters and capacitors take 'voltage' signals as input but the 'sum' block needs pure signal (number) as input. 'Voltage Measurement Block' and 'Variable Voltage source' can convert signal of one form to other.
In short, the blocks don't connect because the signal types don't match.

What converter do I need to put to the saturation block to be able to measure the output voltage?
 
The voltage measurement block measures 'voltage difference between two points' only. So, you need to connect both of its two input.

The saturation block takes in pure number and gives out pure number. To convert it to voltage signal use a 'controlled voltage source' block.
http://www.mathworks.com/help/physmod/powersys/ref/controlledvoltagesource.html

You can learn a great deal about various blocks by opening their configuration panel (double click) and choosing help.
 
Last edited:
I_am_learning said:
The voltage measurement block measures 'voltage difference between two points' only. So, you need to connect both of its two input.

The saturation block takes in pure number and gives out pure number. To convert it to voltage signal use a 'controlled voltage source' block.
http://www.mathworks.com/help/physmod/powersys/ref/controlledvoltagesource.html

You can learn a great deal about various blocks by opening their configuration panel (double click) and choosing help.

Ok, so I connected the voltage measurement blocks and then added the controlled voltage source block and I still get some weird error. What's wrong now? Did I connect the voltage measurement blocks wrong?

http://i1226.photobucket.com/albums/ee410/jean28x/modelo2attempt.jpg
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K