bioniso.blogg.se

Macspice file
Macspice file







  1. MACSPICE FILE DRIVER
  2. MACSPICE FILE SOFTWARE

Instead, both spice simulations seem to show a gradual ramp-up of current. One concern I had was that motor current would spike (stall current) when turning on. The motor is still generating small voltage spikes at turn on and shut off, but they are orders of magnitude smaller than before. Notice the voltage clamping effect of the schottky diode. MacSpice plots looked the same, in case you were wondering.

MACSPICE FILE SOFTWARE

The software makes it easy to graph the results run the transient analysis, then click on areas of the circuit with your virtual 'probe' to read voltage/current. Next, I performed transient analysis in LTspice. But that's best saved for a whole 'nother article. At some point it would be handy to be able to model any motor based on datasheet specs. So, time permitting I'll play around with different values of the components in the motor simulation. When I used the subcircuit file given by the DC Motor simulation website, apparently the back emf behaves a bit differently than what I drew up in LTspice because current is quite a bit lower, about 217mA. So we're seeing about 556mA through the motor. A nice feature!Īlso, it usually displays voltages by referencing the device name, rather than the associated node names, making it a bit easier to understand the results.įinally it displays the values as decimals rather than scientific notation so there's no mental calculations (e.g., let's see 0.1E-2 is, uhh. Note that LTspice displays all currents without having to insert 0v supplies - it does this behind the scenes. In LTspice, to do operating point analysis, I bypassed the S1 switch and hardwired the base resistor to ground. The only way to turn on the motor is if MCU sets the pin low to sink current. However, I've seen advice to use an external diode just in case the current or voltage is too high for the internal diode to handle.įinally, I added a pull up resistor, R1, to ensure that the transistor is off when the AVR MCU's output pin is in a high impedance state (during reboot, MCU off, etc.).

MACSPICE FILE DRIVER

Note that when using a MOSFET driver instead of a BJT, a diode is present within the transistor package.

macspice file

The cure for this is to place a schottky diode across the motor itself, D1 above. When I simulated the circuit at first, as expected, I was seeing massive voltage spikes across Q1 because of the motor's inductance. To simulate the 5V logic signal from the AVR microcontroller, I installed a voltage controlled switch, S1, which is repeatedly turned on and off by a 5V PULSE voltage supply. Meanwhile, using LTspice, I created the motor driver circuit, replacing R M with the motor custom component and then added a few extras. The complete MacSpice circuit file is here: ex5.cir INCLUDE Macintosh\ HD:Users:mes:Desktop:motor.cir In MacSpice you can include the subcircuit file, so after adding the appropriate file include card, we replace R M, connected to nodes 1 and 3, with a call to the motor subcircuit ( XMOTOR 1 3 MOTOR).









Macspice file