Step Motor Module Project

Step motor module project is described as a series of "mini"-project to develop a fully functional step motor module. Steps and requirements employed in each iteration have been selected as a natural evolution of the design, although it is possible to exchange several of the steps without trouble.
Each new step contains the first four stages it must be followed when carrying out a project in a VHDL design: Requirements, Design, Implementation and Test. Further VHDL project development incurs in hardware implementation: Pin out selection and Programming. Due to the minimal variation between the different steps used in the Step Motor Module, these later stages are only used during first and last step in the project.

Basic Step Motor Module

Requirements
Implement a module capable to control a step motor clockwise rotation using full-step encoding. Rotation is triggered by edge detection on the control signal. A reset signal (low active) is included to reset the motor encoding to a known position.

All designs are meant to be tested using the following hardware:
- Altera's DE2 Board : Course FPGA Boards
- Step Motor Engine : Engine Datasheet
- Buffer Board : Chip Datasheet

Design
Design is presented in figures 1 to 3. Click on figure to enlarge it.
Figures 1-3: CC1, CC2 and Register processes of Basic step motor module

Implementation

Test
Simulated testbench is provided in figure 1b.

Figure 1b: Testbench simulation for Basic step motor module

Testbench file is provided:Testbench file v1 

Pin out selection
Selected pins have been chosen for Altera's DE2 development board. Pins are:

 SignalPin Signal Pin 
CLK N2 A_out K26 
RSTNG26 B_out M23 
StepP23 (1)C_out M20 
  D_outM21 

(1) It was used edge detector in design.

Programming
Due to the transfer relationship between wheels within the step motor engine, it is not advisable to record a video. Eventhough, it is still possible to test its performance.


Figure 1c: Picture on downloaded design

Please refer to video on last implementation to see it working with a step generator module.

Clockwise and Counter-Clockwise Step Motor Module
Requirements
Enhance previous module with the capability to change rotation direction.

Design
Design in presented in figure 3. Click on figure to enlarge it.

Figure 4: Updated CC1 of Basic step motor module

Implementation

Test
Simulated testbench is provided in figure 4b.

Figure 4b: Testbench simulation for enhanced Basic step motor module

Testbench file is provided:Testbench file v2

Output Inhibit Step Motor Module
Requirements
Enhance previous module with the capability to deactivate output signal. This is suitable when it is desired to move the motor without effort, otherwise coils in motor would force a determined position.

Design
Design is presented in figures 5 and 6. Click on figures to enlarge them.

  
Figures 5-6: Updated CC1 and CC2 on Basic step motor module

Implementation

Test
Simulated testbench is provided in figure 5b.

Figure 5b: Testbench simulation for enhanced Basic step motor module

Testbench file is provided:Testbench file v3

Final Step Motor Module
Requirements
Finally, a multi-rotation mode is added. Controlled by an external signal, the step motor should be capable to rotate either Full-Step or Half-Step. Bear in mind the next step to take on rotation when mode has been shifted.

Design
Figure 7 presents the updated CW rotation flow diagram. Similarly, it should be updated Counter Clockwise branch. Once the design is complient, output combinational circuit should accomodate the new output values as shown in figure 8.

Figures 7-8: Updated Clockwise branch and CC2 in Final step motor module

Implementation

Test
Simulated testbench is provided in figure 7b.

Figure 7b: Testbench simulation for Final step motor module

Testbench file is provided:Testbench file v4

Pin out selection
Selected pins have been chosen for Altera's DE2 development board. Pins are:

 SignalPin Signal Pin Signal Pin 
CLK N2 RSTN G26 A_out K26 
STEPP23 (1) DIR N25 B_out M23 
INHIBITP25 MODE N26 C_out M20 
    D_outM21 

(1) It was used edge detector in design.

Programming
Following video presents design in action once it has been downloaded to Altera's DE2 development board.



Video 1: Demostration on design performance


A complete project is provided in a zip file. Bear in mind that the project contains all modules already developed in previous sections as well as several modules/constraints to manage them. Presented video has been taken using the enhanced project.

Other developed modules
In order to properly test the step motor modules, it has been designed additional modules as well as a wrapper to hold all design presented. The source code for those files is provided:

- Edge detector : Edge Detector
- Step generator: Step Generator
- CSD project: CSD Project

It is not intended to provide , as it has already been presented in the videos. The reader might find necessary to study and adapt the code to their needs. Pins assigned for Altera's DE2 development board are provided:

 SignalPin Signal Pin Signal Pin 
CLK N2 RSTN G26 A_out K26 
STEPP23 (1) DIR N25 B_out M23 
INHIBITP25 MODE N26 C_out M20 
    D_outM21 

