ngspice in KiCad 8 for circuit simulation
ngspice in KiCad 8 for circuit simulation
  • Видео 8
  • Просмотров 34 874
ngspice in KiCad 8: oscillators, taming an astable
Oscillators are sometimes difficult to simulate, they don't have a stable operating point (astable ...), they sometimes, depending on the device models, oscillate with difficulty, or the simulator finds a stable operating point, and then the oscillation does not start. In this video some means to get around these issues are presented.
Просмотров: 6 123

Видео

Ngspice in KiCad 8: mixed signal simulation (analog + digital)
Просмотров 2,5 тыс.7 месяцев назад
We use a digital device (XOR 74HC86) plus analog delays created by RC (resistor capacitor) circuits to create a pulse each time the input sgnal changes from 0 to 5 or 5 to 0. Setting up such a circuit is described in ruclips.net/video/fOIllW_XNeo/видео.html .
ngspice in KiCad 8: Logic simulation, divide by 4 with 7474
Просмотров 2,3 тыс.7 месяцев назад
A fast logic simulation, event-based, is set up and run. A divide-by-4 circuit is provided, using the 74HC74 dual D flipflop. Digital models for some 74xxx devices are available at ngspice.sourceforge.io/model-parameters/74HCxxxM.7z. In a previous video (ruclips.net/video/TEfvVOEF0e0/видео.html) I have shown how to create such models.
ngspice in KiCad 8: Creating a (digital) subcircuit model for a multipart device (74HC10)
Просмотров 1,3 тыс.7 месяцев назад
KiCad8/ngspice models for digital devices like the 74xxx series have to serve multi-part units. The IC may contain more than one unit (2 to 6). The device models available typically describe only a single unit, e.g. one NAND gate. So we need to translate a model from single unit to full symbol. For this purpose we create a ngspice subcircuit for the 74HC10 containing 3 NAND gates with each havi...
ngspice in KiCad 8: optimizing a bipolar amplifier
Просмотров 3,3 тыс.7 месяцев назад
Using Fourier analysis and the "tuner" tool of Eeschema, we improve a bipolar amplifier.
ngspice in KiCad 8: amplifier using the TI OPA1641 audio opamp
Просмотров 9 тыс.7 месяцев назад
Setting up and simulating an amplifier using the TI OPA1641 audio opamp.
ngspice in KiCad 8: inverting amplifier with generic opamp
Просмотров 3,7 тыс.7 месяцев назад
Simulating a simple inverting amplifier with a generic operational amplifier
ngspice in KiCad 8: simulation basics
Просмотров 7 тыс.7 месяцев назад
Introduction to simulation with ngspice in KiCad: simulate the operating point of a resistive divider

