"less than 2 connections at node ~" error

how I confronted this error

 

when I tried to make a simple opamp that I posted earlier on my own again after a few days, I got the “less than two connections at node xxx” error. I did find a way to solve this problem. It turns out it might be related to the fact that the node was ‘floating’ and it needed some connection with the ground. I’m not sure if this is the fundamental solution for this error but it did work out on this schematic and it may do so in your problematic scheme as well. So here’s the walkthrough:
(click image to see bigger picture)

Continue reading “"less than 2 connections at node ~" error”

Advertisements

간단한 opamp 시뮬레이션 해보기 / a simple op amp simulation

전자회로 책을 보면 참 간단한 op-amp 이론과 문제들… op amp를 활용한 더 복잡한 회로를 시뮬레이션 해보기 전에 간단한 opamp 회로를 만들어보아서 내가 잘 활용하고 있는 것인지 확인해보고자 이런 시뮬레이션을 해보기로 하였다.

op amp is really simple when learned in class. but it may not be that simple when actually implementing it in a circuit or even in a simulation. Before I moved onto simulating quite complex circuits using op amps, I thought it might be safe and sound to try making a simple op amp circuit just to make sure that I know how to simulate one.


준비물은 op amp 라이브러리. 내가 최근에 찾은 쓸모있는 사이트로서, 각종 pspice library들을 다운받을 수 있는 곳(robustdesignconcepts.com/files/pspice/pmindex.htm)에서 “opamp.lib”, “opamp.olb”를 다운받았다.
* opamp.lib는 원래 텍스트 파일이라 클릭하면 크롬에서 새로운 창이 뜨고 내용물이 뜨므로 오른쪽 클릭해서 “링크를 저장” 해서 다운받으면 된다.

If I’m going to simulate an op-amp, I’m going to need a model of it so I downloaded the .olb and .lib file from a website that I accidently found.
(robustdesignconcepts.com/files/pspice/pmindex.htm)
* when you click the ‘opamp.lib’ it will open a new browser window that display the text. in order to download it, just right click and select “save this link…”

자 그럼 capture를 실행시키고 이제 회로를 만들어보자.
After that, you’re ready to make a circuit in CAPTURE.


일단 다운받은 .olb 라이브러리를 추가해야 하므로 capture의 schematic화면에서 place part로 들어간다. 거기서 add library 클릭.

first you’ll need to add the downloaded opamp.olb to the library of the current project, so in the schematics window in CAPTURE, go to ‘place part’ window. Then click ‘add library’



미리 다운받은 opamp.olb 파일은 선택.

select the opamp.olb file



라이브러리가 추가된 다음에 OPAMP 라이브러리 선택 후, LM 324를 찾는다. 그다음 OK

you’ll see the “OPAMP” has been added. click it and then find the LM324 model. Then click OK.



schematic page에 하나 올려놓자. 뭐 책에서 항상 배웠듯이 input 포트 두개랑 output 포트가 있는건 알겠는데 위아래로 하나씩 더 달려있다. 요건, opamp 의 power supply를 해주는 곳이다. 여기에 정확히 어느정도의 전압을 물려줘야 하는지 알아보기 위해서 구글링이 필요하다.

place one LM324 onthe schematic page. As we have seen so many times in the circuits textbooks, the opamp has two input ports and one output port. but what are the two that is sticking out up and down from the opamp? its the power supply ports of the opamp since the opamp doesn’t amplify a signal for you for free. But we don’t know how much power we should inject to these ports. So, lets ask google.



데이터 시트를 찾기 위해 구글에서 lm324로 검색중…

Finding a datasheet of LM324 on google…




대충 아무 데이터 시트에 들어가서 power supply 관련된 정보를 찾아본다. 여기 보아하니 두가지 방법이 있는것 같은데 전자회로 문제 풀면서 +전압과 -전압을 사용하는 사례를 많이 봐왔으므로 난 이번에 +,- supply power를 둘 다 넣어줄 생각이다.

Just pick any datasheet and find any info on power supply. The one I found says that it has two ways of supplying power to it. But I’m more familiar with supplying both positive and negative voltage to the opamp which I’ve seen it numerous times while solving exercises in the textbook, so I’ll go with this method.




대충 이렇게 1차적으로 만들어보았다.

This is what I’ve come up with.





이제 시뮬레이션 세팅을 해주어야 하므로 pspice – new simulation profile 을 들어간다. name 쓰라는 창 뜨면 대충 아무렇게나 씨부려줘.

Now we need to set the simulation settings. goto ‘pspice – new simulation profile’. just type in any name for the simulation profile.



그럼 이제 진짜 세팅창이 뜨는데, 아까 난 회로도에서 vsin의 주파수를 1000Hz로 했으니 1ms 정도는 해줘야 파형이 뜨겠지? 그 다음에 확인 누르고 나와서 simulation run 을 해준다.

