DECLARE SUB user (X$)
CLS
PRINT " DCMOTOR.BAS"
PRINT " Program to find motor characteristics from Vitkovits/Phillips; AME"
PRINT " Sept/Dec, 2006. QuickBasic program by Peter Dawes, 27-11-2006."
OPTION BASE 0
DIM S(22), Ia(22), Pel(22), Pml(22), Po(22), Pin(22), eff(22), T(22)
CONST F$ = "#######"
'------------------------------------------------------------------------
PRINT
PRINT " The user must supply the no load speed of the motor at what volts"
PRINT " and what current. He must also measure the armature resistance,"
PRINT " and the best method is the writer's constant current method."
PRINT " It requires a constant current power supply capable of supplying"
PRINT " 5 to 10 amps or so, plus a digital ammeter and voltmeter."
PRINT " An optical tachometer is essential with any of the methods."
PRINT " The results can be printed to a file called MOTOR.DAT because modern"
PRINT " printers will no longer print from DOS. This file is called into"
PRINT " Windows' NOTEPAD or WORDPAD and printed out from there."
' now enter figures ----------------------------------------------------
' Ra = .083: Vs = 12.15: Inl = 6.15: Nnl = 3822 '=ohms,volts,amps,speed.
INPUT " Enter armature resistance......."; Ra
INPUT " Enter supply Volts, no-load current & speed:"; Vs, Inl, Nnl
Ilr = Vs / Ra ' Ilr= calculated locked rotor current "
PRINT " Do you want to send output to screen (S)or MOTOR.DAT file?(m)"
CALL user(I$)
IF Q$ = "M" OR Q$ = "m" THEN
OPEN "Motor.Dat" FOR OUTPUT AS #1
ELSE
OPEN "con" FOR OUTPUT AS #1
END IF
Ilr = Vs / Ra
PRINT #1, " The calculated locked rotor current (Ilr)="; Ilr
Pnl = Vs * Inl: ' no load power =74.723
'-----------Set up array of speeds for the graphing (steps of 500)----------------
PRINT #1, "No load power="; Pnl ' = worst case elect power loss at max speed.
' draw a straight line graph from zero to the point 74.72 on R V-axis
' and Nnl speed on H-axis:Y=mx+b or X/a+Y/b=1
PRINT #1, " Array of Speeds: fixes major test plotting points for graphs."
FOR I = 0 TO 7 ' nine values are chosen
S(I) = 500 * (I)
S(8) = 3822: S(9) = 4000 ' first must be zero & last set manually
PRINT #1, USING F$; S(I); ' print them all to check them and
NEXT I ' provide headings for the tables.
S(0) = 1
PRINT #1, USING F$; S(8); S(9)
PRINT #1, " --------------------------------------------------------------"
PRINT #1, " ------------Calculate Ia values vs speed ----------------"
PRINT #1, "Ia array= straight line; descends from Ilr to Inl at Nnl"
'equation of line is x/a+y/b=1 or: Y=b(1-X/a)
FOR J = 0 TO 8 ' produce array of current vs speed from
Ia(J) = (Ilr) * (1 - S(J) / S(9)) ' no load to stalled (zero speed).
PRINT #1, USING F$; Ia(J); ' print it out.
NEXT J
PRINT #1,
PRINT #1, " -------------calculate Power input values vs speed--------"
PRINT #1, " Pin = straight line descending to right = Vs*Ia = 1853."
FOR V = 0 TO 8
Pin(V) = Vs * Ia(V)
PRINT #1, USING F$; Pin(V);
NEXT V
PRINT #1,
PRINT #1, "---------------calculate electrical power loss vs speed -------"
PRINT #1, "Pel array line descends to R. Pel= Ra*Ia(squared)."
FOR u = 0 TO 8
Pel(u) = Ra * (Ia(u)) ^ 2 'Pel= electrical power loss.
PRINT #1, USING F$; Pel(u);
NEXT u
PRINT #1,
PRINT #1, "---------------calculate mechanical power loss vs speed---------"
PRINT #1, " Pml is ascending straight line extrapolating to 75 approx @4000."
Pml = Pin - Pel
Pml = Pin - Ra * Inl * Inl
m = Pnl / Nnl 'PRINT #1, Pml: STOP
FOR Y = 0 TO 8 'Pml =Pin-Pel at no load = s(8) point.
Pml(Y) = S(Y) * m ' Y=mX+b is equation of a straight line!
PRINT #1, USING F$; Pml(Y); ' b is zero here, m is the slope.
NEXT Y
PRINT #1,
PRINT #1, "----------------calculate nett power output ----------------"
'Pin = Pel + Pml + Po, therefore Po=Pin-Pml-Pel
PRINT #1, " Po array =Pin-Pel-Pml is dome-shaped & relatively symmetrical"
FOR Z = 0 TO 8
Po(Z) = Pin(Z) - Pml(Z) - Pel(Z)
PRINT #1, USING F$; Po(Z);
NEXT Z
PRINT #1,
PRINT #1, "----------------calculate efficiency -----------------"
PRINT #1, " Efficiency is dome shaped, skewed heavily to R: = Po/Pin*100"
FOR W = 0 TO 8
IF Pin(W) = 0 THEN Pin(W) = 1 ' to avoid a divide-by-zero error.
eff(W) = Po(W) / Pin(W) * 100
PRINT #1, USING F$; eff(W);
NEXT W
PRINT #1,
PRINT #1, " Hit a key to continue------";
CALL user(YQ$)
IF Q$ <> "m" AND Q$ <> "M" THEN
PRINT #1,
LOCATE 25, 5
END IF
LOCATE
PRINT #1, " "
PRINT #1, "----Calculate torque, line descends to R to zero------------"
FOR b = 0 TO 8 'T= 10^4*Po/(7.395*speed),from S.V's Equ.11.
T(b) = 1352.27 * Po(b) / S(b)
PRINT #1, USING F$; T(b);
NEXT b
PRINT #1,
PRINT #1, "---------------------------------------------------------------"
PRINT #1,
PRINT #1, " Graphing is not done here. Do that manually."
PRINT #1, " End of DCMOTOR.BAS program."
CLOSE
'------------------------------------------------------------
SUB user (Q$)
Q$ = "": DO WHILE Q$ = "": Q$ = INKEY$: LOOP
END SUB