The OAT supports multiple boards and platforms as the MCU.
Currentlly the following is supported:
We currently support the LCD Display Shield with integrated buttons that just slots right on top of the Mega, as well as some I2C displays (see code for details).
The LCD menu is documented here.
Refer to the appropriate board pages linked above for control wiring instructions for each stepper type.
28BYJ-48 steppers require external driver boards with their own power supply:
You can use an old USB cable for power supply. For that cut the end off. Inside will be 4 wires. Green, white, red and black. You can ignore green and white, those are the data lines. Strip the red and black wire and insert them into the In+ and In- ports of the buck converter. (Red = +; black = –)
Cut off 4 dupont wires with female connectors, strip the other ends and insert them into the output of the buck converter.
Screw both ULN2003 drivers on top. Connect the + port to the + pins and the – port to the – pins.
NEMA steppers, unlike 28byj-48, use a significant amount of power, enough to potentially destroy your hardware. This is why you need to double check that you have wired them correctly before first powering them up.
You must NEVER disconnect the steppers from the drivers while the steppers are engaged (powered)! This will likely destroy your drivers. Likewise you have to make sure that the stepper connections are secure and do not disconnect by themselves during operation.
You should always power up the steppers FIRST, then power up the Arduino.
You should always shut off the Arduino FIRST, then power down the steppers. If you are not using the breakout boards, or your breakout boards do not have a protective capacitor you MUST always do it in this order to prevent damage to your drivers!
Do not connect the Arduino to the drivers while both are turned on already.
During the first few seconds of booting, the Arduino will write a couple of instructions to the drivers, such as the current, microstepping and a couple timing related things. If you power up the drivers after the arduino, these instructions will not be received by the drivers. If you see odd behavior such as slow slewing speeds, this might be related to it. Reset the arduino while the drivers are powered to write these instructions again.
If you disconnect the power from the drivers while the steppers are still engaged (i.e drawing up to 5V 2A!) this may cause a destructive voltage spike. The capacitor on the breakout boards will help protect against this, but it is no guarantee. It is better to power the components in the correct order:
First Steppers ON, then Arduino ON
First Arduino OFF, then Steppers OFF
The pins or wires on the NEMA are usually arranged COIL 1 - COIL 1 - COIL 2 - COIL 2 but can also be COIL 1 - COIL 2 - COIL 1 - COIL 2. You should check the layout before making any cables to connect the steppers. If you find that your steppers just vibrate or twitch, this is a likely cause of the problem.
Sometimes, NEMAs dont get shipped with connectors, so you’ll have to do that yourself. You can either solder or crimp. The best method is to solder or crimp a 4 pin JST connector to the wires, but Duponts are ok too. They just dont hold as well.
The order in which to connect the wires is as following:
RED - BLUE - GREEN - BLACK
The order isnt important, if you do black green blue red the motor will simply have its direction reversed. If you wired everything up and find your stepper turning in the wrng direction, simply reverse it in the code with: INVERT_RA_DIR or INVERT_DEC_DIR
If your stepper has other colors, take a look at its datasheet. It’s usually sent with the stepper or you can find it online. You’ll have to align the wires as following:
COIL 1 - COIL 1 - COIL 2 - COIL 2
Coils are sometimes also referred to as COIL A and COIL B. It doesnt matter if you switch the wires within the Coils, so within COIL 1 or COIL 2, but you should never put a wire from COIL 2 together with a wire from COIL 1. E.g. Coil1 - Coil2 - Coil1 - Coil2. Do not do this!
After you have both steppers wired up, go into the code. Make sure that all necessary settings for TMC UART are set. Those are:
SET_MICROSTEPPINGto adjust RA slew stepping
If you change any microstepping and you have adjusted the RA or DEC steps at any point, you need to run the EEPROM_clear sketch in File > Examples > EEPROM!
#define UART_CONNECTION_TEST_TXRX 1to your
Configuration_local.hppfile to enable testing TX/RX functionality. If a stable UART connection is not detected (no reply from the driver), the motors will automatically be disabled.
#define UART_CONNECTION_TEST_TX 1to your
Configuration_local.hppfile to enable texting just TX functionality. This will send commands to both the RA/DEC drivers at boot to move teh steppers slightly. If you do not see the motors move, you likely have a connectivity error with UART (or potentially a power issue to the driver/motor)
#define RA_AUDIO_FEEDBACK 1and
#define DEC_AUDIO_FEEDBACK 1to your
Configuration_local.hppfile. Listen to each motor to determine if the UART command has been sent correctly to the driver.
In Configuration_adv.hpp, find INVERT_RA/DEC_DIR and change it to either 1 or 0 for the axis in question. If the rotation is now still in the same direction than before, doubecheck you DIR wire
Check your STEP wire. Also test your UART connection as described above.
Check the sequence of the wires from the breakout board to the stepper. The default shown in these diagrams is Coil1 Coil1 Coil2 Coil2 but can be Coil1 Coil2 Coil1 Coil2.
It is normal and even desired that the steppers get warm during operation. If they however get very hot very fast, you're giving them too much current. Notice that different NEMA17 motors have different voltages, check if you are supplying the adequate voltage for your motor. If it is right, reduce the value for RA/DEC_RMSCURRENT in Configuration_adv and to be save also reduce the max current over the drivers potentiometer. NOTE that TMC2209 INCREASE their current if you turn the potentiometer counterclockwise! So you have to turn the pot clockwise to decrease the current, which will feel wrong but isn't.