now the real setting window comes up. In my schematic, I applied 1000Hz frequency for the VSIN component. It would be good to set ‘1ms’ as run time. click OK and run the simulation.




근데 결과가 영….. 시원치 않다. 뭘 잘못했던 건가? 한참 고민해보면서 op amp supply power를 건드려보기도하고 햇는데 사실 실수는 굉장히 어이가 없었다. ㅜㅜ

WTF???? This ain’t right. I tried to figure out what’s wrong by going over various possibilities… but the real problem was extremely simple.




실수는 내가 opamp의 +,- 단자를 반대로 끼워넣어줬던 것. 대충 wire를 빙 둘러서 서로 반대로 해놓고 다시 simulation을 돌렸더니 


The problem was that I confused the + and – ports of the opamp. Just edited the wiring at this part to make it right.





훗! 내가 원하던게 나왔다. 근데 지금 생각해보니 왜 +,-단자를 바꿔줘야 하나 싶다. 솔직히 책에서 문제풀때는 둘다 전압이 같게 해놓고 푸니까 +,- 단자가 상관없지 않나싶은데…. op amp 내부 구조때문인가…
아무튼, 중요한건, 앞으로 opamp사용할때는 input +.-를 잘 보고 연결해주자!
참고로 capture에서 선택한 part를 rotate할때는 r을 사용하는건 알겠는데 좌우 혹은 상하로 반전뒤집기 해주는 버튼이 있는가 모르겠다. 있으면 이런거 수정할 때 편할텐데…

There it is. That’s what I wanted to see. But as I come to think of it, I wonder why switching the +,- ports was so important. I mean, based on my exercise solving experience, the node voltage of the two ports are identical. Is this because of the internal structure of opamp which I know nothing of?

Anyway, the point is that we must be careful at assigning the +,- ports of the opamp to ensure that it simulates right.

It would be helpful if there was a ‘flipping’ shortcut key when placing the parts on the page. I know the ‘r’ key rotates the component but this won’t switch the +,- ports.



P.S.
예리한 사람들은 한가지 옥의 티를 발견했을 것이다. 맨 처음에 우리는 opamp.olb 말고도 opamp.lib를 다운받았었다. 근데 결과가 나올때까지 opamp.lib에 손을 대질 않았다. 

사실 나도 다 끝나고 나서야 알아챈건데, 솔직히 왜 opamp.lib가 필요없어도 되는지 이해가 안간다. 저번에 diode를 활용한 clipper 예제회로를 만들 때는 분명 .lib 파일 없이는 오류가 났었는데 이번에는 안그렇네??

뭐지… 어쩔때는 .olb 파일 안에 .lib 파일이 가지고 있는 수치들도 포함하고 있다는 뜻인가? 

some of you who have a keen eye should have figured out a slight glitch on my walkthrough. We didn’t use the opamp.lib file until the end of the simulation. 

Actually even I found this out while I was writing this post. My original belief was that the .olb is related with the displaying shape of a model and .lib file contains all the essential numbers that is used in the simulation calculation which means that without attaching the .lib file to the project file, the simulation will fail. But I guess my understanding was wrong. Weird right? At the last post, where I tried to make a clipper using a diode, it didn’t work without the .lib file. Perhaps in some cases, .olb file is sufficient for simulation??? I don’t know the answer to this question and if anyone of you do, I would be grateful if you shared your wisdom.


그래도 혹시나 위에 내가 했던 방법을 그대로 따라했는데도 오류가 나신다는 분들은 .lib를 한번 첨부해보세요. 혹시 이것때문에 오류가 날지 모르잖아. 추가하는 방법은 

So, this is why I’m going to briefly tell you how to attach the .lib file to the project just in case this does cause a problem for some of you. 




pspice- new simulation profile 만들 때 analysis 탭만 건드리지 말고 libraries 탭도 건드린다. libraries 탭에서 browse로 다운받아둔 opamp.lib 파일을 선택해주고 “add as global”을 클릭해준다. 그럼 끝.

all you have to do is while configuring the simulation settings window, don’t just change the ‘analysis’ tab but also go to the ‘libraries’ tab as well. there you’ll find a ‘browse’ button. click it and select the .lib file. then click ‘add as global’ to attach it to the project. Then press OK and the work is done.

pspice: "model undefined" "model not found" error

지금 electronicslab.com 인가? 여기서 pspice student다운받고 그 사이트에 있는 tutorial pdf를 다운받아 따라하고 있는데 첫 시뮬레이션 부터 막힌다.

So, I’ve started using PSPICE student version which I downloaded from some site that had the address like “electronicslab.com’. not sure whether this address is the same. I downloaded and installed the PSPICE and also there were some tutorial pdfs for beginneres at the site so I’m currently following the tutorials.