Комментарии

  • @mubafaw
    @mubafaw 4 дня назад

    Thank you 😊

  • @rich4239
    @rich4239 5 дней назад

    thanks was struggling to get first sim working and this was the key

  • @triantoadifx
    @triantoadifx 10 дней назад

    How to simulate transistor with ic 7812 ?

  • @kensmith5694
    @kensmith5694 21 день назад

    I recommend against using this circuit in real life but if you do, this version is a good one to use if you have the parts needed. The thresholds on HC parts can vary a lot so the timing will not be the same for rising and falling inputs. Doing 2 stages with the 2nd delay having an inverted signal partly compensates for this. Adding just the right value of inductor in series with the resistor can also help to get the timings more repeatable. Still don't do it in real life if you have another option.

  • @josesaumell2908
    @josesaumell2908 Месяц назад

    Very helpful video, thank you!

  • @andymouse
    @andymouse Месяц назад

    Awesome !

  • @rrsounds
    @rrsounds 2 месяца назад

    This is an excellent series of introductory videos for doing simulation in KiCad. I need to get my feet wet, so to speak, and you have given me the tools to do so!

  • @DonHaig-k9b
    @DonHaig-k9b 2 месяца назад

    I have been following your tutorials. Thank you for posting them! When I get to the transient simulation in this tutorial it throws the following error: Error on line 0 : a.xu1.x_s1.as_s1 %gd xu1.n2992267 xu1.clamp %gd xu1.n2992267 xu1.clamp xu1.x_s1:a_s1 MIF-ERROR - unable to find definition of model xu1.x_s1:a_s1 Error: circuit not parsed. Error: vector time not found! Error: vector time not found! As I am new to using this tool, I am at a loss. What am I missing? (KiCad 8 on Ubuntu 22.04) Thanks again.

    • @DonHaig-k9b
      @DonHaig-k9b 2 месяца назад

      For others who may run into this issue. I upgraded from KiCad 7 to Kicad 8 using: sudo add-apt-repository ppa:kicad/kicad-8.0-releases sudo apt update sudo apt install kicad The following commands resolved the issue: sudo apt remove "*ngspice*" sudo apt install kicad Thank you to dsa-t on the KiCad Info Forum for the answer

  • @010_teukuzikrifatahillah6
    @010_teukuzikrifatahillah6 2 месяца назад

    your tutorial is insane, great explanation

  • @wahagabdulghani7286
    @wahagabdulghani7286 2 месяца назад

    I want to add DC 12 V to my schematic but after added it it dose not have a simulation model, how can I add a 12V dc sores to my schematic

  • @jcpk2925
    @jcpk2925 3 месяца назад

    Very good, we are waiting for the rest of the tutorial.... Thank you.

  • @stemscience1
    @stemscience1 4 месяца назад

    ruclips.net/video/_OrjdUVnkdg/видео.html KiCAD and SPICE simulations GUIDE

  • @grahamnichols1416
    @grahamnichols1416 4 месяца назад

    Excellent! Liked and subscribed. Please continue with the series. It is invaluable for beginners.

  • @PreludeSon
    @PreludeSon 5 месяцев назад

    This is excellent!

  • @PreludeSon
    @PreludeSon 5 месяцев назад

    Such a great tutorial, really appreciated this

  • @torpemil6654
    @torpemil6654 5 месяцев назад

    hey, thanks for this series. I tried this with the opamp OPA 1602. But the Kicad 8 implemented opamp symbol has not pins for vcc and vee (it has just 3 pins 1=out,2=(-),3=(+)), but in that pineditor text the power supply where mentioned (.SUBCKT OPA160x IN+ IN- VCC VEE OUT ). So i guessed I just follow that text file with the pin editing: (pin1=out,pin2=(-),pin3=(+),pin4=(V-),pin5=(V+)). I even edited the symbol and added Pin 4 and 8 for VEE and VCC. But nothing worked. A Video how to get a OPA1602 or 1678 working would be much appreciated!!! thank you

    • @holger8105
      @holger8105 5 месяцев назад

      Indeed the symbol has 8 pins, as the real 1602 circuit has. Select the symbol, then click three times onto the Eeschema canvas: A and B opamp part symbols, C as the power pins. The simulation model has only 5 pins, as is common for opamps. So some translation is required between model and symbol. Currently this has to be done manually by the user, see ngspice.sourceforge.io/ngspice-eeschema.html#multi for an example. Yes, I should do a video about this.

  • @s_s-g4d
    @s_s-g4d 6 месяцев назад

    what simulation models did you use for the gates?

  • @HansWurst-bk9sb
    @HansWurst-bk9sb 6 месяцев назад

    Hi Holger, how to convert the inputs and outputs of the digital parts then into near-real-life values with input thresholds and output voltages? Is there a handy mechanism for then transition into analog simulation again?

  • @ion1969
    @ion1969 6 месяцев назад

    Thanks for a great series of videos! It has the right pace and right level of detail. 🎉🎉🎉

  • @JakePoznanski
    @JakePoznanski 6 месяцев назад

    Awesome series for refreshing my memory on SPICE and also making it practical with the great KiCad tools you show. Thank you!

  • @Dunkelwind
    @Dunkelwind 6 месяцев назад

    doesn't work 😔 Error: there is no circuit loaded. Warning: Nesting of subcircuits with parameters is only marginally supported! warning, can't find model 1prebar Circuit: KiCad schematic Too few parameters for subcircuit type "74hc74" (instance: xxua) Too few parameters for subcircuit type "74hc74" (instance: xxub) Same problem at a 74HC02 project. Here is a little bug with the pin-nr's: Xnand1 2 2 1 74HC02 But that is not the main problem. Version: 8.0.1-8.0.1-0~ubuntu20.04.1, release build ngspice: 42 Compiler: GCC 9.4.0 with C++ ABI 1013

    • @holger8105
      @holger8105 6 месяцев назад

      Hmm, it works, at least for me (using MS Windows). There might be an installation problem (with the code models) on Ubuntu. Could you please post yor question/report at forum.kicad.info/ (where also Ubuntu users are active)?

    • @holger8105
      @holger8105 6 месяцев назад

      A working example is available at forum.kicad.info/t/how-do-i-simulate-a-74ls74-flipflop-using-ngspice-41/45571/12

  • @over2there
    @over2there 7 месяцев назад

    Can you do a C integration tutorial please? See here: ngspice.sourceforge.io/docs/others/c-process-CoSim.pdf

  • @osha1237
    @osha1237 7 месяцев назад

    Thank you very much. Your Videos have been very resourceful to me

  • @lingyai1000
    @lingyai1000 7 месяцев назад

    Thank you

  • @mogalagadiphahleng921
    @mogalagadiphahleng921 7 месяцев назад

    Thanks you saved my Day

  • @wolpumba4099
    @wolpumba4099 7 месяцев назад

    *Abstract* This video tutorial demonstrates how to simulate an audio amplifier circuit using the OPA1641 operational amplifier in KiCad 8 [edited] and NGspice. Key concepts and steps covered in the video include: * *Circuit Design:* Creating a schematic for an inverting amplifier configuration with a gain of 10. * *Component Selection:* Choosing resistors, power supplies, and an input voltage source with appropriate values * *Obtaining Spice Model:* Downloading the OPA1641 Spice model from the Texas Instruments website. * *Model Integration:* Attaching the downloaded spice model to the OPA1641 symbol in the schematic. * *Pin Mapping:* Correctly mapping model pins to symbol pins for accurate simulation. * *Simulations:* Performing both transient and AC simulations to analyze the amplifier's time-domain response and frequency response. *Summary* * *0:00* Create a new KiCad project and name it appropriately. * *0:35* Find, select, and place the OPA 1641 amplifier symbol in the workspace. * *1:43* Add resistors, ground, and power supply symbols to the project. * *2:33* Add necessary power symbols (VCC and VRE). * *3:19* Add labels for input (in) and output (out). * *3:53* Connect power supplies to amplifier. * *5:11* Assign values to power supplies (+15v, -15v) and resistors (10k and 100k for amplification factor of 10). * *5:40* Add input voltage using the Vsin (sinusoidal input symbol). * *6:19* Configure Vsin with DC=0, Amplitude=0.1, Frequency=1khz and set the AC tag to 1 for AC simulation. *Finding and Integrating the Spice Model* * *6:55* TI provides the necessary spice model. Search on their website, download, and extract. * *8:19* Examine the `.lib` file to confirm it contains the OPA 1641 subcircuit model. * *9:14* Save the `.lib` file within the project directory. * *9:45* Attach the model to the OPA 1641 symbol in KiCad. * *10:30* Be aware: Pin layouts in the spice model might not match the symbol. Adjust pin mappings carefully within the model editor. *Setting Up and Running Simulations* * *12:57* Start with a Transient simulation * *13:15* Set appropriate time resolution and final time (example: 10us and 10ms) * *13:36* Mark the in and out voltages for plotting. * *13:44* Run the simulation. Verify the input amplitude of 0.1 and expected output indicating amplification by a factor of 10. * *14:16* Set up an AC Simulation * *14:29* 10 points per decade. Start frequency 10 Hz, end frequency 10 MHz * *14:53* Select the output to observe the gain/phase response. * *15:07* Run the AC simulation. Observe the frequency response. *Saving Your Work* * *15:50* Save the simulation setup for future use. * *16:14* Save the circuit diagram. Disclaimer: I used gemini advanced 1.0 (2024.03.04) to summarize the youtube video transcript. This method may make mistakes in recognizing words

    • @holger8105
      @holger8105 7 месяцев назад

      You as the poster are responsible for the correctness of your post, nobody else, with disclaimer or without. Please check your posting. There is no Keysight, what is Keycad, for example.

    • @wolpumba4099
      @wolpumba4099 7 месяцев назад

      @@holger8105 Sorry, i will edit it.

  • @BruSilveira0
    @BruSilveira0 7 месяцев назад

    Can you explain about FFT? The pure sinusoidal 1khz/1V source, with 100ns timestep and 100ms samples... the graph appears to not have enough samples. In LTspice I use the options plotwinsize=0 and numdgt=24 to improve the graph a lot, but in ngspice I don't know how to apply this, can you help? Thanks!

  • @hyneklos
    @hyneklos 7 месяцев назад

    nice, thx !

  • @Leezorc
    @Leezorc 7 месяцев назад

    Great! You have a new sub. Good content

  • @yuriy.kostenko
    @yuriy.kostenko 7 месяцев назад

    This is very useful for newcamers like. Please continue this series!

  • @arturwiebe7482
    @arturwiebe7482 7 месяцев назад

    Very concise. Perfect.

  • @peatmoss4415
    @peatmoss4415 7 месяцев назад

    The only reason this circuit oscillates is because of the variance of tolerances of the components. If you pair the transistors and capacitors and resistors it won't oscillate unless you take a wire and short a couple of legs of the transistors for a split second. (or discharge one capacitor and charge the other) This is a sample circuit in electronics training. In that one, an LED is placed above the collector of the transistors. This simulation might have a random variable in the algorithm to resemble the variances in component manufacturing. TinkerCad is another simulation online.

  • @SirGullefjun
    @SirGullefjun 7 месяцев назад

    Beginning to use this and it is quite nice! Understanding ngspice syntax is a bonus so I am beginning to study the docs now. Regarding spice model for a custom element. I try using the PARAMS: keyword to make the parameters available in Kicad. It works but I get an error in the beginning of the log. Cannot find the model it says for each parameter. For future it would be better to have the spice model file in the actual element itself and make the box editable…. One less file to keep track of. Thanks for all great work!

  • @ivolol
    @ivolol 7 месяцев назад

    How could one learn on their own that to get a better representation for certain simulations they can change an integration method from "trap" to "gear" (both terms I have no clue about)? Would you just have to get really lucky in a google search?

    • @holger8105
      @holger8105 7 месяцев назад

      My (old school) advice would be: grab a book about SPICE simulation. A list of books is given here: ngspice.sourceforge.io/books.html . I would recommend the book by Tadej Tuma , Árpád Buermen. Also the book by Kielkowski directly answers your question. Hopefully there is a library near your place which offers such technical books.

  • @hardrocklobsterroll395
    @hardrocklobsterroll395 7 месяцев назад

    Thank you for sharing 8 is another step in the FOSS community getting to a full fledged production software

  • @bigbazer
    @bigbazer 7 месяцев назад

    Thanks for the video and I’m looking forward to more videos you make on Kicad 8. I found it was easy to follow for a complete novice to Kicad 8 like me.

  • @elirosenberg6603
    @elirosenberg6603 7 месяцев назад

    Thank you so much for showing how to use ngspice with KiCad 8. It's also great that we can mix analog and digital. I would recommend reading the app note "Implications of Slow or Floating CMOS Inputs (Rev. E)" when using HC logic with more than 0.1μs input rise times.

  • @djsbriscoe
    @djsbriscoe 7 месяцев назад

    Thank you for creating this channel :)

  • @luis11347
    @luis11347 7 месяцев назад

    Great content. Thanks

  • @dixsusu
    @dixsusu 7 месяцев назад

    Keep it simple and under 20 minutes and your ch will boost ! Great content .

  • @terrysouthwood4757
    @terrysouthwood4757 7 месяцев назад

    Thank you for these videos. They are going to be useful for me as I intend to explore using the analogue simulation in Kicad. Great job, just the right pace, not going to deep and not assuming to much prior knowledge. I just binge watched the videos and I am looking forward to any further videos you have time to produce.

  • @SoundSleuth
    @SoundSleuth 7 месяцев назад

    This is one of my goto Op Amps so great to see a simple Spice simulation and with KiCad8. Thank you!

  • @splackism
    @splackism 7 месяцев назад

    Thanks for the video. It might be nicer to use keyboard shortcuts to speed things up a little.

    • @bigbazer
      @bigbazer 7 месяцев назад

      I’m completely new to Kicad 8 and I don’t need things speeding up with keyboard shortcuts or I will get lost, I just need to learn the program and know where to click to find stuff. But I’m finding the shortcuts as I go along and using them when I can remember them.

  • @HUEHUEUHEPony
    @HUEHUEUHEPony 7 месяцев назад

    Another question that is less offtopic, how does the models know where ground and power is since you never defined it?, I know that they dont need it, but still, how do they know?, how can they tell that I plugged 7 or 14 at the right place?

    • @holger8105
      @holger8105 7 месяцев назад

      They don't make use of 7 and 14, they don't need it, as internally it is a fast 1 and 0 event based logic simulation, like in a logic simulator.

  • @HUEHUEUHEPony
    @HUEHUEUHEPony 7 месяцев назад

    dumb question, is it possible for me to edit the schematic of a symbol or footprint, then I could theoretically do the AND gate with nmos and pmos myself and just copy paste from there. Then I would have the subcircuit schematic and simulation of whichever model I wanted. The reason why I ask this is because I wanted to simulate the cd4081 in kicad, but it seems everywhere I look the spice syntax is not compatible with ngspice leaving me with a lot of frustration. Also the naming is confusing 74HC10 is not really a 74HC10 but a NAND(3) gate, they could just mention that instead of false advertising they have the complete package. And that is work to the reader.

    • @holger8105
      @holger8105 7 месяцев назад

      Please have a look at forum.kicad.info/t/how-do-i-simulate-a-74ls74-flipflop-using-ngspice-41/45571/11 how to find a model for the 4081.

    • @holger8105
      @holger8105 7 месяцев назад

      All these models for other simulators are compatible to ngspice, but not to KiCad/ngspice, as KiCad/ngspice is the only simulator which simulates complete packaged ICs. All the others simulate individual gates, and you may place as many as you like. In KiCad/ngspice the symbol rules, as the whole business stems from PCB design. If you have done your model for your symbol, you may publish it, to help others, and so some day we have all relevant symbol/model combinations available.

  • @Electheo
    @Electheo 7 месяцев назад

    Great and detailed walkthrough, thanks!