1 / 30

The PC GadgetMaster II

The PC GadgetMaster II. Stepper Motor Control. Developed by Frank Shapleigh. Edited by Jim Tuff. X. 4. Stepper Control Variables Explained. Simple Variable “Contains” numbers, characters or strings of characters. Contents of a variable change each time an assignment is made. Eg. X = 1

Télécharger la présentation

The PC GadgetMaster II

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The PC GadgetMaster II Stepper Motor Control Developed byFrank Shapleigh Edited byJim Tuff

  2. X 4 Stepper ControlVariables Explained Simple Variable “Contains” numbers, characters or strings of characters. Contents of a variable change each time an assignment is made. Eg. X = 1 X = 2 X = 3 X = 4

  3. Stepper ControlArray Variables Explained Array Variable Array “Elements” can also store numbers, characters or strings of characters. Elements and their contents are referenced by an “index”. Eg. A(1) = 128 A(2) = 64 A(3) = 32 A(4) = 16 One Dimensional array A( )

  4. Text1 Displays the value ofA(1) S = (1) = 128 Digital Output 1 (128) is 12 volts Stepper ControlArray Variables / Digital Output Example: Private Sub Command1_Click() A(1) = 128 A(2) = 64 A(3) = 32 A(4) = 16 S = 1 Text1 = A(S) End Sub

  5. Text1 Displays the value ofA(3) S = (3) = 32 Digital Output 3 (32) is 12 volts Stepper ControlArray Variables / Digital Output Example: Private Sub Command1_Click() A(1) = 128 A(2) = 64 A(3) = 32 A(4) = 16 S = 3 Text1 = A(S) End Sub

  6. Stepper Motor Control Clockwise Motion

  7. Stepper ControlClockwise Motion 01 2 3 4 Stepper Code: Private Sub Command1_Click() If S < 4 Then S = S + 1 Else S = 1 End If Out 888, A(S) End Sub The Stepper Control Cycle begins with the Array Variable value of ‘S=0’ S = 0 + 1 = 1 A(S) = A(1) = 128 12 volts is sent to Digital Output 1

  8. Stepper Control Clockwise Motion 01 2 3 4 Stepper Code: Private Sub Command1_Click() If S < 4 Then S = S + 1 Else S = 1 End If Out 888, A(S) End Sub The Stepper Control Cycle now has an Array Variable value of ‘S=1’ S = 1 + 1 = 2 A(S) = A(2) = 64 12 volts is sent to Digital Output 2

  9. Stepper Control Clockwise Motion 0 1 23 4 Stepper Code: Private Sub Command1_Click() If S < 4 Then S = S + 1 Else S = 1 End If Out 888, A(S) End Sub The Stepper Control Cycle now has an Array Variable value of ‘S=2’ S = 2 + 1 = 3 A(S) = A(3) = 32 12 volts is sent to Digital Output 3

  10. Stepper ControlClockwise Motion 0 1 234 Stepper Code: Private Sub Command1_Click() If S < 4 Then S = S + 1 Else S = 1 End If Out 888, A(S) End Sub The Stepper Control Cycle now has an Array Variable value of ‘S=3’ S = 3 + 1 = 4 A(S) = A(4) = 16 12 volts is sent to Digital Output 4

  11. Stepper ControlClockwise Motion 0 1 2 34 Stepper Code: Private Sub Command1_Click() If S < 4 Then S = S + 1 Else S = 1 End If Out 888, A(S) End Sub The Stepper Control Cycle now has an Array Variable value of ‘S=4’ S is not less than 4!! S = 1 A(S) = A(1) = 128 12 volts is sent to Digital Output 1 (cycle repeats)

  12. 5 4 3 2 1 Private Sub Command1_Click() Forward End Sub Public Sub Forward() If S < 4 Then S = S + 1 Else S = 1 End If Out 888, A(S) End Sub PC GadgetMaster IIStepper Control Clockwise Motion Demo (CW)

  13. 5 4 3 2 1 Private Sub Command1_Click() Forward End Sub Public Sub Forward() If S < 4 Then ‘S is 0 S = S + 1 Else S = 1 ‘S is 1 End If Out 888, A(S)‘A(1) is 128 End Sub PC GadgetMaster IIStepper Control Clockwise Motion Demo (CW) 12 volts

  14. 5 4 3 2 1 Private Sub Command1_Click() Forward End Sub Public Sub Forward() If S < 4 Then‘S is 1 S = S + 1‘S is 2 Else S = 1 End If Out 888, A(S)‘A(2) is 64 End Sub PC GadgetMaster IIStepper Control Clockwise Motion Demo (CW) 12 volts

  15. 5 4 3 2 1 Private Sub Command1_Click() Forward End Sub Public Sub Forward() If S < 4 Then‘S is 2 S = S + 1‘S is 3 Else S = 1 End If Out 888, A(S)‘A(3) is 32 End Sub PC GadgetMaster IIStepper Control Clockwise Motion Demo (CW) 12 volts

  16. 5 4 3 2 1 Private Sub Command1_Click() Forward End Sub Public Sub Forward() If S < 4 Then‘S is 3 S = S + 1‘S is 4 Else S = 1 End If Out 888, A(S)‘A(4) is 16 End Sub PC GadgetMaster IIStepper Control Clockwise Motion Demo (CW) 12 volts

  17. 5 4 3 2 1 Private Sub Command1_Click() Forward End Sub Public Sub Forward() If S < 4 Then‘S is 4 S = S + 1 Else S = 1 ‘S is 1 End If Out 888, A(S)‘A(1) is 128 End Sub PC GadgetMaster IIStepper Control Clockwise Motion Demo (CW) 12 volts

  18. Stepper Motor Control Counter Clockwise Motion

  19. Stepper ControlCounter-Clockwise Motion0 1 2 34 Stepper Code: Private Sub Command1_Click() If S > 1 Then S = S - 1 Else S = 4 End If Out 888, A(S) End Sub The Stepper Control Cycle begins with the Array Variable value of ‘S=0’ S is not greater than 1!! S = 4 A(S) = A(4) = 16 12 volts is sent to Digital Output 4

  20. Stepper ControlCounter-Clockwise Motion0 1 2 3 4 Stepper Code: Private Sub Command1_Click() If S > 1 Then S = S - 1 Else S = 4 End If Out 888, A(S) End Sub The Stepper Control Cycle now has an Array Variable value of ‘S=4’ S = 4 – 1 = 3 A(S) = A(3) = 32 12 volts is sent to Digital Output 3

  21. Stepper ControlCounter-Clockwise Motion0 1 2 34 Stepper Code: Private Sub Command1_Click() If S > 1 Then S = S - 1 Else S = 4 End If Out 888, A(S) End Sub The Stepper Control Cycle now has an Array Variable value of ‘S=3’ S = 3 – 1 = 2 A(S) = A(2) = 64 12 volts is sent to Digital Output 2

  22. Stepper ControlCounter-Clockwise Motion0 1 2 34 Stepper Code: Private Sub Command1_Click() If S > 1 Then S = S - 1 Else S = 4 End If Out 888, A(S) End Sub The Stepper Control Cycle now has an Array Variable value of ‘S=2’ S = 2 – 1 = 1 A(S) = A(1) = 128 12 volts is sent to Digital Output 1

  23. Stepper ControlCounter-Clockwise Motion0 1 2 34 Stepper Code: Private Sub Command1_Click() If S > 1 Then S = S - 1 Else S = 4 End If Out 888, A(S) End Sub The Stepper Control Cycle now has an Array Variable value of ‘S=1’ S is not greater than 1!! S = 4 A(S) = A(4) = 16 12 volts is sent to Digital Output 4 (cycle repeats)

  24. 5 4 3 2 1 Private Sub Command1_Click() Forward End Sub Public Sub Forward() If S > 1 Then S = S - 1 Else S = 4 End If Out 888, A(S) End Sub PC GadgetMaster IIStepper Control Counter Clockwise Motion Demo (CCW)

  25. 5 4 3 2 1 Private Sub Command1_Click() Forward End Sub Public Sub Forward() If S > 1 ‘S is 0 S = S - 1 Else S = 4 ‘S is 4 End If Out 888, A(S)‘A(4) is 16 End Sub PC GadgetMaster IIStepper Control Counter Clockwise Motion Demo (CCW) 12 volts

  26. 5 4 3 2 1 Private Sub Command1_Click() Forward End Sub Public Sub Forward() If S > 1 Then‘S is 4 S = S - 1‘S is 3 Else S = 4 End If Out 888, A(S)‘A(3) is 32 End Sub PC GadgetMaster IIStepper Control Counter Clockwise Motion Demo (CCW) 12 volts

  27. 5 4 3 2 1 Private Sub Command1_Click() Forward End Sub Public Sub Forward() If S > 1 Then‘S is 3 S = S - 1‘S is 2 Else S = 4 End If Out 888, A(S)‘A(2) is 64 End Sub PC GadgetMaster IIStepper Control Counter Clockwise Motion Demo (CCW) 12 volts

  28. 5 4 3 2 1 Private Sub Command1_Click() Forward End Sub Public Sub Forward() If S > 1 Then ‘S is 2 S = S - 1 ‘S is 1 Else S = 4 End If Out 888, A(S)‘A(1) is 128 End Sub PC GadgetMaster IIStepper Control Counter Clockwise Motion Demo (CCW) 12 volts

  29. 5 4 3 2 1 Private Sub Command1_Click() Forward End Sub Public Sub Forward() If S > 1 ‘S is 1 S = S - 1 Else S = 4 ‘S is 4 End If Out 888, A(S)‘A(4) is 16 End Sub PC GadgetMaster IIStepper Control Counter Clockwise Motion Demo (CCW) 12 volts

  30. The PC GadgetMaster II Stepper Motor Control END

More Related