|
|||||
3.3.1. Basic Drive Motor Stepper Up-Parallel Port A basic example of stepper motor driver is shown in figure bellow. Notice the separate voltages for logic and for the stepper motor. Usually the motor will require a different voltage than the logic portion of the system. Typically logic voltage is +5 Vdc and the stepper motor voltage can range from +5 Vdc up to about +48 Vdc. The driver is also an "open collector" driver, wherein it takes its outputs to GND to activate the motor's windings. Delphi Programming ( Download file ex331.zip ) a. Puts 4 Timers Components, 2 Button and label on Form, as shown in picture bellow. Setting up all timer Timer component for Enabled = false, and Interval = 1000 ( approximataly = 1000 ms delay time ). b.Click on timer1 component to insert with the program as shown bellow procedure TMotor.Button1Click(Sender: TObject); procedure TMotor.Timer1Timer(Sender: TObject);
begin
timer1.enabled:=false; {turn off timer1 }
procedure TMotor.Timer2Timer(Sender: TObject);
begin
timer2.enabled:=false; { turn off timer2 }
procedure TMotor.Timer3Timer(Sender: TObject);
begin
timer3.enabled:=false; {turn off timer3 }
procedure TMotor.Timer4Timer(Sender: TObject);
begin
timer4.enabled:=false; {turn off timer4 }
asm
mov dx,$378
mov al,11111110b
out dx,al
end;
timer1.enabled:=true; {turn on timer1 again }
end;
procedure TMotor.Button2Click(Sender: TObject); begin timer1.enabled:=false; timer2.enabled:=false; timer3.enabled:=false; timer4.enabled:=false; end c. To run the program, you can hits F9 or RUN menu, and then you will show a picture as shown bellow, and try to simulate the program hit TURN RIGHT button. |
Free Software Lesson 1 Lesson
4
|
||||