I am currently working on a project with a stepper motor where I have run into a little confusion on what to do. Here is the general gist of the project:
I am powering a NEMA 17 stepper motor with an Arduino Uno and Arduino Motor Shield. I have designed a full-wave rectifier via an op-amp/hardware to allow the stepper motor to do complete rotations as opposed to oscillatory movements, as the rotating motor will be hooked up to a mechanical device that will essentially translate the rotational movement to a vertical linear movement (the motor function is irrelevant for this question, however). What I am intending on doing is using PWM to alter the frequency/rpm of the motor (I will be exploring frequencies between 0 Hz and 100 Hz, in increments of 5 Hz). In addition to that, I would like to assign a “digital Word” to every frequency that I will be testing so that when I change the frequency of the motor to 5 Hz, for example, the digital word 0001 is sent to a certain channel that I can pull data from for data analysis. This allows me to know when I was at 5 Hz, 10 Hz, 15 Hz, 20 Hz, etc… This will continue (when the motor is changed to 10 Hz, the Arduino assigns 0010 to a new channel for data analysis, etc.).
What would be the best way to go about this?