By Marquis Smith and Peter Moe-Lange
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Introduction
In this project, we used a stepper driver to control a stepper motor to spin. This stepper motor is capable of moving at very precise intervals, and at different speeds. We used a Basys 3 FPGA board to send a signal to the stepper driver and motor over a breadboard medium.
Extra functionality is introduced with switches that correspond to inputs on the stepper driver. When functioning properly, our motor movement intervals would be based on the the state machine implemented using HDL code and wire inputs, from full 1/1 stepper movement to as precise as 1/16 stepper movement. Our reset is simply a "failsafe"; that is if anything unwanted happens within the state machine, the driver will default the motor to its highest movement interval setting.
Step 2: Materials
Here are the materials you will need for setup:
A4988 Stepper Driver
Nema 17 Stepper Motor (We used a 4-wire model, a 6 wire model will require more inputs and code for variable power/torque functionality)
Any standard breadboard
Standard Jumper wires
Variable power supply (For this project, the power ranges are somewhat specific and sensitive for optimal performance)
Tape (or flag of some sort to view motor steps clearer)
Alligator clips (To connect the board the power supply, although of course this can be done multiple ways)
Step 3: Schematics, Code, and Block Design
This code is an implementation of a PWM module; one that takes digital clock and duty inputs and outputs an "on" and "off" cycle that simulates analog inputs. Our stepper driver component then takes this output as an input and uses it to drive the motor in steps.
Disclaimer: While we initially used the given clock VHDL code and slightly modified it to run on our stepper, it didn't have the full functionality we needed to use intervals. The code found in the "source" part of the file shows the organization and author by the name of Scott Larson; however we did add in the state machine we created at the end (in the same pwm file) that modulates the clock on and off cycles.
Step 4: Assembly
1. Using 2 Jumper wires, connect your two PMOD outputs to the breadboard. These are for the pwm_out signal and your directional signal that will connect to the stepper driver indirectly.
2. Using 3 Jumper wires and preferably the same PMOD columns for simplicity, connect your "precision" outputs to the breadboard. These wires are for defining which stepper state gets triggered using the inputs on the stepper driver again
3. Using a 4-crimp connector, connect the 4-wire motor to the breadboard. Ensure that the order is the same as given on the sample setup; this is important otherwise you may blow out the chip.
4. Using a second 4-crimp connector, connect the first to the second.
5. Assuming you're using a dual output (2 separate voltage/amp levels) power supply, connect the board's VCC output to the breadboard as shown. NOTE: Make sure that power is given to the board (and subsequently the stepper driver) before the motor in the next step, as you might destroy chip internals with the excess voltage.
6. Finally, using the alligator clips or some other wires, connect the 2nd output voltage to the motor IN SERIES. Ensure again that this is using the proper output on the stepper driver.
Step 5: Conclusion
And there you have it, a running stepper motor that varies its steps based on the wire input given to the stepper driver. Due to our limited time, we weren't able but wanted to use Python to translate G-code into clock cycles that could then be used in junction with multiple motors to create a multi-axis module. We also weren't able to successfully get the final 1/16 stepper mode (the most precise) to run consistently. This was likely due to our state machine getting caught or automatically resetting before hitting this stage, even when our switch inputs were true.
Here's the final video link: