Stepper Coil Sequencer
A two-phase stepper motor turns one step each time its four coil drivers move to the next pattern in a fixed four-row table. The motion controller hands you a 2-bit step index and a drive enable; you produce the coil pattern. While the enable is low, every coil is released: the motor freewheels and nothing heats up.
Interface
| Port | Direction | Type | Description |
|---|---|---|---|
step | in | 2-bit vector | Position in the four-step sequence |
enable | in | 1 bit | Drive enable; releases all coils when low |
coils | out | 4-bit vector | Coil drivers: coil A on bit 3 down to coil D on bit 0 |
Behavior
The full-step table, while enable = '1':
step | coils | Coils energized |
|---|---|---|
00 | 1100 | A, B |
01 | 0110 | B, C |
10 | 0011 | C, D |
11 | 1001 | D, A |
- While
enable = '0',coilsis"0000"for every step value, including whilestepkeeps changing - When
enablerises again, the pattern for the current step appears immediately
Constraints
STRUCTURE
write the table as a selected assignment driving an internal pattern signal (VHDL with/select; in SystemVerilog, the equality chain from the lesson). Gate that signal with one conditional assignment for the enable.
- VHDL: finish the table with
when othersdriving"0000"; a selector carrying a metavalue (a non-digit value like'X'or'U') should leave the coils safe. The testbench drives an"XX"step at you with the drive enabled and expects released coils. - No processes or always blocks
Loading editor...
Click Run to execute your code. Output will appear here.