Presentation is loading. Please wait.

Presentation is loading. Please wait.

The PC GadgetMaster II Stepper Motor Control Developed by Frank Shapleigh Edited by Jim Tuff.

Similar presentations


Presentation on theme: "The PC GadgetMaster II Stepper Motor Control Developed by Frank Shapleigh Edited by Jim Tuff."— Presentation transcript:

1 The PC GadgetMaster II Stepper Motor Control Developed by Frank Shapleigh Edited by Jim Tuff

2 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 X 4 Stepper Control Variables Explained

3 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( ) Stepper Control Array Variables Explained 1128 264 332 416

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

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

6 Stepper Motor Control Clockwise Motion

7 Stepper Code: Private Sub Command1_Click() If S < 4 Then S = S + 1 Else S = 1 End If Out 888, A(S) End Sub 0 Stepper Control Clockwise Motion 0 1 2 3 4 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 Code: Private Sub Command1_Click() If S < 4 Then S = S + 1 Else S = 1 End If Out 888, A(S) End Sub Stepper Control 1 Clockwise Motion 0 1 2 3 4 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 Code: Private Sub Command1_Click() If S < 4 Then S = S + 1 Else S = 1 End If Out 888, A(S) End Sub Stepper Control 2 Clockwise Motion 0 1 2 3 4 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 Code: Private Sub Command1_Click() If S < 4 Then S = S + 1 Else S = 1 End If Out 888, A(S) End Sub 3 Stepper Control Clockwise Motion 0 1 2 3 4 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 Code: Private Sub Command1_Click() If S < 4 Then S = S + 1 Else S = 1 End If Out 888, A(S) End Sub 4 Stepper Control Clockwise Motion 0 1 2 3 4 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 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 5 4 3 2 1 PC GadgetMaster II Stepper Control Clockwise Motion Demo (CW)

13 12 volts 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 II Stepper Control Clockwise Motion Demo (CW)

14 5 4 3 2 1 12 volts 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 II Stepper Control Clockwise Motion Demo (CW)

15 5 4 3 2 1 12 volts 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 II Stepper Control Clockwise Motion Demo (CW)

16 12 volts 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 II Stepper Control Clockwise Motion Demo (CW)

17 5 4 3 2 1 12 volts 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 II Stepper Control Clockwise Motion Demo (CW)

18 Stepper Motor Control Counter Clockwise Motion

19 Stepper Code: Private Sub Command1_Click() If S > 1 Then S = S - 1 Else S = 4 End If Out 888, A(S) End Sub 4 Stepper Control Counter- Clockwise Motion 0 1 2 3 4 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 Code: Private Sub Command1_Click() If S > 1 Then S = S - 1 Else S = 4 End If Out 888, A(S) End Sub 3 Stepper Control Counter- Clockwise Motion 0 1 2 3 4 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 Code: Private Sub Command1_Click() If S > 1 Then S = S - 1 Else S = 4 End If Out 888, A(S) End Sub 2 Stepper Control Counter- Clockwise Motion 0 1 2 3 4 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 Code: Private Sub Command1_Click() If S > 1 Then S = S - 1 Else S = 4 End If Out 888, A(S) End Sub 1 Stepper Control Counter- Clockwise Motion 0 1 2 3 4 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 Code: Private Sub Command1_Click() If S > 1 Then S = S - 1 Else S = 4 End If Out 888, A(S) End Sub 0 Stepper Control Counter- Clockwise Motion 0 1 2 3 4 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 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 5 4 3 2 1 PC GadgetMaster II Stepper Control Counter Clockwise Motion Demo (CCW)

25 12 volts 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 II Stepper Control Counter Clockwise Motion Demo (CCW)

26 5 4 3 2 1 12 volts 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 II Stepper Control Counter Clockwise Motion Demo (CCW)

27 5 4 3 2 1 12 volts 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 II Stepper Control Counter Clockwise Motion Demo (CCW)

28 12 volts 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 II Stepper Control Counter Clockwise Motion Demo (CCW)

29 12 volts 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 II Stepper Control Counter Clockwise Motion Demo (CCW)

30 The PC GadgetMaster II Stepper Motor Control END


Download ppt "The PC GadgetMaster II Stepper Motor Control Developed by Frank Shapleigh Edited by Jim Tuff."

Similar presentations


Ads by Google