Last edited · 3 revisions  

 


Configuration / Controller

In order to customize OnStep's behavior to each users requirements there are a variety of configuration settings in the Config.h file.

Instead of editing the Config.h file manually, you can use the web based Online Configuration Generator which gets you a basic working file quickly by answering a few questions. You can later edit the same file further to add more options, when you need them.

If you are manually editing the file, then 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.

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:

 

PINMAP

This lets OnStep know what hardware it's going to be running on.  This also controls which pin-map is associated and which micro-controllers (MCU) aka "Boards" (Mega2560, Teensy3.x, STM32, etc.) are allowed.

Parameter Name

  • PINMAP
    • Default Value: OFF
    • Other Values: MiniPCB, MiniPCB2, MaxPCB, MaxPCB2, STM32Blue, Ramps14, MaxESP2, MaxESP3
    • Notes The most common selections are listed above, see OnStep's Constants.h file for the complete list.
    • Reminder: Micro-controllers are selected in the Arduino IDE's menu Tools->Board.

SERIAL PORTS

These ports provide a way for the various control applications to communicate with OnStep.  Either communicating directly as TTL serial or across another media such as USB, WiFi, Bluetooth, RS232, etc.

Parameter Name

  • SERIAL_A_BAUD_DEFAULT
    • Default Value: 9600
    • Other Values: 9600,19200,57600,115200
    • Notes: The primary interface SERIAL_A usually the same USB virtual serial port used to upload the OnStep Arduino Sketch and is also used for USB PC connections (for ASCOM for instance.)
    • Reminder: This should almost never be changed.
  • SERIAL_B_BAUD_DEFAULT
    • Default Value: 9600
    • Other Values: 9600,19200,57600,115200
    • Notes: The secondary interface SERIAL_B is a TTL serial port that is often attached to the WiFi or Ethernet Add-ons (which "bridge" the serial traffic to IP.)
    • Associated Options: The SERIAL_B_ESP_FLASHING ON option allows upload of firmware to the ESP8266 WiFi Add-on through OnStep.  This is so you can update everything without opening the controllers case to pull the WeMos D1 Mini (or ESP-01) for flashing.  Only two OnStep controllers allow this so far, the MiniPCB1 and MaxESP3, and then only if setup for it (shunts in the correct positions.)  Just connect to OnStep on its primary serial interface (SERIAL_A) and send the :hF#:ESPFLASH# commands to place the controller in firmware upload mode.  See the WiFi Add-on's Wiki for more information on how to flash the ESP8266.
    • Reminder: This is usually not changed.  This port might not work on an MKS Gen-L due to the boards h/w design.
  • SERIAL_C_BAUD_DEFAULT
    • Default Value: OFF
    • Other Values: OFF, ON, 9600,19200,57600,115200
    • NotesA third interface, SERIAL_C is sometimes present as a TTL serial port also in which case a HC05 Bluetooth adapter or other device can be attached in similar fashion to SERIAL_B.  When running OnStep on an ESP32 SERIAL_C is the virtual serial port for its built-in Bluetooth hardware and can be enabled by using the ON setting.
    • Associated Options: The SERIAL_C_BLUETOOTH_NAME "OnStep" option applies only to the ESP32 and allows you to change the name of the Bluetooth device.
    • Reminder: This port is often used on the MKS Gen-L as RX2/TX2.  On a MaxPCB2 this is RX4/TX4.

MOUNT TYPE

Set this to match your mount type.  The default Meridian Limits in GEM (German Equatorial Mount) mode are 15 degrees past the Meridian on the East or West side before the mount flips.  The Meridian Limit defaults can be changed using run-time settings.  In FORK and ALTAZM (Dobsonians etc.) modes Meridian Limits are disabled allowing a full range of motion but in a single orientation without Meridian Flips.

In spite of its name the GEM mount type can be used with Fork, Yoke, and other types (but not ALTAZM) as well depending on how you configure the Limits and use the Preferred Pier Side feature.  The GEM option can even allow a full 360° range of motion on either side of the Meridian should that be required for unobstructed and other more exotic designs.

Parameter Name

  • MOUNT_TYPE
    • Default Value: OFF
    • Other Values: OFF, GEM, FORK, ALTAZM
    • Notes: The Home Position is always pointing at the NCP (North Celestial Pole) or SCP (South Celestial Pole) depending on the site Latitude being in the northern or southern hemisphere.  For GEM mounts the HA (hour angle) is 6 hours for FORK mounts the HA is 0 hours (on the Meridian.)

USER FEEDBACK

These options provide some user feedback as to what OnStep is doing.