문제는 바로 첫 예제에서 diode를 포함한 clipper schematic을 그리고나서 간단한 dc bias simulation을 돌려보는 건데 diode 모델을 인식 못하나보다.
The first problem that I confronted came from the very first exercise in the tutorial. damn the tutorials…. it was an example to draw a schematic of a simple clipper circuit and then perform a simple dc bias simulation. Everythings was easy except adding and simulating the ‘diode’. The error seemed to come from the fact that the simulation was having problems understanding the existence of the diode because it kept showing error messages like “model ~~~ undefined”.

구글링의 힘을 빌어 여기저기 찾아봤는데 삽질하면서 결국 찾아내었다. 요상한 방법으로 해결한 사람도 있는듯 한데 치사하게 자세히 알려주지도 않아서 따라해보지도 못하고.. 결국 이 방법이 가장 손쉬운것 같다.
I finally found out the solution through a bit of googling. Some people solved the problem in a style quite different from mine but I didn’t understand them anyway because they were so lazy to write down the specific walkthrough. They really should post some screenshots along with their explanation….

참고로 다운받아 설치한 capture에서는 diode 모델이 포함된 library가 없어서(예제에서는 마치 기본으로 있는 듯 하는 뉘앙스를 풍기더만 개 낚임…ㅅㅂ) 역시 구글 어딘가에서 .olb 파일을 다운받았다. 주소는 밑에 그림 들 중에 있으므로 알아서 찾아보시길..(괜찮은 사이트다. 여러가지 라이브러리 파일들을 모아두고 있다 !!)
Just as you know, the diode I used in this schematic is actually a downloaded one from some site that I found during my googling. The tutorial pdf instructed to add the diode while making the schematic and it said in a way that the diode model is going to be included in a library that should be installed by default. But they were so wrong.. I couldn’t find any diode models so I had to download one by myself. The website address is included in one of the screenshots that I took and shown below. Check it out by yourself. I’m lazy to write that down here. But it seems like a really good website because it had all sorts of other pspice .lib+.olb files for various electronics parts!!

anyway here’s my walkthrough to solve the ‘model undefined” problem.
(and this guide will also help those people who had ‘model ~~ not found’ error when they try to use the ‘edit pspice model’ function. more comments on this issue is at the very bottom of the page. but I recommend to at least check out this guide firsthand because it will help you understand the ‘model~~~ not found’ error as well)






요게 예제에서 만들어보라는 회로도. 캐간단하다. 그렇지만… 그냥 돌려보면..
so, this is the schematic that the tutorial asked me to make. after making it I tried to simulate it but…



