Issue link: https://resources.pcb.cadence.com/i/1480186
APPLICATION NOTE 6 k2 Lwinding2 Lwinding3 {Cm} k3 Lwinding3 Lwinding1 {Cm} * Model the motor mechanical system. x4 shaft_speed shaft_angle motor_mech + params: J={J} B={B} F={F} D={D} A={A} P={P} twopi={twopi} .ends * * The motor winding * * This models the electrical properties of the windings, * and creates the torque "current" which is delivered to * the mechanical model. * Mutual inductance is modeled in the motor subcircuit, * so the inductance must be there also. The inductance * must be in series with this model. .subckt motor_winding winding1 winding2 shaft_speed shaft_angle + params: N=1 A=2 P=3 CL=3mh CR=6ohm CC=.001uf CM=.5 Cb=.12 Ct=300 + twopi={2*3.141596} * The electrical model: backemf, resistance, and capacitance Ebackemf winding1 3 VALUE = {Cb * V(shaft_speed) * V(factor)} Vsense 3 4 0v ; measure winding current Rwinding 4 winding2 {CR} * Place half the winding capacitance at each end of the winding C1 winding1 0 {CC/2} C2 winding2 0 {CC/2} * The mechanical model: torque created by this winding Gtorque 0 shaft_speed VALUE = {Ct * I(Vsense) * V(factor) } * The shaft angle function for this phase. Efactor factor 0 VALUE = + {sin(A*V(shaft_angle) - (N-1)*(twopi/P))} Cdummy factor 0 10uf ; force timestep control .ends Implementing a Commutation Strategy - Testing the Model To test the motor model you need to implement a commutation strategy. You will use a simple strategy which works like electronic brushes and drives only one stator phase at a time. To do this, take the sine of the shaft angle with respect to each stator phase (p1x, p2x, and p3x). The sine wave is used to control switches for each phase, so that voltage is applied only to the stator phase that has the highest torque-to- current ratio. There are many other commutation strategies which can be used. The phases can be connected in a Y or delta, with two or more of the terminals connected to a supply or ground during each commutation interval. * A test circuit for the motor .param twopi = {2*3.141596} .param P = 3 ; the number of phases .param A = 2 ;the number of north poles on the rotor * Connect one end of each phase winding to ct. x1 p1 ct p2 ct p3 ct shaft_speed shaft_angle bldcmtr + params: J=.30 B=.36 F=.72 D=2.9 A= {A} P= {P} CL=3mh CR=6ohm CC=.1pf + CM=.5 Cb=.12 Ct=300 twopi={twopi} rct ct 0 1 ;hook ct to ground through current measuring resistor * Make some brushes Ep1x p1x 0 VALUE = {V(on) * sin(A*V(shaft_angle) - (1-1)*(twopi/P))}