How can we control the number of steps in a step and what this lecture will explain how to give the
number of steps to a step emoter as its input, we will use the two phase one method to drive this to
promote.
The control of supermoto and integer number as an input defines a number of steps.
Also, I one with put sends the Sakar man to the mod, therefore when they stop and what a driver receives
a signal pulse on the starting point, it should load the number on its impact and use that as the initial
value for a counter register to count the number of states in the FSM implementing its behavior.
Before writing the code, Etchells, let's have a look at the final design in Vivaan, the design consists
of four ipis.
The main IP is the stepmonster driver.
This IP has a 16 bit input which will be connected directly to slide switches on the basis rebought.
It also has to a single bit inputs motorcoach right and load.
Whereas the motorcoach right defines the speed of going from one step to the next.
The load signal will come on the motto to read the number of steps input and it starts the rotation.
The stepmother, crockpots, IPE, supplies the motorcoach right signal the answer and pulse generator
epis also connect the loud input to a push button.
Let's start coding, open the White House and create a new project with the name of a Stepa underscore,
malter underscore driver underscore with underscore citral underscore white essentialists then select
astep underscore Märta underscore driver underscore with underscore citral at a top function.
Don't forget to choose the bases rebought as a target FPGA platform.
Download the design files and add them to the created project.
Open the design source file as a two phase one method is selected to provide the motor signals the design
FSM has for states which are defined within enumeration data type, the design top function is defined
with four arguments, three inputs and one output.
To a static, variables are declared to save the designer status and the number of remaining steps.
Two temporary variables are also defined, corresponding to the defined static variables, also, a
temporary variable is defined to keep the intermediate values for the design output values when the
load input signal is high.
The counter should be initialized with the value of their steps input.
Then the states in the FSM check them all to collaborate and the steps counter.
If the clock right is one and they stop Kountouris, not zero, then the counters would be decrement.
The state should be changed and the motor should rotate one step further.
Otherwise, the FSM does not change its state.
Synthesize the code and export the corresponding article IP.
Now around the world and create a new project with the name of a stepa underscore to underscore driver
underscore with underscore on this Gheorghiu and select the basis reboard as a target FPGA platform.
Create a new blog design.
And for Ipis to deliver the repository.
The bouncer pulse generator, a amateur kozakiewicz generator, and the establishment of the Reiber.
Instantiate the pipes and connect them together and change the port's name properly.
Download the consent file from the resources folder attached to this lecture and add that to the project,
then generativity stream and program the board.
Something number 800 or one one zero zero one zero zero zero zero zero in binary on this light switches
and pressed up push button, know that as this angle of this stepper motor into two phase one method
is zero point 45 degree, then 800 multiply zero point forty five equals to 360, which means the step
motor will rotate a complete round.
So different numbers on this light switches and pressed up push button and inspect this supermoto.
The next lecture will go into the details of implementing the one two phase on method in Etchells.
This is our takeaway message, using a counter in the Supermoto, driver FSM enables the precise control
on the state rotation.
Now, the quiz question, what number should be set on this light switches such that the motor rotates
three complete rounds and a half?