3.4 Adjusting the Number of Beats per Minute
Using the previously described circuit, the motor can be driven as a metronome which oscillates with a fixed number of beats per minute. Considering that the metronome must have a configurable number of beats per minute, a mechanism that adjusts this value was implemented.
The speed of rotation and the number of steps to be run influences the number of beats per minute. Because the metronome runs in a fixed dial, the number of steps is constant, so only the speed of rotation is relevant.
Regarding the stepper motor, the speed of rotation is transposed in the frequency of the signals which drive the contacts of the motor. In the current implementation, the NCO_out represents the clock signal for all the peripherals, so the modification of the NCO_out frequency will cause a modification of the signals connected to the contacts.
This adjustment can be configured by the user, by using a potentiometer with its output connected to an ADCC. Depending on the value provided by the potentiometer, the ADCC will compute a numerical value that will be used as input for the NCO. There is a linear dependence between the value computed by ADCC and the NCO_out frequency.
Due to the physical limitations of the Switec stepper motor used in this application, the range of the number of beats per minute is 40-250.