(1) It was used edge detector in design.

 SignalPin  SignalPin Signal Pin Signal Pin  SignalPin  SignalPin 
 STEP_LEDY12  SPEED_LED[17]AD12  SPEED_B[6]N9 ROTOR_B[6]T3 MOD_D[6]W24MOD_B[6] AB24
 STAT_LED[7]Y18  SPEED_LED[16]AE12  SPEED_B[5]P9 ROTOR_B[5]R6 MOD_D[5]U22MOD_B[5]AA23
 STAT_LED[6]AA20 SPEED_LED[15]AE13  SPEED_B[4]L7 ROTOR_B[4]R7 MOD_D[4]Y25MOD_B[4] AA24
 STAT_LED[5]V17  SPEED_LED[14]AF13  SPEED_B[3]L6 ROTOR_B[3]T4 MOD_D[3]Y26MOD_B[3]Y22
 STAT_LED[4]U18  SPEED_LED[13]AE15  SPEED_B[2]L9 ROTOR_B[2]U2 MOD_D[2]AA26MOD_B[2]W21
 STAT_LED[3]V18 SPEED_LED[12]AD15  SPEED_B[1]L2 ROTOR_B[1]U1 MOD_D[1]AA25MOD_B[1]V21
 STAT_LED[2]W19 SPEED_LED[11]AC14 SPEED_B[0]L3 ROTOR_B[0]U9 MOD_D[0]Y23MOD_B[0]V20
 STAT_LED[1]AF22 SPEED_LED[10]AA13 SPEED_A[6]M4 ROTOR_A[6]R3 MOD_C[6]Y24MOD_A[6]V13
 STAT_LED[0]AE22 SPEED_LED[9]Y13 SPEED_A[5]M5 ROTOR_A[5]R4 MOD_C[5]AB25MOD_A[5]V14
 SPEED_SEL[2]V2 SPEED_LED[8]AA14 SPEED_A[4]M3 ROTOR_A[4]R5 MOD_C[4]AB26MOD_A[4]AE11
 SPEED_SEL[1]V1 SPEED_LED[7]AC21  SPEED_A[3]M2 ROTOR_A[3]T9 MOD_C[3]AC26MOD_A[3]AD11
 SPEED_SEL[0]U4 SPEED_LED[6]AD21  SPEED_A[2]P3 ROTOR_A[2]P7 MOD_C[2]AC25MOD_A[2] AC12
 MOD_SEL[1] AD13 SPEED_LED[5]AD23 SPEED_A[1]P4 ROTOR_A[1]P6 MOD_C[1]V22MOD_A[1]AB12
 MOD_SEL[0] AF14 SPEED_LED[4]AD22 SPEED_A[0]R2 ROTOR_A[0]T2 MOD_C[0]AB23MOD_A[0]AF10
   SPEED_LED[3]AC22        
   SPEED_LED[2]AB21        
   SPEED_LED[1]AF23        
   SPEED_LED[0]AE23        


ċ
CSD_project.zip
(1374k)
Juan Carlos Arco Fernandez,
31 de jul. 2014, 10:24
ċ
csd_project.vhd
(8k)
Juan Carlos Arco Fernandez,
18 de jul. 2014, 14:05
ċ
edge_detector.vhd
(2k)
Juan Carlos Arco Fernandez,
18 de jul. 2014, 14:05
ċ
step_generator.vhd
(3k)
Juan Carlos Arco Fernandez,
18 de jul. 2014, 14:05
ċ
step_motorv0.vhd
(2k)
Juan Carlos Arco Fernandez,
18 de jul. 2014, 14:05
ċ
step_motorv1.vhd
(2k)
Juan Carlos Arco Fernandez,
18 de jul. 2014, 14:05
ċ
step_motorv2.vhd
(2k)
Juan Carlos Arco Fernandez,
18 de jul. 2014, 14:05
ċ
step_motorv3.vhd
(3k)
Juan Carlos Arco Fernandez,
18 de jul. 2014, 14:05
ċ
step_motorv4.vhd
(4k)
Juan Carlos Arco Fernandez,
31 de jul. 2014, 10:04
ċ
tb_stepv1.vhd
(1k)
Juan Carlos Arco Fernandez,
23 de jul. 2014, 0:59
ċ
tb_stepv2.vhd
(1k)
Juan Carlos Arco Fernandez,
23 de jul. 2014, 0:59
ċ
tb_stepv3.vhd
(2k)
Juan Carlos Arco Fernandez,
23 de jul. 2014, 0:59
ċ
tb_stepv4.vhd
(2k)
Juan Carlos Arco Fernandez,
23 de jul. 2014, 0:59
Comments