Unipolar Stepper Motor Library
UniStepperMotor.cpp@2:abb7425e1a5b, 2012-07-17 (annotated)
- Committer:
- bant62
- Date:
- Tue Jul 17 09:10:48 2012 +0000
- Revision:
- 2:abb7425e1a5b
- Parent:
- 1:ce3991daa407
add 256 step.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bant62 | 1:ce3991daa407 | 1 | /** |
bant62 | 1:ce3991daa407 | 2 | ***************************************************************************** |
bant62 | 1:ce3991daa407 | 3 | * File Name : UniStepperMotor.cpp |
bant62 | 1:ce3991daa407 | 4 | * |
bant62 | 1:ce3991daa407 | 5 | * Title : Unipolar Stepper Motor Class Source File |
bant62 | 1:ce3991daa407 | 6 | * Revision : 0.1 |
bant62 | 1:ce3991daa407 | 7 | * Notes : |
bant62 | 1:ce3991daa407 | 8 | * Target Board : mbed NXP LPC1768 |
bant62 | 1:ce3991daa407 | 9 | * Tool Chain : ???? |
bant62 | 1:ce3991daa407 | 10 | * |
bant62 | 1:ce3991daa407 | 11 | * Revision History: |
bant62 | 1:ce3991daa407 | 12 | * When Who Description of change |
bant62 | 1:ce3991daa407 | 13 | * ----------- ----------- ----------------------- |
bant62 | 1:ce3991daa407 | 14 | * 2012/07/8 Hiroshi M init |
bant62 | 1:ce3991daa407 | 15 | ***************************************************************************** |
bant62 | 1:ce3991daa407 | 16 | * |
bant62 | 1:ce3991daa407 | 17 | * Copyright (C) 2012 Hiroshi M, MIT License |
bant62 | 1:ce3991daa407 | 18 | * |
bant62 | 1:ce3991daa407 | 19 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software |
bant62 | 1:ce3991daa407 | 20 | * and associated documentation files (the "Software"), to deal in the Software without restriction, |
bant62 | 1:ce3991daa407 | 21 | * including without limitation the rights to use, copy, modify, merge, publish, distribute, |
bant62 | 1:ce3991daa407 | 22 | * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is |
bant62 | 1:ce3991daa407 | 23 | * furnished to do so, subject to the following conditions: |
bant62 | 1:ce3991daa407 | 24 | * |
bant62 | 1:ce3991daa407 | 25 | * The above copyright notice and this permission notice shall be included in all copies or |
bant62 | 1:ce3991daa407 | 26 | * substantial portions of the Software. |
bant62 | 1:ce3991daa407 | 27 | * |
bant62 | 1:ce3991daa407 | 28 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING |
bant62 | 1:ce3991daa407 | 29 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
bant62 | 1:ce3991daa407 | 30 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
bant62 | 1:ce3991daa407 | 31 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
bant62 | 1:ce3991daa407 | 32 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
bant62 | 1:ce3991daa407 | 33 | * |
bant62 | 1:ce3991daa407 | 34 | **/ |
bant62 | 1:ce3991daa407 | 35 | |
bant62 | 1:ce3991daa407 | 36 | /* Includes ----------------------------------------------------------------- */ |
bant62 | 1:ce3991daa407 | 37 | #include "UniStepperMotor.h" |
bant62 | 1:ce3991daa407 | 38 | #include "mbed.h" |
bant62 | 1:ce3991daa407 | 39 | |
bant62 | 1:ce3991daa407 | 40 | /* Private typedef ---------------------------------------------------------- */ |
bant62 | 1:ce3991daa407 | 41 | /* Private define ----------------------------------------------------------- */ |
bant62 | 1:ce3991daa407 | 42 | /* Private macro ------------------------------------------------------------ */ |
bant62 | 1:ce3991daa407 | 43 | /* Private variables -------------------------------------------------------- */ |
bant62 | 1:ce3991daa407 | 44 | |
bant62 | 1:ce3991daa407 | 45 | static uint8_t ptn_ClockWise_1x1[] = {0x01, 0x02, 0x04, 0x08}; |
bant62 | 1:ce3991daa407 | 46 | static uint8_t ptn_AntiClockWise_1x1[] = {0x08, 0x04, 0x02, 0x01}; |
bant62 | 1:ce3991daa407 | 47 | |
bant62 | 1:ce3991daa407 | 48 | static uint8_t ptn_ClockWise_2x2[] = {0x03, 0x06, 0x0C, 0x09}; |
bant62 | 1:ce3991daa407 | 49 | static uint8_t ptn_AntiClockWise_2x2[] = {0x09, 0x0C, 0x06, 0x03}; |
bant62 | 1:ce3991daa407 | 50 | |
bant62 | 1:ce3991daa407 | 51 | static uint8_t ptn_ClockWise_1x2[] = {0x03, 0x02, 0x06, 0x04, 0x0C, 0x08, 0x09, 0x01}; |
bant62 | 1:ce3991daa407 | 52 | static uint8_t ptn_AntiClockWise_1x2[] = {0x01, 0x09, 0x08, 0x0C, 0x04, 0x06, 0x02, 0x03}; |
bant62 | 1:ce3991daa407 | 53 | |
bant62 | 2:abb7425e1a5b | 54 | #if MAXSPEED == 10 |
bant62 | 2:abb7425e1a5b | 55 | static speed_data_t speed_data [] = |
bant62 | 2:abb7425e1a5b | 56 | { |
bant62 | 1:ce3991daa407 | 57 | { 1, 0,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, // 0 |
bant62 | 1:ce3991daa407 | 58 | {500, 4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, // 1 500*2 => 1000 |
bant62 | 1:ce3991daa407 | 59 | {250, 4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, // 2 250*2 => 500 |
bant62 | 1:ce3991daa407 | 60 | {166, 4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, // 3 166*2 => 332 |
bant62 | 1:ce3991daa407 | 61 | {125, 6,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, // 4 125*2 => 250 |
bant62 | 1:ce3991daa407 | 62 | {100, 6,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, // 5 100*2 => 200 |
bant62 | 2:abb7425e1a5b | 63 | {167, 8,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, // 6 |
bant62 | 1:ce3991daa407 | 64 | {143, 8,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, // 7 |
bant62 | 1:ce3991daa407 | 65 | {125, 9,ptn_ClockWise_1x1,ptn_AntiClockWise_2x2,4}, // 8 |
bant62 | 1:ce3991daa407 | 66 | {111, 10,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, // 9 |
bant62 | 1:ce3991daa407 | 67 | {100, 10,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4} // 10 |
bant62 | 1:ce3991daa407 | 68 | }; |
bant62 | 1:ce3991daa407 | 69 | |
bant62 | 2:abb7425e1a5b | 70 | #elif MAXSPEED == 63 |
bant62 | 2:abb7425e1a5b | 71 | static speed_data_t speed_data [] = |
bant62 | 2:abb7425e1a5b | 72 | { |
bant62 | 1:ce3991daa407 | 73 | {1,0,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 1:ce3991daa407 | 74 | {3150,2,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 1:ce3991daa407 | 75 | {1575,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 1:ce3991daa407 | 76 | {1050,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 1:ce3991daa407 | 77 | {788,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 1:ce3991daa407 | 78 | {630,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 1:ce3991daa407 | 79 | {525,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 1:ce3991daa407 | 80 | {450,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 1:ce3991daa407 | 81 | {394,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 1:ce3991daa407 | 82 | {350,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 1:ce3991daa407 | 83 | {315,5,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 1:ce3991daa407 | 84 | {286,5,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 1:ce3991daa407 | 85 | {263,5,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 1:ce3991daa407 | 86 | {242,5,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 1:ce3991daa407 | 87 | {225,5,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 1:ce3991daa407 | 88 | {210,5,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 1:ce3991daa407 | 89 | {197,5,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 1:ce3991daa407 | 90 | {185,6,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 1:ce3991daa407 | 91 | {175,6,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 1:ce3991daa407 | 92 | {166,6,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 1:ce3991daa407 | 93 | {158,6,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 1:ce3991daa407 | 94 | {150,6,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 1:ce3991daa407 | 95 | {143,6,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 1:ce3991daa407 | 96 | {137,6,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 1:ce3991daa407 | 97 | {131,6,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 1:ce3991daa407 | 98 | {126,6,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 1:ce3991daa407 | 99 | {121,6,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 1:ce3991daa407 | 100 | {233,7,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 1:ce3991daa407 | 101 | {225,7,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 1:ce3991daa407 | 102 | {217,7,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 1:ce3991daa407 | 103 | {210,7,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 1:ce3991daa407 | 104 | {203,7,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 1:ce3991daa407 | 105 | {197,7,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 1:ce3991daa407 | 106 | {191,7,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 1:ce3991daa407 | 107 | {185,7,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 1:ce3991daa407 | 108 | {180,7,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 1:ce3991daa407 | 109 | {175,7,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 1:ce3991daa407 | 110 | {170,8,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 1:ce3991daa407 | 111 | {166,8,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 1:ce3991daa407 | 112 | {162,8,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 1:ce3991daa407 | 113 | {158,8,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 1:ce3991daa407 | 114 | {154,8,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 1:ce3991daa407 | 115 | {150,8,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 1:ce3991daa407 | 116 | {147,8,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 1:ce3991daa407 | 117 | {143,8,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 1:ce3991daa407 | 118 | {140,8,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 1:ce3991daa407 | 119 | {137,8,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 1:ce3991daa407 | 120 | {134,9,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 1:ce3991daa407 | 121 | {131,9,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 1:ce3991daa407 | 122 | {129,9,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 1:ce3991daa407 | 123 | {126,9,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 1:ce3991daa407 | 124 | {124,9,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 1:ce3991daa407 | 125 | {121,9,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 1:ce3991daa407 | 126 | {119,9,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 1:ce3991daa407 | 127 | {117,9,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 1:ce3991daa407 | 128 | {115,10,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 1:ce3991daa407 | 129 | {113,10,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 1:ce3991daa407 | 130 | {111,10,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 1:ce3991daa407 | 131 | {109,10,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 1:ce3991daa407 | 132 | {107,10,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 1:ce3991daa407 | 133 | {105,10,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 1:ce3991daa407 | 134 | {103,10,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 1:ce3991daa407 | 135 | {102,10,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 1:ce3991daa407 | 136 | {100,10,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4} |
bant62 | 1:ce3991daa407 | 137 | }; |
bant62 | 1:ce3991daa407 | 138 | |
bant62 | 2:abb7425e1a5b | 139 | #else |
bant62 | 2:abb7425e1a5b | 140 | static speed_data_t speed_data [] = |
bant62 | 2:abb7425e1a5b | 141 | { |
bant62 | 2:abb7425e1a5b | 142 | {1,0,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 143 | {6400,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 144 | {4267,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 145 | {3200,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 146 | {2560,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 147 | {2134,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 148 | {1829,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 149 | {1600,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 150 | {1422,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 151 | {1280,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 152 | {1164,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 153 | {1067,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 154 | {985,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 155 | {915,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 156 | {854,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 157 | {800,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 158 | {753,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 159 | {711,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 160 | {674,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 161 | {640,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 162 | {610,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 163 | {582,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 164 | {557,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 165 | {534,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 166 | {512,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 167 | {493,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 168 | {474,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 169 | {457,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 170 | {442,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 171 | {427,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 172 | {413,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 173 | {400,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 174 | {388,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 175 | {377,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 176 | {366,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 177 | {356,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 178 | {346,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 179 | {337,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 180 | {328,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 181 | {320,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 182 | {312,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 183 | {305,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 184 | {298,3,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 185 | {291,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 186 | {285,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 187 | {279,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 188 | {273,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 189 | {267,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 190 | {261,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 191 | {256,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 192 | {251,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 193 | {246,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 194 | {242,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 195 | {237,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 196 | {233,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 197 | {229,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 198 | {225,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 199 | {221,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 200 | {217,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 201 | {214,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 202 | {210,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 203 | {207,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 204 | {203,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 205 | {200,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 206 | {197,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 207 | {194,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 208 | {191,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 209 | {188,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 210 | {186,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 211 | {183,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 212 | {181,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 213 | {178,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 214 | {176,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 215 | {173,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 216 | {171,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 217 | {169,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 218 | {166,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 219 | {164,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 220 | {162,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 221 | {160,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 222 | {158,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 223 | {156,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 224 | {154,4,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 225 | {153,5,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 226 | {151,5,ptn_ClockWise_1x2,ptn_AntiClockWise_1x2,8}, |
bant62 | 2:abb7425e1a5b | 227 | {298,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 228 | {294,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 229 | {291,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 230 | {288,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 231 | {284,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 232 | {281,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 233 | {278,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 234 | {275,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 235 | {272,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 236 | {269,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 237 | {267,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 238 | {264,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 239 | {261,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 240 | {259,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 241 | {256,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 242 | {253,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 243 | {251,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 244 | {249,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 245 | {246,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 246 | {244,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 247 | {242,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 248 | {239,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 249 | {237,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 250 | {235,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 251 | {233,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 252 | {231,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 253 | {229,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 254 | {227,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 255 | {225,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 256 | {223,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 257 | {221,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 258 | {219,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 259 | {217,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 260 | {215,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 261 | {213,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 262 | {212,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 263 | {210,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 264 | {208,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 265 | {206,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 266 | {205,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 267 | {203,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 268 | {202,5,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 269 | {200,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 270 | {198,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 271 | {197,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 272 | {195,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 273 | {194,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 274 | {192,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 275 | {191,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 276 | {190,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 277 | {188,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 278 | {187,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 279 | {186,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 280 | {184,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 281 | {183,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 282 | {182,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 283 | {180,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 284 | {179,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 285 | {178,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 286 | {177,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 287 | {175,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 288 | {174,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 289 | {173,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 290 | {172,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 291 | {171,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 292 | {170,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 293 | {168,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 294 | {167,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 295 | {166,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 296 | {165,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 297 | {164,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 298 | {163,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 299 | {162,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 300 | {161,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 301 | {160,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 302 | {159,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 303 | {158,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 304 | {157,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 305 | {156,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 306 | {155,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 307 | {154,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 308 | {153,6,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 309 | {152,7,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 310 | {151,7,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 311 | {151,7,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 312 | {150,7,ptn_ClockWise_1x1,ptn_AntiClockWise_1x1,4}, |
bant62 | 2:abb7425e1a5b | 313 | {149,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 314 | {148,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 315 | {147,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 316 | {146,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 317 | {145,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 318 | {145,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 319 | {144,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 320 | {143,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 321 | {142,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 322 | {141,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 323 | {141,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 324 | {140,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 325 | {139,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 326 | {138,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 327 | {138,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 328 | {137,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 329 | {136,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 330 | {135,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 331 | {135,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 332 | {134,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 333 | {133,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 334 | {133,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 335 | {132,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 336 | {131,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 337 | {131,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 338 | {130,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 339 | {129,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 340 | {129,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 341 | {128,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 342 | {127,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 343 | {127,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 344 | {126,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 345 | {125,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 346 | {125,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 347 | {124,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 348 | {124,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 349 | {123,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 350 | {122,7,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 351 | {122,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 352 | {121,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 353 | {121,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 354 | {120,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 355 | {120,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 356 | {119,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 357 | {119,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 358 | {118,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 359 | {117,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 360 | {117,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 361 | {116,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 362 | {116,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 363 | {115,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 364 | {115,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 365 | {114,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 366 | {114,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 367 | {113,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 368 | {113,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 369 | {112,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 370 | {112,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 371 | {111,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 372 | {111,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 373 | {110,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 374 | {110,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 375 | {109,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 376 | {109,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 377 | {108,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 378 | {108,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 379 | {108,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 380 | {107,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 381 | {107,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 382 | {106,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 383 | {106,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 384 | {105,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 385 | {105,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 386 | {104,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 387 | {104,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 388 | {104,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 389 | {103,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 390 | {103,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 391 | {102,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 392 | {102,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 393 | {102,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 394 | {101,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 395 | {101,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 396 | {100,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4}, |
bant62 | 2:abb7425e1a5b | 397 | {100,8,ptn_ClockWise_2x2,ptn_AntiClockWise_2x2,4} |
bant62 | 2:abb7425e1a5b | 398 | }; |
bant62 | 2:abb7425e1a5b | 399 | #endif |
bant62 | 1:ce3991daa407 | 400 | |
bant62 | 1:ce3991daa407 | 401 | /* member fanctions --------------------------------------------------------- */ |
bant62 | 1:ce3991daa407 | 402 | |
bant62 | 1:ce3991daa407 | 403 | // Constractor |
bant62 | 1:ce3991daa407 | 404 | StepperMotor::StepperMotor(PinName x_pin_no, PinName y_pin_no, PinName nx_pin_no, PinName ny_pin_no, motor_dir set_direction) |
bant62 | 2:abb7425e1a5b | 405 | : _x(x_pin_no), _y(y_pin_no), _nx(nx_pin_no), _ny(ny_pin_no) |
bant62 | 2:abb7425e1a5b | 406 | { |
bant62 | 1:ce3991daa407 | 407 | direction = forward_direction; |
bant62 | 1:ce3991daa407 | 408 | forward_direction = set_direction; |
bant62 | 1:ce3991daa407 | 409 | backward_direction = (forward_direction == CLOCK_WISE) ? ANTI_CLOCK_WISE : CLOCK_WISE; |
bant62 | 1:ce3991daa407 | 410 | } |
bant62 | 1:ce3991daa407 | 411 | |
bant62 | 1:ce3991daa407 | 412 | // Destrutctor |
bant62 | 2:abb7425e1a5b | 413 | StepperMotor::~StepperMotor() |
bant62 | 2:abb7425e1a5b | 414 | { |
bant62 | 1:ce3991daa407 | 415 | } |
bant62 | 1:ce3991daa407 | 416 | |
bant62 | 1:ce3991daa407 | 417 | // |
bant62 | 2:abb7425e1a5b | 418 | void StepperMotor::PulseEnable(void) |
bant62 | 2:abb7425e1a5b | 419 | { |
bant62 | 1:ce3991daa407 | 420 | Pulse.attach_us(this,&StepperMotor::SetPulse14us,PULSE_INTERVAL); |
bant62 | 1:ce3991daa407 | 421 | } |
bant62 | 1:ce3991daa407 | 422 | |
bant62 | 1:ce3991daa407 | 423 | // |
bant62 | 2:abb7425e1a5b | 424 | void StepperMotor::PulseDisable(void) |
bant62 | 2:abb7425e1a5b | 425 | { |
bant62 | 1:ce3991daa407 | 426 | Pulse.detach(); |
bant62 | 1:ce3991daa407 | 427 | } |
bant62 | 1:ce3991daa407 | 428 | |
bant62 | 2:abb7425e1a5b | 429 | void StepperMotor::SetSpeed(int speed) |
bant62 | 2:abb7425e1a5b | 430 | { |
bant62 | 1:ce3991daa407 | 431 | direction = (speed >= 0) ? forward_direction : backward_direction; |
bant62 | 1:ce3991daa407 | 432 | |
bant62 | 1:ce3991daa407 | 433 | speed = abs(speed); |
bant62 | 2:abb7425e1a5b | 434 | if (speed > MAXSPEED) speed = MAXSPEED; |
bant62 | 1:ce3991daa407 | 435 | |
bant62 | 1:ce3991daa407 | 436 | pwm_ratio = speed_data[speed].pwm_ratio; |
bant62 | 1:ce3991daa407 | 437 | max_pulse_count = speed_data[speed].max_pulse_count; |
bant62 | 1:ce3991daa407 | 438 | |
bant62 | 2:abb7425e1a5b | 439 | if (direction == CLOCK_WISE) |
bant62 | 2:abb7425e1a5b | 440 | { |
bant62 | 1:ce3991daa407 | 441 | ptn = speed_data[speed].clockwise_ptn; |
bant62 | 2:abb7425e1a5b | 442 | } |
bant62 | 2:abb7425e1a5b | 443 | else |
bant62 | 2:abb7425e1a5b | 444 | { |
bant62 | 1:ce3991daa407 | 445 | ptn = speed_data[speed].anticlockwise_ptn; |
bant62 | 1:ce3991daa407 | 446 | } |
bant62 | 1:ce3991daa407 | 447 | ptn_count = speed_data[speed].ptn_count; |
bant62 | 2:abb7425e1a5b | 448 | |
bant62 | 1:ce3991daa407 | 449 | pulse_count = 0; |
bant62 | 1:ce3991daa407 | 450 | ptn_index = 0; |
bant62 | 1:ce3991daa407 | 451 | |
bant62 | 1:ce3991daa407 | 452 | pwm_on_count = pwm_ratio; |
bant62 | 1:ce3991daa407 | 453 | pwm_off_count = 10 - pwm_ratio; |
bant62 | 1:ce3991daa407 | 454 | |
bant62 | 1:ce3991daa407 | 455 | state = PWM_ON; |
bant62 | 1:ce3991daa407 | 456 | } |
bant62 | 1:ce3991daa407 | 457 | |
bant62 | 1:ce3991daa407 | 458 | |
bant62 | 1:ce3991daa407 | 459 | /* private functions */ |
bant62 | 1:ce3991daa407 | 460 | |
bant62 | 2:abb7425e1a5b | 461 | void StepperMotor::SetPulse14us(void) |
bant62 | 2:abb7425e1a5b | 462 | { |
bant62 | 1:ce3991daa407 | 463 | |
bant62 | 2:abb7425e1a5b | 464 | if (++pulse_count == max_pulse_count) |
bant62 | 2:abb7425e1a5b | 465 | { |
bant62 | 1:ce3991daa407 | 466 | pulse_count = 0; |
bant62 | 1:ce3991daa407 | 467 | |
bant62 | 2:abb7425e1a5b | 468 | if (++ptn_index == ptn_count) |
bant62 | 2:abb7425e1a5b | 469 | { |
bant62 | 1:ce3991daa407 | 470 | ptn_index = 0; |
bant62 | 1:ce3991daa407 | 471 | } |
bant62 | 1:ce3991daa407 | 472 | ptn_data = ptn[ptn_index]; |
bant62 | 1:ce3991daa407 | 473 | } |
bant62 | 1:ce3991daa407 | 474 | |
bant62 | 2:abb7425e1a5b | 475 | if (pwm_ratio == 10) |
bant62 | 2:abb7425e1a5b | 476 | { |
bant62 | 1:ce3991daa407 | 477 | PulseOut(); |
bant62 | 2:abb7425e1a5b | 478 | } |
bant62 | 2:abb7425e1a5b | 479 | else if (pwm_ratio == 0) |
bant62 | 2:abb7425e1a5b | 480 | { |
bant62 | 1:ce3991daa407 | 481 | PulseStop(); |
bant62 | 2:abb7425e1a5b | 482 | } |
bant62 | 2:abb7425e1a5b | 483 | else |
bant62 | 2:abb7425e1a5b | 484 | { |
bant62 | 2:abb7425e1a5b | 485 | switch (state) |
bant62 | 2:abb7425e1a5b | 486 | { |
bant62 | 2:abb7425e1a5b | 487 | case PWM_ON: |
bant62 | 2:abb7425e1a5b | 488 | if (--pwm_on_count !=0) |
bant62 | 2:abb7425e1a5b | 489 | { |
bant62 | 2:abb7425e1a5b | 490 | PulseOut(); |
bant62 | 2:abb7425e1a5b | 491 | } |
bant62 | 2:abb7425e1a5b | 492 | else |
bant62 | 2:abb7425e1a5b | 493 | { |
bant62 | 2:abb7425e1a5b | 494 | pwm_on_count = pwm_ratio; |
bant62 | 2:abb7425e1a5b | 495 | state = PWM_OFF; |
bant62 | 2:abb7425e1a5b | 496 | } |
bant62 | 2:abb7425e1a5b | 497 | break; |
bant62 | 2:abb7425e1a5b | 498 | case PWM_OFF: |
bant62 | 2:abb7425e1a5b | 499 | if (--pwm_off_count != 0) |
bant62 | 2:abb7425e1a5b | 500 | { |
bant62 | 2:abb7425e1a5b | 501 | PulseStop(); |
bant62 | 2:abb7425e1a5b | 502 | } |
bant62 | 2:abb7425e1a5b | 503 | else |
bant62 | 2:abb7425e1a5b | 504 | { |
bant62 | 2:abb7425e1a5b | 505 | pwm_off_count = 10 - pwm_ratio; |
bant62 | 2:abb7425e1a5b | 506 | state = PWM_ON; |
bant62 | 2:abb7425e1a5b | 507 | } |
bant62 | 2:abb7425e1a5b | 508 | break; |
bant62 | 1:ce3991daa407 | 509 | } |
bant62 | 1:ce3991daa407 | 510 | } |
bant62 | 1:ce3991daa407 | 511 | } |
bant62 | 1:ce3991daa407 | 512 | |
bant62 | 2:abb7425e1a5b | 513 | void StepperMotor::PulseOut(void) |
bant62 | 2:abb7425e1a5b | 514 | { |
bant62 | 1:ce3991daa407 | 515 | //X |
bant62 | 2:abb7425e1a5b | 516 | if ((ptn_data & 0x01) == 0x01) |
bant62 | 2:abb7425e1a5b | 517 | { |
bant62 | 1:ce3991daa407 | 518 | _x = 1; |
bant62 | 2:abb7425e1a5b | 519 | } |
bant62 | 2:abb7425e1a5b | 520 | else |
bant62 | 2:abb7425e1a5b | 521 | { |
bant62 | 1:ce3991daa407 | 522 | _x = 0; |
bant62 | 1:ce3991daa407 | 523 | } |
bant62 | 1:ce3991daa407 | 524 | //Y |
bant62 | 2:abb7425e1a5b | 525 | if ((ptn_data & 0x02) == 0x02) |
bant62 | 2:abb7425e1a5b | 526 | { |
bant62 | 1:ce3991daa407 | 527 | _y = 1; |
bant62 | 2:abb7425e1a5b | 528 | } |
bant62 | 2:abb7425e1a5b | 529 | else |
bant62 | 2:abb7425e1a5b | 530 | { |
bant62 | 1:ce3991daa407 | 531 | _y = 0; |
bant62 | 1:ce3991daa407 | 532 | } |
bant62 | 1:ce3991daa407 | 533 | //Negative X |
bant62 | 2:abb7425e1a5b | 534 | if ((ptn_data & 0x04) == 0x04) |
bant62 | 2:abb7425e1a5b | 535 | { |
bant62 | 1:ce3991daa407 | 536 | _nx = 1; |
bant62 | 2:abb7425e1a5b | 537 | } |
bant62 | 2:abb7425e1a5b | 538 | else |
bant62 | 2:abb7425e1a5b | 539 | { |
bant62 | 1:ce3991daa407 | 540 | _nx = 0; |
bant62 | 1:ce3991daa407 | 541 | } |
bant62 | 1:ce3991daa407 | 542 | //Negative Y |
bant62 | 2:abb7425e1a5b | 543 | if ((ptn_data & 0x08) == 0x08) |
bant62 | 2:abb7425e1a5b | 544 | { |
bant62 | 1:ce3991daa407 | 545 | _ny = 1; |
bant62 | 2:abb7425e1a5b | 546 | } |
bant62 | 2:abb7425e1a5b | 547 | else |
bant62 | 2:abb7425e1a5b | 548 | { |
bant62 | 1:ce3991daa407 | 549 | _ny = 0; |
bant62 | 1:ce3991daa407 | 550 | } |
bant62 | 1:ce3991daa407 | 551 | } |
bant62 | 1:ce3991daa407 | 552 | |
bant62 | 2:abb7425e1a5b | 553 | void StepperMotor::PulseStop(void) |
bant62 | 2:abb7425e1a5b | 554 | { |
bant62 | 1:ce3991daa407 | 555 | _x = 0; |
bant62 | 1:ce3991daa407 | 556 | _y = 0; |
bant62 | 1:ce3991daa407 | 557 | _nx = 0; |
bant62 | 1:ce3991daa407 | 558 | _ny = 0; |
bant62 | 1:ce3991daa407 | 559 | } |