요렇게 에러가 뜬다. “model … is undefined” 라는 짜증나는 문구.
as we all may have guessed, an error appears. The infamouse ‘model `~~ is undefined” error pops up.


문제는 .lib 파일을 현재 시뮬레이션에 추가해야한다는 거다. 내가 처음에 다이오드 .olb 파일을 다운 받은 곳. 주소는 확대하면 보일라나?? 아무튼, 여기서는 .olb 파일이랑 .lib 파일 두 가지를 제공하는데 나는 .olb파일만 있으면 될 줄 알고 이것만 다운받아서 capture library 폴더에 넣어둠. 하지만 .lib파일도 필요한 것이었다! 아무튼, .lib파일도 다운받는다.

The problem is because I didn’t add the .lib file of the diode into the simulation/project. This screenshot shows the site where I’ve downloaded my diode library.(This is the website that I recommend to you all) The site provides two files under the name ‘diode’. one is a .lib file and the other a .olb file. While I was drawing my schematic I realized that the user only had to add the ‘.olb’ file in order to draw the wanted model. So I stupidily just downloaded the .olb file and not the .lib file thinking the the .lib file had no use and was for suckers. Turns out, I was a sucker. The .lib file is also important because it contains specific information about the model. Anyway, more comments will be written later and lets just get going on with solving the error. 
So, Download the .lib file!!!




그냥 보기 좋게 .lib 파일도 .olb 파일이 있는 폴더에 같이 넣어두자.
(C:\Program Files\OrCAD_Demo\Capture\Library\Pspice)

I’m pretty sure that you can put the file anywhere you want but just to keep things look like ‘professional’ I’ll just save the file in the folder where the .olb file also exists.
(C:\Program Files\OrCAD_Demo\Capture\Library\Pspice)



그럼 이제 .lib파일을 ‘뭐시기’에 추가해야겠지?
다시 capture 프로그램으로 돌아가서 
메뉴바의 pspice – edit simulation profile으로 간다.

now, we should add the .lib file shouldn’t we?
go back to the capture program.
at the meubar, go to ‘pspice – edit simulation profile’




요런 창이 뜨는데, 우리는 library를 건드릴 거니까 library 탭으로 간다.
now this kind of pop up window appears. since we are going to fiddle with libraries, click the ‘libraries’ tab.





library 탭으로 가면 이런 화면… 여기서 추가하려는 lib파일을 찾아줘야 하니까 browse 클릭.
this is the library tab. click on ‘browse’ to find the downloaded .lib file



아까 지정폴더에 저장해둔 diode.lib 파일을 선택해준다.
find the downloaded .lib file.




원하는 lib파일 선택되면 ‘add as global’로 해준다. 사실 ‘add to design’해도 될것 같은데, 
그냥 global이 더좋은 것 같아서 ㅋㅋㅋ 
나도 사실 저 둘의 차이는 아직 모르겠다.

after finding the .lib file, click ‘add as global’ to add the .lib file. 
there’s another button named ‘add as design’ that looks like to do something similar, but I really don’t know the difference. But ‘global’ seems to be better and safer so I just clicked the ‘global’ one. If you really must know the difference, ask someone else  =.=;;








자 그럼 이제 simulation run을 해주고,
결과창을 확인한다. 따로 뜨는 창에서 simulation이 잘 되었다는 문구를 확인할 수 있다.

now we’ve done it. run the simulation and check that the simulation has been done without any errors. 




훗! 요렇게 capture 화면에 각 node의 voltage랑 current가 뜬다.
사실 이 캡쳐화면에 voltage가 없는 건 내가 실수로 삭제해서라고…
아무튼 님들은 잘 되리라 믿음

Haha! this the result screen. you’ll find that the voltages and currents of each nodes have been shown. The reason why the voltage is not shown in this screen shot is because I’ve mistakenly deleted it.. don’t bother. Hope you guys have solved the problem as well!





화면 캡쳐해가면서 까지 디테일하게 설명해주지 못해서 미안하지만,
capture 프로그램화면에서
edit – pspice model edit를 했을 때 혹시나 ‘~~~ model not found’ 라는 에러가 뜨면
방금 위에서 한것과 같이 .lib 파일을 추가해주면 된다.

As for the ‘~~model not found’ error when trying to “edit – pspice model edit”, I’m sorry I didn’t attach a detailed walkthrough with screenshots. but this problem is basically the same as the error above. its because the .lib file is not attached to the project and so the parameters which are included in the .lib file cannot be accessed. So, in order to edit the pspice model, one should attach the corresponding .lib file to the project/simulation and this process is exactly the same as the above.


P.S.

.lib파일을 notepad로 열어보면, 사실 그냥 text 파일임을 알수 있다. 내용물은 그냥 해당 모델(지금의 경우 diode)의 기본적인 parameter(saturation current, 어쩌구저쩌구 voltage 등등)이 적힌것일 뿐이다. 즉, 이러한 .lib 파일은 해당모델을 사용하고 있는 project에 ‘첨부’해줘야지 simulation 할 때 해당 부품을 제대로 인식하고 spice모델을 사용해서 전압이든 전류든 계산을 해나가는 것이다.

if you open the .lib file with a notepad, you’ll find out that it is a perfectly eligible text file. The contents are all parameters that define the model. In case of the diode that I introduced in this post, the .lib file contained information such as saturation current, some weird voltage, etc. There parameters are essential because it statistically defines the model and these numbers will be used for calculation in the simulation process.  Anyway the important point is, if you want to use a model that you’ve got from an external source, not only will you have to download and configure the .olb file but also the .lib file in order to use it properly.


ㅇㅋ?
OK?

pspice library

pspice library 추가
키워드:
.lib .olb .slb

http://k.daum.net/qna/view.html?qid=4ONtD&l_cid=QA&l_st=1

http://fooristal.tistory.com/27

http://www.youspice.com/ys/librariestypes.3sp
– library 타입들(.lib, .olb 등)의 종류를 잘 설명함. 왼쪽에 있는 메뉴바를 통해 더 좋은 자료들 접근 가능

=========
개인적으로 드는 생각:
.olb는 부품의 모양을 결정하는 거고 실질적인 parameter들은 .lib에 저장되어 있다. 따라서 둘 다 필요하다.

personal opinion:
.olb files sort of define the shape of the part that will show up in the schematic program. the real physical parameters seem to be saved in the .lib file. So, if you want to use the model properly in PSPICE, you’ll need both of them.

아래는 내가 직접 .olb 와 .lib 파일을 다운받아서 capture 프로그램에 add하여 사용하는 과정을 담고있는 포스트이다. 참고하시길
here’s one of my posts with details on how to download and add an external model by adding the .olb and .lib file in PSPICE. Might give you a better idea on how the library works in PSPICE.

LINK: http://kwagjj.blogspot.kr/2013/07/pspice-model-undefined-model-not-found.html