|
|
(27 intermediate revisions by 2 users not shown) |
Line 1: |
Line 1: |
− | {{TOC right}}
| + | #REDIRECT [[Kart]] |
− | | + | |
− | The [[Kart|kart's]] stepper motor controller FPGA generates 4 coil driving signals and receives a ''stepper end'' input.
| + | |
− | | + | |
− | [[File:Kart stepper board.jpg|center|200px|stepper motor board]]
| + | |
− | | + | |
− | == Stepper motor ==
| + | |
− | | + | |
− | === Hardware ===
| + | |
− | | + | |
− | The stepper motor is a [http://en.nanotec.com/ Nanotec] [[Media:SP3575M0906-A.pdf|SP3575M0906-A]].
| + | |
− | | + | |
− | It has a step angle of 7.5°, and as such 48 steps per turn.
| + | |
− | | + | |
− | === Connector ===
| + | |
− | | + | |
− | The cables are connected as follows:
| + | |
− | {| cellpadding="4" cellspacing="0" border="1"
| + | |
− | ! Signal
| + | |
− | ! Color
| + | |
− | |-
| + | |
− | | phase 1
| + | |
− | | white
| + | |
− | |-
| + | |
− | | phase 2
| + | |
− | | blue
| + | |
− | |-
| + | |
− | | phase 3
| + | |
− | | red
| + | |
− | |-
| + | |
− | | phase 4
| + | |
− | | yellow
| + | |
− | |-
| + | |
− | | power
| + | |
− | | brown, black
| + | |
− | |}
| + | |
− | | + | |
− | == FPGA design ==
| + | |
− | | + | |
− | The stepper motor controller has to generate the 4 phases to turn the [[Kart|kart's]] steering wheels to the desired angle.
| + | |
− | | + | |
− | To begin with, the [[Kart#FPGA_Design|design environment]] has to be downloaded.
| + | |
− | It comprises the <code>stepperMotorController</code> block contains the provided I2C bus interface
| + | |
− | and an empty <code>angleControl</code> block which is to be designed.
| + | |
− | | + | |
− | === Functionality ===
| + | |
− | | + | |
− | The block receives a <code>target</code> unsigned number and has to step the coils at each occurrence of the <code>enStep</code> signal until the desired angle is reached.
| + | |
− | The current in the coils is given by the 4 outputs <code>coil1</code> to <code>coil4</code>.
| + | |
− | The steering angle, <code>actual</code>, is estimated with the help of a counter which increments or decrements each time when when the coil control signals change.
| + | |
− | | + | |
− | The block provides the estimated angle, <code>actual</code>, together with a logic signal, <code>reached</code>, telling if the desired angle has been reached.
| + | |
− | | + | |
− | === Zero position ===
| + | |
− | | + | |
− | A switch contact, providing the signal <code>stepperEnd</code>, has to be mechanically fitted on the kart in order set one end of the wheels' direction movement.
| + | |
− | As soon as <code>stepperEnd</code> is activated, the stepper motor is stopped and the <code>actual</code> angle is reset.
| + | |
− | | + | |
− | With this, the steering motor will not try to turn further than what the kart's mechanical structure allows it to in one of the directions.
| + | |
− | In the other direction, it is the programmer's task not to request a too large <code>target</code> angle.
| + | |
− | This also means that the angles are always considered as positive numbers, the zero position being given by the <code>stepperEnd</code> switch.
| + | |
− | | + | |
− | {{TaskBox|content=
| + | |
− | Draw the schematics of the <code>angleControl</code> block.
| + | |
− | }}
| + | |
− | {{WarningBox|content=
| + | |
− | * In order to limit the current consumption, turn off the current in all the coils when the stepper motor is not turning any more.
| + | |
− | * Make sure that both the first and the last pulse of the coil control signals have the same duration as all the others.
| + | |
− | }}
| + | |
− | | + | |
− | === Hardware orientation ===
| + | |
− | | + | |
| | | |
| [[Category:Kart]] | | [[Category:Kart]] |