Stepper Driver Adjustment
I used caution as stepper motors and drivers handle significant electrical power and can get hot, even burning hot (though they shouldn't be configured to allow that.)
Method A: Tune using Vref:
This video at the Pololu website is an excellent resource and should be watched by anyone unfamiliar with the procedure.
First check the stepper motors you have for their current rating. Usually we don't run at 100% current but something around 30% to 60% and so you will need to pick a reasonable current you'd like to test at (within the limits of the stepper motor and stepper driver) and check the mount operation (in the final stages fully loaded) until you are satisfied with the temperature the motors and drivers run at and with the overall performance.
- For the TMC5160 there is no trim-pot on the driver and you must use OnStep version 3 or later and set the current from OnStep's Config.h file AXISn_DRIVER_IRUN (etc.) settings. You can optionally set the TMC2130, TMC2209U, TMC2226U current using this same method then set its Vref trim pot to its highest setting (near) 2.5V as described below.
- If setting one of these TMC driver's Vref near 2.5V it is important that in Config.h you also set the current AXISn_DRIVER_IRUN (etc.) to a reasonable value. If this setting is omitted OnStep will configure the driver for 100% power (assuming Vref is limiting current) which is far more than the driver, and likely your motor, can handle and may very well damage hardware and/or cause extreme heating of motor/driver/etc.
- It is also important to be sure your TMC drivers are the correct model and have the proper configuration otherwise you will get the full 2.5A current setting and possibly damage the drivers.
- For TMC2130's the correct model has SPI control enabled.
- For TMC2209 and TMC2226's the proper configuration has UART control enabled.
- Tip: If you are unsure that communications with the driver(s) have been established it doesn't hurt to keep the Vref tuned to a lower power level until you are sure they are being configured.
To set that current of other drivers you want to test you need to find out what voltage you need to adjust the trim-pot on the driver to, the follow resources can help with that. For TMC drivers I use the "Peak Current" and NOT "RMS Current" since that's in-line with how every other StepStick driver behaves, the formula for this setting on TMC drivers is simple: voltage = current.
1. Assemble the OnStep controller. Double check the wiring/soldering before applying power make sure the components, drivers, WiFi module, etc. are all installed properly.
2. Connect appropriate (suitable voltage and current capability) power supply to the controller.
3. Configure and uploaded the firmware.
4. DO NOT attach stepper motors to the drivers. Never connect or disconnect a stepper motor if the system is powered up.
5. Adjusted each stepper driver's trim pot to the Vref voltage setting you determined. Measure voltage w/ the ground lead touching a PCB ground and + (Red) lead on the driver trim pot (or on the screw driver shaft while turning the trim pot.)
- Having two persons can help.
- Be careful to not touch anything but a ground and the trim-pot.
Method B: Tuning by feel:
I used this with A4988 and DRV8825 stepper drivers but it's not very effective with more modern drivers. Slowly increasing the current with the potentiometer I could hear the pulse width modulation resonance (singing) and the motor started to move. Then, I adjust the motor so that the motion was smooth; too little and the motion was erratic, too much and it would cog to the full-step positions. Be sure to monitor the stepper drivers and stepper motors for >half an hour (minimum) to be sure nothing overheats.
1. Follow the Method A steps (1-5) to set the drivers trim-pots at their minimum voltage then power the system off.
2. Plug/connect stepper motors to the drivers. Never disconnect a stepper motor while the system is powered up.
3. Connect OnStep USB interface to your computer.
4. Open a serial console in the Arduino software then typed ":A1#" - this *starts the equatorial tracking pulses (RA).
5. Adjust the RA/Azm stepper motor current for smooth operation as described at the start of this section.
6. From the serial console in the Arduino software type ":R2#:Ms#" - this starts the Dec motor moving.
7. Adjust the Dec/Alt stepper motor current for smooth operation as described at the start of this section.
8. Focuser/Rotator drivers, if present, can be adjusted in a similar fashion using the SmartWebServer or Android App to make the motors move.