Success MiniPCB2 Focuser Using TMC2208
I struggled trying to make the focuser work and I noticed that only a few people only ever post their success with it on the MiniPCB2. So here's mine.
I'm using a BigtreeTech TMC2208 and a 400 steps stepper motor (17HM15-0904S). Driver's Vref is set to 0.54V which means the motor is running at 60% of its max rated current of 0.9A (30-60% recommended). I slowly adjusted the Vref until the motor reached the point that it was not losing steps and it had enough torque. I'm running the motor at 1/16 microstepping by setting the MS1 and MS2 pins to HIGH (jump wires from driver's VDD pin to MS1 and MS2). The focuser is direct driven by the motor (1:1). More info on setting the TMCxxxx driver's Vref here and here.
AXIS4_STEPS_PER_MICRON is computed as follows:
Focuser shaft diameter (mm) * PI / Motor steps / Microsteps * 1000 = microns per step
4mm * 3.14 / 400 / 16 * 1000 = 1.963 microns per step
1.0 / 1.963 = 0.509 or 0.51 steps per micron
More Info here and here.
// AXIS4 FOCUSER 1
#define FOCUSER1 ON
#define AXIS4_STEPS_PER_MICRON 0.51
#define AXIS4_SLEW_RATE_DESIRED 500
#define AXIS4_DRIVER_MODEL OFF
#define AXIS4_DRIVER_MICROSTEPS OFF
#define AXIS4_DRIVER_IHOLD OFF
#define AXIS4_DRIVER_IRUN OFF
#define AXIS4_DRIVER_POWER_DOWN OFF
#define AXIS4_DRIVER_REVERSE OFF
#define AXIS4_DRIVER_DC_MODE OFF
#define AXIS4_LIMIT_MIN_RATE 50
#define AXIS4_LIMIT_MIN 0
#define AXIS4_LIMIT_MAX 50
- Make sure that the stepper driver is well grounded
- If you are going to power the VDD pin of the driver with a voltage regulator (instead of Teensy's 3.3V pin), make sure to supply only 3.3V and NOT 5V! Feeding it 5V will make the motor erratic. Also, make sure that it is grounded to the OnStep board.
- Pin 31 and 32 on Teensy are under its board. Pin 31 is connected to the driver's Step pin and pin 32 on Dir pin.
- Connecting TMC2208's (BigtreeTech) ENable pin to the microcontroller is unnecessary, but you should connect it to the ground to make the motor work.
- You don't have to use a 12V voltage regulator to power the driver like in the MaxPCB2. You can even supply it with 18V from a laptop power supply as I did.
- Never disconnect the motor when OnStep is powered on as it might destroy the driver, microcontroller, or motor.
- If you don't see the motor moving when you press the Focus Out/In button, try holding the button for 5 seconds to make the rotation faster (it is best to use a SHC to quickly test the focuser). Otherwise, double-check your connections.
- If you plan to control it via NINA, install OnStep's ASCOM focuser driver first then set it up in the ASCOM device hub properties (setup both OnFocus and OnStep Focuser). In NINA, choose OnStep Focuser instead of OnFocus. I don't know why OnFocus was showing errors for me but choosing OnStep Focuser instead fixed it.