Configuration / Axes
In order to customize OnStepX behavior to each users requirements there are a variety of configuration settings in the Config.h file.
Many settings are optional but those settings that must always match your hardware and must be set properly are highlighted in red. In some cases that's enough to get a working telescope controller but usually you also have to fill in the stepper driver information also, at a minimum, which is highlighted in yellow. In all cases you should only change the Value column of the Config.h file to the required selection.
Also, while working on your Config.h file take note of the "Hint" column to the far right, it's there to assist you in determining which settings are critical and which can most often be ignored.
There are numerous checks performed at compile time: Read the compiler warnings and errors, they are there to help guard against invalid configurations.
The Config.h file settings are categorized as follows:
AXIS1 TO AXIS9
All axes behave in a similar way and have similar settings. This is how you associate motor drivers and their settings with the Mount (AXIS1 and AXIS2), Rotator (AXIS3), and Focusers (AXIS4 to AXIS9) of OnStepX.
There are several settings below that can cause OnStepX to refuse to compile with an #error message identifying the cause if configured incorrectly. If it is impractical to do these checks at compile-time OnStepX will do the checks at startup instead and throw a driver error then disable the associated device if configured incorrectly. If a driver configuration error occurs OnStepX will flash an error code on the Status LED (4 flashes per cycle.)
The most common settings to cause these driver errors make note of the using the Status LED below, if unsure of the error source set DEBUG ON in Extended.config.h to see the cause in the Arduino Serial Monitor (and turn it back OFF after the issue is resolved.)
- AXISn_DRIVER_MODEL
- Default Value: OFF (disables the device associated with this axis.)
- Other Values: OFF, A4988, LV8729, TMC2100, TMC2130, TMC5160, TMC2209S, TMC2209, etc. (see below)
- Notes:
- The above list shows the preferred driver models, some are more suitable for use with a Focuser or Rotator (A4988, TMC2100) while others are more suitable for running Mount motors (TMC5160,) the remainder are general purpose. In all cases the appropriate/best driver depends on the exact situation including the controller hardware and motors it's driving.
- STEP/DIR Interface Motor Drivers
- Step-stick Bipolar Stepper Motor Driver Models
- Important: First read over the Stepper Driver Summary (and its linked page for TMC SPI drivers if considering using those) to learn more about the commonly used Step-stick drivers and how to choose a driver that works properly, there are many variations.
- Traditional Type
These use 2 or 3-pin logic state microstep mode control (in OnStepX pinmaps these are AXISn_M0_PIN, AXISn_M1_PIN, AXISn_M2_PIN.) Sometimes the microstep mode is set with jumpers and sometimes these pins are wired to the microcontroller and OnStepX can set/change the microstep mode.- A4988 - 16x microstep, decent basic driver
- DRV8825 - 32x microstep, poor accuracy and noisy
- LV8729 - 128x microstep, good accuracy and quiet
- RAPS128 - obsolete, like above
- S109 - 32x microstep, fair accuracy and quiet
- ST820 - 256x microstep (not tested)
- TMC2100 - 16x microstep, vgood accuracy and quiet
- TMC2130S- 16x microstep, vgood accuracy and vquiet (not tested)
- TMC2208S- 32x microstep, vgood accuracy and vquiet
- TMC2225S- 32x microstep, vgood accuracy and vquiet (not tested)
- TMC2209S- 64x microstep, vgood accuracy and vquiet
- TMC2226S- 64x microstep, vgood accuracy and vquiet (not tested)
- SPI Interface Type (Trinamic)
See the TMC SPI Advanced Configuration page for detailed setup information.
Note: This interface is capable of returning driver status information.
- TMC2130 - 256x microstep, vgood accuracy and vquiet
- TMC5160 - 256x microstep, vgood accuracy and vquiet
- TMC2130 - 256x microstep, vgood accuracy and vquiet
- UART Interface Type (Trinamic)
See the TMC UART Advanced Configuration page for detailed setup information.
Note: This interface is capable of returning driver status information.- TMC2208 - 256x microstep, vgood accuracy and vquiet (not tested)
- TMC2225 - 256x microstep, vgood accuracy and vquiet (not tested)
- TMC2209 - 256x microstep, vgood accuracy and vquiet
- TMC2226 - 256x microstep, vgood accuracy and vquiet (not tested)
- Generic Motor Driver Model
See the Generic Driver Advanced Configuration page for detailed setup information.
- GENERIC - performance varies but generally the best choice for larger stepper motors, etc.
- Step-stick Bipolar Stepper Motor Driver Models
- Servo Motor Driver Models
See the Servo Advanced Configuration page for detailed setup information.- SERVO_EE - Enable/Enable type DC motor driver/servo
- SERVO_PE - Phase/Enable type DC motor driver/servo
- SERVO_TMC2209 - TMC2209 UART mode stepper motor driver/servo
- ODrive Motor Driver Model
See the ODrive Advanced Configuration page for detailed setup information.
- ODRIVE - A serial interface dual servo motor controller
- Default Value: OFF (disables the device associated with this axis.)
- AXISn_STEPS_PER_DEGREE (Mount/Rotator) or AXISn_STEPS_PER_MICRON (Focusers)
- Default Value, Mount: 12800.0
- Default Value, Rotator: 64.0
- Default Value, Focuser: 0.5
- Recommended Values, Mount: 300.0 to 360000.0 (12 arc-sec/step to 0.01 arc-sec/step)
- Recommended Values, Rotator: 10.0 to 3600.0 (6 arc-min/step to 1 arc-sec/step)
- Recommended Values, Focuser: 0.01 to 10 (100 microns/step to 0.1 microns/step)
- Notes:
- For a telescope (Axis1 and Axis2) or rotator (Axis3) this is the number of steps the step/dir (stepper) driver needs to issue to the motor to cause a movement of one degree on this axis.
- For a focuser (Axis4 to Axis9) this is the number of steps the driver needs to issue to the motor to cause a movement of one micron on this axis.
- Reminder:
- For a stepper motor "STEPS" refers to tracking (or normal operating) mode micro-steps; use the Configuration Calculator to help determine this value for mounts.
- AXISn_DRIVER_REVERSE
- Default Value: OFF
- Other Values: OFF, ON
- Notes:
- Set to ON to reverses movement direction for this axis.
- Reminder:
- You can instead reverse stepper driver wiring to do the same.
- In some cases it may be necessary to reverse the direction in the motor driver setup (outside OnStepX.)
- AXISn_LIMIT_MIN
- Default Value, Mount: -180 (degrees)
- Default Value, Rotator: 0 (degrees)
- Default Value, Focuser: 0 (mm)
- Other Values, Mount and Rotator: -360 to 0 (degrees)
- Other Values, Focuser: 0 to 500 (mm)
- Notes:
- For Mounts this is the minimum hour angle in equatorial mode or the minimum Azimuth in ALTAZM mode.
- For Rotators this the minimum angle in degrees.
- For Focusers this is the minimum position in millimeters.
- Reminder:
- For the Mount up to SLEW_RAPID_STOP_DIST (specified in Config.h) distance should be allowed for to stop the mount once the limit is detected. During tracking and gotos if a limit is broken motion is stopped by canceling any goto and turning tracking off.
- For the Rotator and Focusers up to one second should be allowed for to stop the device once the limit is detected.
- This can be changed by adding a line similar to the following to Config.h:
- #define AXISn_RAPID_STOP_TIME 1
- This can be changed by adding a line similar to the following to Config.h:
- Default Value, Mount: -180 (degrees)
- AXISn_LIMIT_MAX
- Default Value, Mount: 180 (degrees)
- Default Value, Rotator: 360 (degrees)
- Default Value, Focuser: 50 (mm)
- Other Values, Mount and Rotator: 0 to 360 (degrees)
- Other Values, Focuser: 0 to 500 (mm)
- Notes:
- For Mounts this is the maximum hour angle in equatorial mode or the minimum Azimuth in ALTAZM mode.
- For Rotators this the maximum angle in degrees.
- For Focusers this is the maximum position in millimeters.
- Reminder:
- For the Mount up to SLEW_RAPID_STOP_DIST (specified in Config.h) distance should be allowed for to stop the mount once the limit is detected. During tracking and gotos if a limit is broken motion is stopped by canceling any goto and turning tracking off.
- For the Rotator and Focusers up to one second should be allowed for to stop the device once the limit is detected.
- This can be changed by adding a line similar to the following to Config.h:
- #define AXISn_RAPID_STOP_TIME 1
- This can be changed by adding a line similar to the following to Config.h:
- Default Value, Mount: 180 (degrees)
- AXISn_DRIVER_MICROSTEPS
- Default Value: OFF
- Other Values: 1 to 256
- Notes:
- Tracking mode micro-steps setting, also used for gotos & slews if AXISn_DRIVER_MICROSTEPS_GOTO is OFF.
- A setting of 1 means full-step, 2 half-step, 4 quarter-step, and so on.
- Reminder:
- For the telescope mount Axis1 and Axis2 this value is present in the Configuration Calculator, if you change this AXISn_STEPS_PER_DEGREE (and PEC_STEPS_PER_WORM_ROTATION for Axis1) changes also.
- Exact values allowed depend on the stepper driver model.
- If an invalid value is entered OnStepX will flash an error code on the Status LED (4 flashes per cycle.)
- AXISn_DRIVER_MICROSTEPS_GOTO
- Default Value: OFF
- Other Values: 1 to 256
- Notes: Optional micro-step mode to use during slews. Using this can allow faster slew speeds when step rates are limited by microcontroller performance.
- Reminder:
- Exact values allowed depend on the stepper driver model and must be < AXISn_DRIVER_MICROSTEPS above.
- If an invalid value is entered OnStepX will flash an error code on the Status LED (4 flashes per cycle.)
- AXISn_DRIVER_IHOLD
- Default Value: OFF
- Recommended Values: 100 to 1500 (mA)
- Notes:
- The stepper driver current at standstill.
- The default OFF results in a hold current equal to 50% of IRUN.
- For highest accuracy set IHOLD to the same value as IRUN since changing the hold current can cause a small movement (of the Declination Axis or a Focuser, for example.)
- Reminder:
- See AXISn_DRIVER_IRUN reminder.
- AXISn_DRIVER_IRUN
- Default Value: OFF
- Recommended Values: 200 to 3000 (mA)
- Notes:
- The stepper driver current while sidereal tracking.
- Be sure to use a value the stepper driver, stepper motor, and controller/power-supply can handle.
- Reminder:
- This setting is only allowed for TMC2130, TMC2209U, TMC2226U, and TMC5160 stepper drivers.
- Be sure to use a value the stepper driver, stepper motor, and controller/power-supply can handle.
- The default TMC2130 current is based on an Rsense of 0.13 Ohms, in the unlikely event this needs to be changed you can do so by adding a line similar to the following to Config.h:
- #define TMC2130_DRIVER_RSENSE (0.13)
- The default TMC5160 current is based on an Rsense of 0.075 Ohms, in the unlikely event this needs to be changed you can do so by adding a line similar to the following to Config.h:
- #define TMC5160_DRIVER_RSENSE (0.075)
- If an invalid value is entered OnStepX will flash an error code on the Status LED (4 flashes per cycle.)
- AXISn_DRIVER_IGOTO
- Default Value: OFF
- Recommended Values: 200 to 3000 (mA)
- Notes:
- The stepper driver current while doing gotos and slewing.
- The default OFF results in a hold current equal to IRUN.
- Reminder:
- See AXISn_DRIVER_IRUN reminder.
- AXISn_DRIVER_STATUS
- Default Value: OFF
- Other Values: OFF, ON, HIGH, or LOW
- Notes:
- Polls this axes driver for status info/fault detection.
- Some drivers provide this signal as a simple logic level where it's, for example, normally LOW then goes HIGH only if there's a fault.
- Other drivers like the TMC2130, TMC2209U, TMC2226U, TMC5160 can use a setting of ON where the driver data interface to sends status info. to OnStepX and provide a wider range of information about the fault/warning state including over temperature, outputs being shorted or open, etc.
- Reminder:
- The driver data interface isn't always available since the SPI-MISO, UART-RX, or AXISn_FAULT_PIN pin might be used for other purposes; so check your board, how its wired, and its configured.
- AXISn_DECAY
- Default Value: OFF
- Other Values: OFF, STEALTHCHOP, SPREADCYCLE
- Notes:
- Sets the tracking driver decay mode.
- Using the default OFF results in STEALTHCHOP mode for quiet operation if a TMC driver is present.
- Reminder:
- This setting is only allowed for TMC2130, TMC2209S, TMC2225S, TMC2209U, TMC2226U, and TMC5160 stepper drivers.
- Using the default OFF results in SPREADCYCLE mode which generally results in the best overall performance though audible noise can be objectionable in some cases.
- STEALTHCHOP is silent but often limits motor RPM to lower speeds vs. SPREADCYCLE, for tracking speeds this is of no concern.
- The TMC22xxS driver by design must have the "spread" pin at AXISn_M2_PIN to use this feature, that is why the FYSETC TMC2209 v3.0 and FYSETC TMC2225 v1.1 drivers are recommended.
- AXISn_DECAY_GOTO
- Default Value: OFF
- Other Values: OFF, STEALTHCHOP, SPREADCYCLE
- Notes:
- Sets the slewing driver decay mode.
- Using the default OFF results in SPREADCYCLE mode which is appropriate for the highest speed slews.
- Reminder:
- See AXISn_DECAY reminder.
- AXISn_SENSE_HOME
- Default Value: OFF
- Other Values: OFF, HIGH, LOW, etc.
- Notes:
- Home switch sense ON state for this axis.
- Home switches are in the ON state for the entire travel on one side of the home position and in the OFF state for the entire travel on the other side.
- The homing sequence involves using the home switch state to determine the direction of motion needed to find the switch.
- When the home switch is ON the forward direction is used to approach the switch, otherwise the reverse direction is used.
- For a Mount the forward movement is counter clockwise as seen from the front/above looking at the RA/Azm and Dec/Alt axes.
- For a Rotator the forward movement is in the clockwise direction.
- For a Focuser the forward movement is toward the Telescope mirror or lens.
- Tip: If this is confusing simply consider each axis separately and with a little trial and error you can quickly resolve if HIGH or LOW should be used, just be ready to stop the motion if needed.
- When the home switch is ON the forward direction is used to approach the switch, otherwise the reverse direction is used.
- There are three phases to find home where each phase ends as the home switch changes state (the phases are termed FAST, SLOW, and FINE.)
- After each of the phases the rate of movement is reduced to 1/6 of the prior rate.
- If the SLOW phase ends on the ON side to the switch an extra SLOW phase is added to move to the OFF side so the final FINE approach is always from the OFF side.
- Home switch sense ON state for this axis.
- Reminder:
- Often PCB designs have a fairly strong pullup resistor along with a bypass capacitor to provide basic ESD protection on this input. However set, LOW or HIGH, the microcontrollers built-in pullup or pull-down resistor (if supported) is also enabled so the pin is normally in the OFF state.
- AXISn_SENSE_LIMIT_MIN
- Default Value: OFF
- Other Values: OFF, HIGH, LOW, etc.
- Notes:
- Limit sense for minimum travel where switch closure causes motion to stop in the reverse direction for this axis.
- Remember to also allow for SLEW_RAPID_STOP_DIST or SLEW_RAPID_STOP_TIME for motion to stop after detection.
- This is most often implemented as a panic switch the user can press and/or a lever activated micro-switch on the mount axis.
- Normally one would use switches that close with a contact to ground then, HIGH for NO (normally open) and LOW for NC (normally closed) switches.
- Reminder:
- Often PCB designs have a fairly strong pullup resistor along with a bypass capacitor to provide basic ESD protection on this input. However set, LOW or HIGH, the microcontrollers built-in pullup or pull-down resistor (if supported) is also enabled so the pin is normally in the OFF state.
- AXISn_SENSE_LIMIT_MAX
- Default Value: OFF
- Other Values: OFF, HIGH, LOW, etc.
- Notes:
- Limit sense for maximum travel where switch closure causes motion to stop in the forward direction for this axis.
- Remember to also allow for SLEW_RAPID_STOP_DIST or SLEW_RAPID_STOP_TIME for motion to stop after detection.
- This is most often implemented as a panic switch the user can press and/or a lever actuated micro-switch on the mount axis.
- Normally one would use switches that close with a contact to ground then, HIGH for NO (normally open) and LOW for NC (normally closed) switches.
- Reminder:
- Often PCB designs have a fairly strong pullup resistor along with a bypass capacitor to provide basic ESD protection on this input. However set, LOW or HIGH, the microcontrollers built-in pullup or pull-down resistor (if supported) is also enabled so the pin is normally in the OFF state.