0
\$\begingroup\$

I'm using KiCad 5.1.7 and have created a simple circuit just to see what happens.

It contains a fan, an unpolarized capacitor (110 μF) and a VSource. [Just wondering what happens...]

When I try to simulate it using the simulator, I'm getting the following error:

Error on line 4 :
m1 net-_m1-pad1_ net-_c1-pad1_ fan
could not find a valid modelname
Error: circuit not parsed.

Looking through [1], it seems that I need to find the right model; but [1] applies only to the op-amp IC and not some generic fan. What is the right model for a fan?

[1] - http://ngspice.sourceforge.net/ngspice-eeschema.html#BipAmp

\$\endgroup\$
2
  • \$\begingroup\$ Here is a nice article to get you started: precisionmicrodrives.com/content/… Reference 1 for that article is also good. Might be a simpler starting point if you haven't done this before. \$\endgroup\$
    – Ste Kulov
    Commented Oct 5, 2020 at 2:44
  • \$\begingroup\$ Thanks @SteKulov ! I went to that site and managed to get a dc subckt added to the spice model. When I tried to simulate the circuit, I get an error which I think is related to my ignorance of how it's simulating things. Anyway, I'll post the DC subckt text as answer. \$\endgroup\$
    – ewokx
    Commented Oct 6, 2020 at 0:51

1 Answer 1

2
\$\begingroup\$

Thanks to @SteKulov's help, I managed to get a hold of a subckt model for a dc motor though I suspect it needs some tweaking for different motor types.

.SUBCKT FAN 1 2
*
* MOTOR VOLTAGE
RA  1   2   0.5
LA  2   3   0.0015
H_EMF   3 4 VSENSE2 0.05
VSENSE1 4   0   DC 0V
*
* MOTOR TORQUE BASED ON INERTIA AND FRICTION
H_TORQ  6 0 VSENSE1 0.05
LJ  6   7   0.00025
RB  7   8   0.0001
VSENSE2 8   0   DC  0V
*
* MOTOR POSITION
FPOS    0   11  VSENSE2 1
CPOS    11  0   1
RPOS    11  0   1MEG
*
.ENDS FAN

\$\endgroup\$
7
  • \$\begingroup\$ To note: While it doesn't complain about the model, and the simulation runs, I can't add any signals to the spice simulator as I get an "Error: vector v-sweep not found!" \$\endgroup\$
    – ewokx
    Commented Oct 6, 2020 at 2:17
  • \$\begingroup\$ This is going to be impossible to troubleshoot without more data. Can you at least copy/paste the SPICE netlist? After attempting to run the simulation, within the Simulator go to Menu->Simulation->Show SPICE Netlist.. Also, it might be better to get more detailed help here: forum.kicad.info/c/schematic/simulation-ngspice/20 \$\endgroup\$
    – Ste Kulov
    Commented Oct 6, 2020 at 3:59
  • \$\begingroup\$ @SteKulov can I delete this answer and make changes to the original question to include the netlist? \$\endgroup\$
    – ewokx
    Commented Oct 6, 2020 at 4:06
  • \$\begingroup\$ @ewong Don't include V1 in the subcircuit and probe the net that connects the external V1 with the subcircuit, and the negative of the current through V1. What you did is add a subcircuit to the schematic and nothing else, while trying to probe nets and currents internal to the subcircuit and, thus, unknown to the outside world. What happens inside a subcircuit stays inside the subcircuit (everything is local). So all you have to do is move the .subckt line below V1, then add an X1 line for the subcircuit, connected to V1, label the nets, and then .probe & co. \$\endgroup\$ Commented Oct 6, 2020 at 7:32
  • \$\begingroup\$ @ewong, Ehhh...sorry, brother. I don't know enough about this platform to answer that. KiCad/ngspice interface is still new, strange, and buggy. It might be better to just accept your own answer (since it answers the initial question and will help other people), and then move your KiCad specific problems over to the forums I linked earlier. \$\endgroup\$
    – Ste Kulov
    Commented Oct 6, 2020 at 17:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.