Parameter Name

  • LED_STATUS
    • Default Value: ON
    • Other Values: OFF, ON
    • Notes: Illuminate the corresponding LED when OnStep is running but idle; when sidereal tracking is enabled the LED will flash 5x a second.
  • LED_STATUS2
    • Default Value: OFF
    • Other Values: OFF, ON
    • Notes: Illuminate the corresponding LED when OnStep is doing a goto, off otherwise except if PPS is available.  In which case the LED will flash 1x a second when a valid PPS signal is present.
  • LED_RETICLE
    • Default Value: OFF
    • Other Values: OFF, 0 to 255 (0 to 100%)
    • Notes: Default reticle illumination power for a polar-alignment 'scope (etc.)  The Android App, SHC, and even a basic hand controller also have controls to adjust the reticle brightness.
  • BUZZER
    • Default Value: OFF
    • Other Values: OFF, ON, 100 to 6000 (Hz freq.)
    • Notes: Use ON where a piezo buzzer makes sound whenever power is applied or use the frequency in Hz where an attached speaker needs an oscillating signal to make sound.
    • Associated Options: Use BUZZER_STATE_DEFAULT ON to enable alert sounds at boot or OFF to disable.  You can also enable/disable sound in the run-time settings.

TIME AND LOCATION

A time location source can provide the Date/Time and optionally the Latitude/Longitude to OnStep.  Only the GPS option is capable of providing both Date/Time and Latitude/Longitude, all others provide only the Date/Time.

  • TIME_LOCATION_SOURCE
    • Default Value: OFF
    • Other Values: OFF, DS3231, DS3234, TEENSY, GPS
    • Notes: The DS3231 uses the OnStep default I2C bus on the micro-controller.  The DS3234 uses the default SPI bus (see your pin-map to locate CS etc.) on the micro-controller.  The TEENSY option uses the on-board Teensy3.2 RTC hardware (which requires adding a crystal and battery.)  The GPS module needs to be attached to a hardware serial port (see below.)
    • Associated Options:
      • Adding a GPS to OnStep requires specifying an otherwise un-allocated hardware serial port for GPS use.
      • For a Teensy3.5/3.6 you could use Serial6 for instance and add the following line to Config.h: "#define SerialGPS Serial6".
      • (master-branch) The default baud rate for this port is 4800 but that can be overridden with this line in Config.h: "#define SerialGPSBaud 9600".
    • Reminder:
      • The DS3231 RTC chip is an I2C device and so has an address (0x68) which is used to identify it on the I2C bus.
      • The DS3231 module we use is really two devices in one, it also contains an AT24C32 I2C EEPROM at address (0x57) which is required for the STM32 version of OnStep to operate.
      • Sometimes a TLS also provides an high accuracy PPS (Pulse Per Second, see SENSORS section below) signal that can help stabilize the OnStep's tracking frequency.

SENSORS

See the Weather.ino file for the required libraries that must be downloaded and installed in ~/Documents/Arduino/Libraries/ for the BME280 and OneWire support to function.

