How to create AC voltage source
8553 12
scott216 7 years ago
I can't figure out how to create an AC voltage source. Is there someplace that documents the syntax. I want a 60 Hz sine wave from -12 v to + 12 volts. I tried SIN(-12 +12 60) but I get 0 to -24 volt sine wave.
Comments
dillon 7 years ago
SIN(-12 +12 60) change to SIN(0 +12 60) -12 is a DCoffset, you should set it to zero. ![Alt text](/edaImg/cms/1398298275_wave.png)
Reply
scott216 7 years ago
Thanks, that worked. Is stuff like this documented somewhere? Also, I added a center tapped transformer to my circuit, but I don't know how to define the step down ratio.
Reply
example 7 years ago
You can find a lot of information about using EasyEDA devices in simulations in these project folders: [https://easyeda.com/project_view_Transformers-and-coupled-inductors_LWewOI0ic.htm] [https://easyeda.com/project_view_How-to-use-Regulators-in-EasyEDA_ACwUgasKE.htm] [https://easyeda.com/project_view_How-to-use-basic-elements-of-EasyEDA_BDxrlDVdv.htm] [https://easyeda.com/project_view_Spice-tutorials_AysKEWevN.htm] [https://easyeda.com/project_view_Spice-simulation-skills_sysmEWQ7p.htm] [https://easyeda.com/project_view_Making-measurements_1BTb4mEWe.htm] For all devices placed in the schematic canvas from the **EasyEDA Libs**, all the available parameters are displayed for editing in the right hand Properties panel. For more information about any of the spice model devices specially developed for EasyEDA - available in the **EasyEDA Libs** or found using **Find Libraries...** (shown as devices with a schematic symbol with a little *s* inside it and ending in EE) - a good tip is to place a device in the schematic canvas, save it and then do: **Super Menu > Miscellaneous > Netlist For Document > Spice** and then look for the **.subckt** definition for the device in question. Please note that because EasyEDA uses the Free and Open Source software simulator, [ngspice], you can find more information in the ngspice users manual from here: [http://ngspice.sourceforge.net/docs/ngspice-manual.pdf] [https://easyeda.com/project_view_Making-measurements_1BTb4mEWe.htm]: https://easyeda.com/project_view_Making-measurements_1BTb4mEWe.htm [https://easyeda.com/project_view_Transformers-and-coupled-inductors_LWewOI0ic.htm]: https://easyeda.com/project_view_Transformers-and-coupled-inductors_LWewOI0ic.htm [https://easyeda.com/project_view_Spice-tutorials_AysKEWevN.htm]: https://easyeda.com/project_view_Spice-tutorials_AysKEWevN.htm [https://easyeda.com/project_view_Spice-simulation-skills_sysmEWQ7p.htm]: https://easyeda.com/project_view_Spice-simulation-skills_sysmEWQ7p.htm [https://easyeda.com/project_view_How-to-use-Regulators-in-EasyEDA_ACwUgasKE.htm]: https://easyeda.com/project_view_How-to-use-Regulators-in-EasyEDA_ACwUgasKE.htm [https://easyeda.com/project_view_How-to-use-basic-elements-of-EasyEDA_BDxrlDVdv.htm]: https://easyeda.com/project_view_How-to-use-basic-elements-of-EasyEDA_BDxrlDVdv.htm [ngspice]: http://ngspice.sourceforge.net [http://ngspice.sourceforge.net/docs/ngspice-manual.pdf]: http://ngspice.sourceforge.net/docs/ngspice-manual.pdf
Reply
scott216 7 years ago
I didn't even notice there was a properties panel, thanks. I don't see any devices with little sEE I did find the .subckt for the transformer: .SUBCKT XFMR_TAP_XT1 1 2 3 4 5 E1 7 8 1 2 10 F1 1 2 VM1 10 RP 1 2 1MEG RS 6 3 1U VM1 7 6 F2 1 2 VM2 10 E2 9 5 1 2 10 R5 8 4 1U VM2 9 8 I get the following error when I try to run the simulation. I have know idea what it means. At first I though I was leaving out a property, but the only property is ratio. Error: unknown subckt: xt1 v2_1 v2_2 vin 0 d2_a xfmr-tap_xt1
Reply
dillon 7 years ago
We will fix this transform problem soon. Dillon
Reply
example 7 years ago
Fixed now! :) Andy
Reply
scott216 7 years ago
I'm getting a different error now. I don't know if it's a problem with my circuit or EasyEDA. I made the circuit public: https://easyeda.com/project_view_Zero-Crossing-Trigger_Cc6oiASas.htm I tried a time Transient with 1m and 100m settings. The first part of the error message is: Warning: v2: no DC value, transient time 0 value used Warning: v.xt1.vm2: has no value, DC 0 assumed Warning: v.xt1.vm1: has no value, DC 0 assumed Warning: singular matrix: check nodes v2_2 and v2_2 I think V2_2 is the transformer.
Reply
example 7 years ago
Hello again, The first three warnings: `Warning: v2: no DC value, transient time 0 value used` `Warning: v.xt1.vm2: has no value, DC 0 assumed` `Warning: v.xt1.vm1: has no value, DC 0 assumed` can be ignored but this one: `Warning: singular matrix: check nodes v2_2 and v2_2` is telling you that there is no DC return path to ground for the V2 source. In a Spice simulation, every point in a circuit *must* have a DC path to ground. It doesn't have to be a direct connection. It can be through a resistor of up to about 1e12 Ohms (1T) though 1e9 (1G) is a bit less likely to cause convergence problems in a simulation. In your circuit, a single resistor from the -ve end of V2 to ground would work but in general it is good practice to use one from each end to maintain the symmetry of the loading such resistors impose. That said, in a perfectly balanced circuit, some asymmetry may help ensure the circuit starts up properly and converges well. The next problem you will encounter is that you have set the turns ratio to be 1:10 for the left hand side of the transformer to each of the halves of the centre tapped right hand side. This is giving a load side voltage swing of over 1kV which is causing the diodes to breakdown and so you are not seeing anything resembling the expected fullwave rectified output at the junctions of the three diodes. If you set RATIO to 0.1, you will get something more like what you might expect. The simplest way to explain this is to open up the netlist for your circuit and read the note about windings and turns ratio in the transformer .subckt. Note that, because the turns ratio is defined from the untapped side to *each half* of the tapped side, to get a 1:1 ratio from the untapped side to across the whole of the tapped side then you need to set a turns ratio of 0.5! Lastly: be careful: you have used the ideal DC transformer model. This is fine in your circuit: it simplifies transformer coupled circuits and speeds up the simulations but you must be aware of the fact that this model works all the way down to DC! One last point: you have drawn the circuit as a spice subckt (using the Spice Subckt canvas rather than the Schematic canvas) which you don't need to do. You can draw simple "passive" non-simulation schematics (just for drawings or to push through to PCB without simulation) or "active" simulation schematics simply using the Schematic canvas. The Spice Subckt canvas is intended for drawing schematics to represent blocks of circuitry that are to be used as subcircuit models to be attached to your own symbols. For example, suppose you have a circuit diagram for a switched mode power supply which uses a SMPS chip for which you have created a symbol and you want to run a simulation for the circuit. You draw the top level circuit in the **Schematic** canvas. You create the symbol for the SMPS chip in the **Spice Symbol** canvas. The simulation will not do anything unless the symbol for the SMPS chip has a circuit inside it that represents the functions of the internals of the chip, i.e. something that when attached to the symbol, makes the symbol behave, in the PSU circuit, like the device it represents. If you have the circuit that represents the internals of the chip, you can draw it as a schematic using the **Spice Subckt** canvas, saving it with the same name as the Spice Symbol you created for the device it represents. (This is what the message in the dialogue box when you first saved your schematic was all about). On the other hand if you have a .subckt as a netlist - which is the more usual way subcircuits are available from chip manufacturer's or wherever - then when you create the symbol in the **Spice Symbol** canvas you can simply attach the .subckt in netlist for to it directly using: **Super Menu > Miscellaneous > Edit Subckt...** Then when you run a simulation of the main schematic (Ctrl+R), depending on whether the subckt is attached to it in schematic or netlist form, the spice symbol for the SMPS chip will pull in either the subckt schematic which will then be netlisted as part of the whole schematic or it will pull the netlist in directly which will then be merged into the netlist for the rest of the circuit. Going back to your circuit: as drawn will simulate OK but for more complex circuits, it is less likely to cause confusion if you can start with the simple schematic canvas and add spice symbols and subcircuits later only if they are needed as these are features for more advanced circuits and simulatons. Does that make any kind of sense to you or have I just befuddled you? Andy
Reply
scott216 7 years ago
It's working now, thanks for your help.
Reply
scott216 7 years ago
I rebuilt the circuit in a regular schematic tab, but I'm getting this error when I run the simulation: Too many parameters for subcircuit type "xfmr-tap_xt1" (instance: xxt1) See: https://easyeda.com/editor#id=24YSasKDV|UkCwpHZhz
Reply
example 7 years ago
Ah! Got it. A simple mistake with a not very helpful error message. Your voltage probe is called: `AC Voltage` *Spaces are not allowed in volprobe and netlabel names.* Note also that when you place a volprobe on a net, the name of that probe overwrites any name that is already on the net. This is not normally an issue but it can cause problems if the net name is used in a behavioural source expression such as: `V=2*V(netname)` or a **probe** expression used to plot a trace directly from the schematic, such as: `probe 2*V(netname)` or in a **Let** definition such as: `let gain=V(netname)/V(netname2)` Applying a **volprobe** called `my_netname` to the net already **netlabel**led as `netname` will overwrite it in the schematic but not in any of the expressions illustrated above. This then breaks the expressions and will throw an error. The tutorial describes this in **[Probing voltages and currents]** and this [project] gives some examples of the use of netlabels in expressions. [Probing voltages and currents]: https://easyeda.com/Doc/Tutorial/spiceSimulation.html#h.vl7fdqh8iyf8 [project]: [https://easyeda.com/project_view_Making-measurements_1BTb4mEWe.htm]
Reply
Login or Register to add a comment
goToTop
你现在访问的是EasyEDA海外版,使用建立访问速度更快的国内版 https://lceda.cn(需要重新注册)
如果需要转移工程请在个人中心 - 工程 - 工程高级设置 - 下载工程,下载后在https://lceda.cn/editor 打开保存即可。
有问题联系QQ 3001956291 不再提醒
svg-battery svg-battery-wifi svg-books svg-more svg-paste svg-pencil svg-plant svg-ruler svg-share svg-user svg-logo-cn svg-double-arrow
We use cookies to offer you a better experience. Detailed information on the use of cookies on this website is provided in our Privacy Policy. By using this site, you consent to the use of our cookies.