{"id":395,"date":"2024-02-29T17:50:23","date_gmt":"2024-02-29T16:50:23","guid":{"rendered":"https:\/\/chauquest.com\/?p=395"},"modified":"2025-02-08T06:27:48","modified_gmt":"2025-02-08T05:27:48","slug":"make-simulation-on-kicad-my-favorite-tool","status":"publish","type":"post","link":"https:\/\/chauquest.com\/index.php\/engineering\/make-simulation-on-kicad-my-favorite-tool\/","title":{"rendered":"Make Simulation On Kicad 8.0 : My Favorite Tool"},"content":{"rendered":"<div class=\"wp-block-post-excerpt\"><p class=\"wp-block-post-excerpt__excerpt\">Today, I&#8217;m excited to introduce you to my simulation library on KiCad. Yes we can do simulation on this amazing software ! Let&#8217;s discover this together. <\/p><\/div>\n\n\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p>KiCad is a popular choice among electronic hobbyists for a wide range of projects, from microcontroller boards to PCB antennas and even 8-bit computers. While it may not be widely known for simulation in forums, this open-source software is actually packed with impressive simulation features!<\/p>\n\n\n\n<p>In this article, I&#8217;ll delve into how KiCad handles simulation and what it&#8217;s capable of achieving. I&#8217;ll also provide tips on finding simulation models online and share my personal KiCad library, complete with example projects for each component included.<\/p>\n\n\n\n<p><em>For this article I use Kicad Version 8.0.0, release build.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Kicad Version 8.0.0<\/h3>\n\n\n\n<p>How timely for this article! KiCad Version 8.0.0 has just been released, with simulation being one of its key focuses!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Kicad, a simulation tool ?<\/h2>\n\n\n\n<p>KiCad comes equipped with a variety of simulators, including LTSpice, PSpice, and HSpice. What does this mean? Essentially, KiCad has the capability to run nearly every standard simulation model provided by manufacturers. In my experience, the majority of these models are PSpice models.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Let&#8217;s dive into Kicad Simulation aspect<\/h3>\n\n\n\n<p>The magic happens in the Schematic editor. Here, we can define various types of components :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Simulated electrical component (your favorite OpAmp, resistor, capacitor, inductance&#8230;)<\/li>\n\n\n\n<li>Non-Simulated electrical component (decoupling capacitor, connector&#8230;)<\/li>\n\n\n\n<li>Simulation component (simulation ground, voltage source&#8230;)<\/li>\n<\/ul>\n\n\n\n<p>To select the behavior of each component in your schematic, you can access the Attributes section in the Symbol property panel by pressing the key &#8216;E&#8217; while selecting a component:<\/p>\n\n\n\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69fa143383ffc&quot;}\" data-wp-interactive=\"core\/image\" class=\"wp-block-image size-full is-resized is-style-rounded is-style-rounded--1 wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"741\" height=\"521\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/image-5.png\" alt=\"\" class=\"wp-image-397\" style=\"width:324px;height:auto\" srcset=\"https:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/image-5.png 741w, https:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/image-5-300x211.png 300w\" sizes=\"auto, (max-width: 741px) 100vw, 741px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on-async--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69fa143384a14&quot;}\" data-wp-interactive=\"core\/image\" class=\"wp-block-image size-full is-resized is-style-rounded is-style-rounded--2 wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"276\" height=\"175\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/image-4.png\" alt=\"\" class=\"wp-image-396\" style=\"width:376px;height:auto\"\/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on-async--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Simulated electrical component : nothing ticked<\/li>\n\n\n\n<li>Non-simulated electrical component : <strong>Exclude from simulation ticked<\/strong><\/li>\n\n\n\n<li>Simulation component : <strong>Exclude from BoM and board ticked<\/strong><\/li>\n<\/ul>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">A component exemple : the potentiometer<\/h3>\n\n\n\n<p>Consider this scenario: You&#8217;re looking to integrate a varistor or potentiometer into your circuit to establish a precise voltage threshold. While these components are straightforward, they do come with certain parameters. Exploring their functionality within KiCad&#8217;s simulation environment presents an excellent opportunity to understand how KiCad handles circuit analysis and validation.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69fa1433855f4&quot;}\" data-wp-interactive=\"core\/image\" class=\"wp-block-image aligncenter size-large is-resized is-style-rounded is-style-rounded--3 wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"569\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/image-6-1024x569.png\" alt=\"\" class=\"wp-image-400\" style=\"width:494px;height:auto\" srcset=\"https:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/image-6-1024x569.png 1024w, https:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/image-6-300x167.png 300w, https:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/image-6-768x427.png 768w, https:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/image-6.png 1494w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on-async--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><figcaption class=\"wp-element-caption\">Our schematic<\/figcaption><\/figure>\n\n\n\n<p>On our schematic we have a voltage source (Simulation component) and our Trimmer resistor. Let&#8217;s dive into the Trimmer resistor simulation parameter (access from component property)<\/p>\n\n\n\n<div class=\"wp-block-group is-content-justification-center is-nowrap is-layout-flex wp-container-core-group-is-layout-23441af8 wp-block-group-is-layout-flex\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69fa143386016&quot;}\" data-wp-interactive=\"core\/image\" class=\"wp-block-image size-full is-resized is-style-rounded is-style-rounded--4 wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"560\" height=\"521\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/image-7.png\" alt=\"\" class=\"wp-image-401\" style=\"width:463px;height:auto\" srcset=\"https:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/image-7.png 560w, https:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/image-7-300x279.png 300w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on-async--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><figcaption class=\"wp-element-caption\">How Kicad interpret this component for the simulation<\/figcaption><\/figure>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69fa14338696e&quot;}\" data-wp-interactive=\"core\/image\" class=\"wp-block-image size-full is-resized is-style-rounded is-style-rounded--5 wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"561\" height=\"526\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/image-8.png\" alt=\"\" class=\"wp-image-402\" style=\"width:467px;height:auto\" srcset=\"https:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/image-8.png 561w, https:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/image-8-300x281.png 300w\" sizes=\"auto, (max-width: 561px) 100vw, 561px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on-async--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><figcaption class=\"wp-element-caption\">Reference tab is actually VARYSTOR.lib<\/figcaption><\/figure>\n<\/div>\n\n\n\n<p>In the Model section, KiCad utilizes the component model <strong>VARYSTOR <\/strong>from a SPICE file named <em>VARYSTOR.lib<\/em>. This model incorporates two parameters, <strong>Rtot=1k<\/strong> and <strong>Part=0.5<\/strong>. Upon examining the pin assignment, it&#8217;s evident that each pin is appropriately assigned to its corresponding symbol pin. For a trimmer resistor, the Wiper pin represents the variable output of our potentiometer, ensuring our symbol is correctly configured.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">In-schematic parameter setup<\/h4>\n\n\n\n<p>Notice that our model features two parameters named <strong>Rtot <\/strong>and <strong>Part<\/strong>. Typically, KiCad stores these parameters within the Simulation Model Editor. However, we have the option to link these parameters, allowing us to modify them directly in the schematic editor, as depicted in the first picture.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69fa143387093&quot;}\" data-wp-interactive=\"core\/image\" class=\"wp-block-image aligncenter size-full is-resized wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"706\" height=\"200\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/image-9.png\" alt=\"\" class=\"wp-image-405\" style=\"width:706px;height:auto\" srcset=\"https:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/image-9.png 706w, https:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/image-9-300x85.png 300w\" sizes=\"auto, (max-width: 706px) 100vw, 706px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on-async--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p>You need to add a Fields called <strong>Sim.Params<\/strong> with the different parameter separated by space formated like this : <em>name=value <\/em><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">A little bit of Spice coding<\/h4>\n\n\n\n<p>This model has been handcrafted by myself, so I can provide insights into how it operates! Spice code differs significantly from other types of code; each line defines a component with its type, name, connections, and behavior.<\/p>\n\n\n\n<p>The most effective approach is to study manufacturer libraries and Spice manuals to grasp the full range of possibilities offered by Spice. Unfortunately, there appears to be a limited amount of resources available on the internet for learning Spice programming&#8230;<\/p>\n\n\n\n<p>Let&#8217;s dive into <em>Varystor.lib<\/em> : <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.SUBCKT VARYSTOR CCW Wiper CW Rtot = 10e3 Part = 0.5<br><mark style=\"background-color:rgba(0, 0, 0, 0);color:#ff6900\" class=\"has-inline-color\">*I define a sub component called VARYSTOR with CCW Wiper CW as connection and base parameter value Rtot = 10e3 and Part=0.5<\/mark><br>R1 CCW Wiper {Rtot*Part}<br><mark style=\"background-color:rgba(0, 0, 0, 0);color:#ff6900\" class=\"has-inline-color\">* I put a Resistance called R1 between CCW and Wiper of Value Rtot*Part<br><\/mark>R2 CW Wiper {Rtot * (1-Part)}<br><mark style=\"background-color:rgba(0, 0, 0, 0);color:#ff6900\" class=\"has-inline-color\">* I put a Resistance called R2 between CW and Wiper of Value Rtot*(1-Part)<\/mark><br>.ENDS<br><mark style=\"background-color:rgba(0, 0, 0, 0);color:#ff6900\" class=\"has-inline-color\">* end of the sub component definition<\/mark><\/code><\/pre>\n\n\n\n<p>In KiCad, I&#8217;ve chosen the subcomponent <strong>VARYSTOR <\/strong>to represent the actual model of my component.<\/p>\n\n\n\n<p>When downloading a Spice model from a manufacturer, you often need to create a subcircuit (subckt) with the correct pin order and the appropriate number of channels. For example, if you&#8217;re looking for a model of a quad OpAmp, you might only find a 1-channel model in the PSpice library. In this case, you would need to create a 4-channel subcomponent to accurately represent it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.SUBCKT TLV9062_Mono IN+ VEE IN- OUT Vcc<br><mark style=\"background-color:rgba(0, 0, 0, 0);color:#ff6900\" class=\"has-inline-color\">*I define a sub component called TLV9062_Mono with IN+ VEE IN- OUT Vcc as connection<\/mark><br>XU1A IN+ IN- Vcc VEE OUT TLV9062<br><mark style=\"background-color:rgba(0, 0, 0, 0);color:#ff6900\" class=\"has-inline-color\">*<mark style=\"background-color:rgba(0, 0, 0, 0);color:#ff6900\" class=\"has-inline-color\">I put a<\/mark><\/mark> <mark style=\"background-color:rgba(0, 0, 0, 0);color:#ff6900\" class=\"has-inline-color\">component called XU1A that have connection IN+ IN- Vcc VEE OUT <mark style=\"background-color:rgba(0, 0, 0, 0);color:#ff6900\" class=\"has-inline-color\">and follows<\/mark><\/mark> <mark style=\"background-color:rgba(0, 0, 0, 0);color:#ff6900\" class=\"has-inline-color\">the behavior of the (sub)component TLV9062<\/mark><br>.ENDS<br><br>.SUBCKT TLV9062_Dual OUT1 IN1- IN1+ VEE IN2+ IN2- OUT2 Vcc<br><mark style=\"background-color:rgba(0, 0, 0, 0);color:#ff6900\" class=\"has-inline-color\">*I define a sub component called TLV9062_Dual with OUT1 IN1- IN1+ VEE IN2+ IN2- OUT2 Vcc as connection<\/mark><br>XU1A IN1+ IN1- Vcc VEE OUT1 TLV9062<br><mark style=\"background-color:rgba(0, 0, 0, 0);color:#ff6900\" class=\"has-inline-color\">*<mark style=\"background-color:rgba(0, 0, 0, 0);color:#ff6900\" class=\"has-inline-color\"><mark style=\"background-color:rgba(0, 0, 0, 0);color:#ff6900\" class=\"has-inline-color\">I put a<\/mark><\/mark> <mark style=\"background-color:rgba(0, 0, 0, 0);color:#ff6900\" class=\"has-inline-color\">component<\/mark> called XU1A that have connection IN1+ IN1- Vcc VEE OUT1 and follows the behavior of the (sub)component TLV9062<\/mark><br>XU1B IN2+ IN2- Vcc VEE OUT2 TLV9062<br><mark style=\"background-color:rgba(0, 0, 0, 0);color:#ff6900\" class=\"has-inline-color\">*<mark style=\"background-color:rgba(0, 0, 0, 0);color:#ff6900\" class=\"has-inline-color\"><mark style=\"background-color:rgba(0, 0, 0, 0);color:#ff6900\" class=\"has-inline-color\">I put a<\/mark><\/mark> <mark style=\"background-color:rgba(0, 0, 0, 0);color:#ff6900\" class=\"has-inline-color\">component<\/mark> called XU1B<\/mark> <mark style=\"background-color:rgba(0, 0, 0, 0);color:#ff6900\" class=\"has-inline-color\">that have connection IN2+ IN2- Vcc VEE OUT2 <mark style=\"background-color:rgba(0, 0, 0, 0);color:#ff6900\" class=\"has-inline-color\">and follows<\/mark><\/mark> <mark style=\"background-color:rgba(0, 0, 0, 0);color:#ff6900\" class=\"has-inline-color\">the behavior of the (sub)component TLV9062<\/mark><br>.ENDS<br><br>.SUBCKT TLV9062_Quad OUT1 IN1- IN1+ VEE IN2+ IN2- OUT2 OUT3 IN3- IN3+ Vcc IN4+ IN4- OUT4  <br>XU1A IN1+ IN1- Vcc VEE OUT1 TLV9062<br>XU1B IN2+ IN2- Vcc VEE OUT2 TLV9062<br>XU1C IN3+ IN3- Vcc VEE OUT3 TLV9062<br>XU1D IN4+ IN4- Vcc VEE OUT4 TLV9062<br>.ENDS<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Simulation panel<\/h4>\n\n\n\n<p>Now that you&#8217;ve completed your circuit, it&#8217;s time to run our simulation. To do this, we need to open the simulator panel, located in the <em>Inspect <\/em>tab.<\/p>\n\n\n\n<div class=\"wp-block-group is-content-justification-center is-nowrap is-layout-flex wp-container-core-group-is-layout-23441af8 wp-block-group-is-layout-flex\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69fa143387b4d&quot;}\" data-wp-interactive=\"core\/image\" class=\"wp-block-image size-large is-resized wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"628\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/image-13-1024x628.png\" alt=\"\" class=\"wp-image-416\" style=\"width:607px;height:auto\" srcset=\"https:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/image-13-1024x628.png 1024w, https:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/image-13-300x184.png 300w, https:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/image-13-768x471.png 768w, https:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/image-13.png 1075w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on-async--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69fa14338815d&quot;}\" data-wp-interactive=\"core\/image\" class=\"wp-block-image size-full is-resized wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"556\" height=\"540\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/image-15.png\" alt=\"\" class=\"wp-image-418\" style=\"width:388px;height:auto\" srcset=\"https:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/image-15.png 556w, https:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/image-15-300x291.png 300w\" sizes=\"auto, (max-width: 556px) 100vw, 556px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on-async--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n<\/div>\n\n\n\n<p>Before initiating a simulation, it&#8217;s essential to configure your simulation environment in the Simulation Command menu. Here, you can choose from various simulation presets. For FSAE boards, I primarily conduct transient simulations, which track the circuit&#8217;s behavior over time. Remember to select the appropriate compatibility mode; PSpice and LTSpice modes typically suffice for most simulations.<\/p>\n\n\n\n<p>Once configured, simply click &#8216;Run&#8217; to begin the simulation. You can then monitor different signals by using the Probe tool to click on the wires in the schematic.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69fa143388bb1&quot;}\" data-wp-interactive=\"core\/image\" class=\"wp-block-image aligncenter size-large is-resized wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"555\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/image-16-1024x555.png\" alt=\"\" class=\"wp-image-419\" style=\"width:823px;height:auto\" srcset=\"https:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/image-16-1024x555.png 1024w, https:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/image-16-300x163.png 300w, https:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/image-16-768x416.png 768w, https:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/image-16.png 1216w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on-async--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p>If you wish to conduct further analysis, you have the option to save all data in a CSV file for thorough examination. Alternatively, within KiCad, you can utilize cursors to inspect signals directly. Simply tick on the signal where you wish to place a cursor.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Build you own library<\/h2>\n\n\n\n<p>In this brief section, I&#8217;ll share some of my advice on building a library or selecting components for your project.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">General advices<\/h3>\n\n\n\n<p>Later, I&#8217;ll delve deeper into this topic with a dedicated article, but for now, I&#8217;ll share a few helpful tips:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>For hobbyist don&#8217;t go lower than 0603 resistor\/capacitor, it will be painful otherwise.<\/li>\n\n\n\n<li>Buy a set of resistor and capacitor it is way more easier.<\/li>\n\n\n\n<li>Use SMD led it is brighter, cheaper and more usefull.<\/li>\n\n\n\n<li>focus on few common different component packages : (the list above got size that you can solder pretty easily)\n<ul class=\"wp-block-list\">\n<li>SOIC<\/li>\n\n\n\n<li>SOT-23<\/li>\n\n\n\n<li>SC70 <\/li>\n\n\n\n<li>TSSOP<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Only buy component that are in stock and not rated as<em> End of production<\/em>.<\/li>\n\n\n\n<li>2.54mm pitch connector are really common. THT connector will resist more heavily.<\/li>\n\n\n\n<li>Use high-end voltage regulator, it will forgive your mistake and doesn&#8217;t fry when short circuit.<\/li>\n\n\n\n<li>Follow <strong>Typical application<\/strong> section in datasheet to avoid mistakes.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Find symbols and Spice model<\/h3>\n\n\n\n<p>Typically, you&#8217;ll find the symbol of a component for KiCad by using specialized search engines. Personally, I rely on Component Search Engine and SnapMagic. If your component isn&#8217;t available in these resources, it&#8217;s likely because you&#8217;re seeking something uncommon, and you may need to explore alternative options.<\/p>\n\n\n\n<p>Finding Spice models can be more challenging. Generally, Mosfets, OpAmps, and other components are available on the manufacturer&#8217;s website, albeit sometimes in less accessible areas. For instance, Texas Instruments offers a wide range of models. In some cases, I search for general models like D-Latch and NE555. For transient simulations, you don&#8217;t always require highly precise models since you&#8217;re primarily interested in confirming behavior.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Formating your library<\/h3>\n\n\n\n<p>Now that you&#8217;ve selected your component and imported the symbol into your local or global library, it&#8217;s important to ensure uniformity across all components. If every component in your project shares the same component field, you can easily export your bill of materials with a single click, automating tasks such as generating Mouser carts or preparing files for board manufacturing companies. Personally, I check the following for each component:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Field placement \/ visibility<\/li>\n\n\n\n<li>set the <strong>Datasheet <\/strong>field<\/li>\n\n\n\n<li>set the <strong>Manufacturer_Part_Number <\/strong>field<\/li>\n\n\n\n<li>set the <strong>Mouser Part Number<\/strong> field<\/li>\n\n\n\n<li>part has a standard footprint<\/li>\n\n\n\n<li>If the PSpice simulation field has the correct input\/output and the correct file is linked<\/li>\n<\/ul>\n\n\n\n<p>Overall you can check my library, you will see how everything is made.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">My library<\/h2>\n\n\n\n<p>I&#8217;m thrilled to introduce you to my Simulation library for KiCad. This library is packed with simulations for standard and highly useful components!<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Component list<\/h3>\n\n\n\n<p>Here is the list of the component : <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Comparator (Mono, Dual, Quad)<\/li>\n\n\n\n<li>OpAmp (Mono, Dual, Quad)<\/li>\n\n\n\n<li>D-Latch<\/li>\n\n\n\n<li>general use Diode, Resistor, capacitor<\/li>\n\n\n\n<li>AND, NAND, NOR, OR, XOR 1 channel gate<\/li>\n\n\n\n<li>PMOS, NMOS, Depletion NMOS<\/li>\n\n\n\n<li>Solid state relays<\/li>\n\n\n\n<li>NE555 Timer<\/li>\n\n\n\n<li>Trimmer Resistor<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Exemple simulation file<\/h3>\n\n\n\n<p>I have made some exemple file for the different component and use case.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Buffer OpAmp<\/li>\n\n\n\n<li>Comparator<\/li>\n\n\n\n<li>D-latch initialisation (<a href=\"https:\/\/chauquest.com\/index.php\/engineering\/formula-student\/in-depth-review-of-the-tsal-design-and-explanation\/\" target=\"_blank\" rel=\"noopener\" title=\"In-depth review of the TSAL : design and explanation\">TSAL Dlatch circuit<\/a>)<\/li>\n\n\n\n<li>Pspice Initial Condition<\/li>\n\n\n\n<li>SCS Dual Comparator (<a href=\"https:\/\/chauquest.com\/index.php\/engineering\/formula-student\/fs-scs-how-to-detect-open-circuit-in-analog-signal\/\" title=\"FS SCS, how to detect open circuit in analog signal\">SCS simulation circuit<\/a>)<\/li>\n\n\n\n<li>Trimmer resistor<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">How to install the library<\/h3>\n\n\n\n<p>It&#8217;s straightforward to get started. Simply download the archive and import the symbol library and the footprint library. The symbol library, named <strong>Basic_SPICE.kicad_sym<\/strong>, can be found in the folder <strong>KicadLib\\Basic_SPICE<\/strong>. The footprint library is located in the folder called <strong>Basic.pretty<\/strong>.<\/p>\n\n\n\n<p>To ensure the simulation works smoothly and the 3D files display correctly, you&#8217;ll need to create two custom path in the preferences tab.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The first one called <strong>BASIC_3D <\/strong>pointing to <strong>KicadLib\\Basic_3D<\/strong> folder.<\/li>\n\n\n\n<li>The second one called <strong>SP_BASIC <\/strong>pointing to <strong>KicadLib\\Basic_SPICE\\Lib<\/strong> folder.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Annexes<\/h3>\n\n\n\n<p>I&#8217;m currently in the process of building another library for non-simulated components called <strong>Basic_UTIL<\/strong>. Additionally, I&#8217;ve included helpful internet resources in the <strong>help <\/strong>folder. Eventually, everything will be stored on GitHub for easy access.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Download link<\/h3>\n\n\n\n<p>You can download the latest version of my library from the link provided here.<\/p>\n\n\n\n<div class=\"wp-block-file aligncenter\"><a id=\"wp-block-file--media-6e736e22-b1e3-40e8-ae5b-b4c9e0b325ee\" href=\"http:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/KicadLib.rar\">KicadLib<\/a><a href=\"http:\/\/chauquest.com\/wp-content\/uploads\/2024\/02\/KicadLib.rar\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-6e736e22-b1e3-40e8-ae5b-b4c9e0b325ee\">Download<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Today, I&#8217;m excited to introduce you to my simulation library on KiCad. Yes we can do simulation on this amazing software ! Let&#8217;s discover this together.<\/p>\n","protected":false},"author":1,"featured_media":424,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"footnotes":""},"categories":[42,6],"tags":[25,26,27,28],"class_list":["post-395","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dossier","category-engineering","tag-electronic-board","tag-kicad","tag-library","tag-simulation"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/chauquest.com\/index.php\/wp-json\/wp\/v2\/posts\/395","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chauquest.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chauquest.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chauquest.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chauquest.com\/index.php\/wp-json\/wp\/v2\/comments?post=395"}],"version-history":[{"count":13,"href":"https:\/\/chauquest.com\/index.php\/wp-json\/wp\/v2\/posts\/395\/revisions"}],"predecessor-version":[{"id":429,"href":"https:\/\/chauquest.com\/index.php\/wp-json\/wp\/v2\/posts\/395\/revisions\/429"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/chauquest.com\/index.php\/wp-json\/wp\/v2\/media\/424"}],"wp:attachment":[{"href":"https:\/\/chauquest.com\/index.php\/wp-json\/wp\/v2\/media?parent=395"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chauquest.com\/index.php\/wp-json\/wp\/v2\/categories?post=395"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chauquest.com\/index.php\/wp-json\/wp\/v2\/tags?post=395"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}