(master-branch) In some board designs it is handy to provide an extra logic level (3.3V) power connection for use as a pull-up voltage source.  For example, you can have 3.3V on Aux3 of a MaxPCB2 DB9 connector for this purpose with a line similar to this in Config.h: "#define GeneralPurposePowerPin1 36".

  • WEATHER
    • Default Value: OFF
    • Other Values: OFF, BME280, BME280_0x76, BME_SPI
    • Notes: Provides temperature, humidity, and barometric pressure.  In the absence of an BME280 the system falls back to the defaults (10°C, 70%, 1010mb) unless changed at run-time.  These values are also used for refraction calculations in OnStep.  Uses the OnStep default I2C bus on the micro-controller except for the BME280_SPI option which uses the default SPI bus (see your pin-map to locate CS etc.)  The BME280 option uses I2C address 0x77 some modules are at 0x76.
  • TELESCOPE_TEMPERATURE
    • Default Value: OFF
    • Other Values: OFF, DS1820
    • Notes:
      • Provides the telescope temperature which is used for TCF (Temperature Compensated Focusing.)
      • In the absence of an DS1820 the system falls back to the WEATHER sensor temperature for TCF (see above.)
      • Uses the OnStep default OneWire bus pin on the micro-controller (see your pin-map to locate this pin.)
        • The OneWire bus pin can also be overridden with this line in Config.h: "#define OneWirePin 22".
        • DS18B20's don't seem to work in parasitic power mode with this library so be sure to run Gnd, Vcc, and 1-Wire to them.
        • A weak pullup resistor in the range of 5Kohm is required between VCC and DATA (reference DS1820 datasheet, Overview section paragraph 2)
  • HOME_SENSE
    • Default Value: OFF
    • Other Values: OFF, ON, ON_PULLUP, ON_PULLDOWN
    • Notes: Home switches allow OnStep to move a mount back to the Home Position without any knowledge of where its actually pointing.  For GEM mode only (untested for others.)  These are usually lever switches that make/break at the Home Position such that with each axis for ~180° of travel (away from home) in one direction the switch is OPEN (HIGH) and in the other direction for ~180° of travel the switch is CLOSED (LOW.) 
    • Associated Options:
      • HOME_SENSE_STATE_AXIS1
        • Default Value: HIGH
        • Other Values: LOW, HIGH
        • Notes: RA (Azm) axis state when clockwise of Home Position, as seen from front.
      • HOME_SENSE_STATE_AXIS2
        • Default Value: HIGH
        • Other Values: LOW, HIGH
        • Notes: Declination (Alt) axis state when clockwise of Home Position, as seen from above.
    • Reminder: For my PCB designs these inputs do NOT have pullup resistors.
  • LIMIT_SENSE
    • Default Value: OFF
    • Other Values: OFF, ON, ON_PULLUP, ON_PULLDOWN
    • Notes: Limit sense switches can be wired in parallel so that several can be used where any switch closure causes OnStep to stop tracking and slews (allowing for SLEW_RAPID_STOP_DIST.)  This is most often implemented as a panic switch the user can press and/or lever switches on the mount axes.
    • Associated Options:
      • LIMIT_SENSE_STATE
        • Default Value: LOW
        • Other Values: LOW, HIGH
        • Notes: Normally one would use LOW for NO (normally open) switches and HIGH for NC (normally closed) switches.
    • Reminder: For my recent PCB designs this input DOES have a pullup resistor along with a bypass capacitor to provide basic ESD protection.
  • PEC_SENSE
    • Default Value: OFF
    • Other Values: OFF, ON, ON_PULLUP, ON_PULLDOWN, n=0 to 1023 (0 to 3.3V or 5V for Mega2560)
    • Notes: PEC (Periodic Error Correction) Index sense via digital OR analog threshold.  This provides for automatic recovery of the PEC Index without needing to use OnStep's Parking functionality.
    • Associated Options:
      • PEC_SENSE_STATE
        • Default Value: HIGH
        • Other Values: LOW, HIGH
        • Notes: When HIGH the PEC index sense event is triggered by the signal going from a logic low to logic high voltage.  When LOW the PEC index sense event is triggered by the signal going from a logic high to logic low voltage.  Once an sense event has occurred, additional sense events are blocked for 60 seconds to block spurious signals near the trigger threshold.
    • Reminder:
      • Ignored in ALTAZM mode.
      • For my recent PCB designs this input does NOT have a pull-up resistor but DOES have a bypass capacitor (or TVS DA) to provide basic ESD protection.
  • PPS_SENSE
    • Default Value: OFF
    • Other Values: OFF, ON, ON_PULLUP, ON_PULLDOWN
    • Notes: Senses signal rising edge.  A high accuracy PPS (Pulse Per Second) reference helps OnStep improve tracking accuracy.  This is especially important for some Arduino Mega2560 boards where the micro-controller oscillator uses a low accuracy Ceramic Resonator as opposed to a much higher accuracy Crystal.  Most of our custom PCB designs accommodate the DS3231 RTC and have the PPS signal (along with power and I2C comms) on the header for it.
    • Reminder: For my PCB designs this input does NOT have a pull-up resistor.

ST4 INTERFACE

It is up to you to verify the interface meets the electrical specifications of any connected device, use at your own risk.

  • ST4_INTERFACE
    • Default Value: OFF
    • Other Values: OFF, ON, ON_PULLUP
    • Notes: Operation is limited to <= 1x guide rates unless hand control mode is used.
    • Associated Options:ST4_HAND_CONTROL
      • Default Value: OFF
      • Other Values: ON, OFF
      • Notes: Enable for Basic Hand Control (just N,S,E,W buttons) special features and SHC support.
        • After 4 seconds of inactivity the HC will return to normal operation.
        • If a BUZZER is available there will be a beep going into/out-of the Alternate Modes and a click with each button press.
        • Hold [E] + [W] buttons for > 2 seconds for Alternate Mode A:
          • The [E] and [W] buttons adjust the Guide Rate slower or faster.
          • The [N] button turns tracking on and off.
          • The [S] button causes a Sync to occur (or accepts Align.)
        • Hold [N] + [S] buttons for > 2 seconds for Alternate Mode B:
          • The [E] and [W] buttons select objects in the current User Catalog.
          • The [N] button does a Goto to the currently selected object.
          • The [S] button turns sound on/off.
      • Associated Options:ST4_HAND_CONTROL_FOCUSER
        • Default Value: OFF
        • Other Values: OFF, ON
        • Notes: Basic Hand Control Focuser in Alternate Mode B:
          • Hold [N] + [S] buttons for > 2 seconds for Alternate Mode B:
            • The [E] button selects Focuser1.
            • The [W] button selects Focuser2.
            • The [N] button moves the current Focuser in.
            • The [S] button moves the current Focuser out.
    • Reminder:
      • For my PCB designs this input does have pullup resistors.
      • My PCB designs also have an optional shunt to make +5VDC available on pin 1 of the RJ12 modular connector which is required if using an SHC on the ST4 port.
      • De-bounce (responsiveness) on ST4 port pins is 5ms unless hand control mode is ON in which case it is 100ms.