Uploading the Firmware
In order to upload the firmware to your micro-controller, you need to do several tasks.
Install the Arduino IDE
Install the Arduino environment (IDE). Some users have faced issues with version 1.8.6 and 1.8.7. Therefore, it is recommended, for the time being, to stay with 1.8.5.
If you are using a Teensy3.x (3.2, 3.5, or 3.6) be sure to download an Arduino IDE version that's supported by Teensyduino and then install the Teensyduino add-on.
If you are using an STM32F103 board (e.g. the Blue Pill), then you need to install Arduino_STM32. The details on doing so are in the Installation section on the STM32 Wiki page.
Getting the OnStep Firmware
Download the OnStep Beta .zip from GitHub . It is recommended that you stay with the Beta branch. The Alpha branch is also available (Alpha .zip from GitHub) may have more features, but it is in constant flux and not well tested. Only use it if you want to test new features.
Unzip the folder to you PC. This can be on your desktop or in your ~/Documents/Arduino folder.
The directory will be name OnStep-Beta or OnStep-Alpha, depending on the version you downloaded. You must rename the directory to "OnStep", otherwise you will not be able to compile OnStep.
Also, remember there is separate (but related) source code for the ESP8266 Wifi and also Arduino M0 Ethernet servers in the /src/addons directory within your OnStep directory.
Configuring the Firmware
Before you start with the configuration, you should use the spreadsheet to calculate your mount's specific parameters. These are critical in matching OnStep to your hardware. This includes your main gear ratio (GR2), your secondary (transfer) gear ratio (GR1), the full steps per rotation of your stepper motors (Stepper-Steps), and the microsteps (Micro-Steps) of your stepper driver. Pick a MaxRate that results in a goto speed of about 1 degree/second to start with (or even lower if the mechanical design warrants it.)
While it is highly recommended that you follow the procedure below you can instead make use of the online OnStep Configuration Generator (for OnStep version 1.1f or later. Here is a step by step video on how to use it) and skip steps 4 and 5 (instead copy the online configuration generator provided data into the Config.xxx.h file; replacing it's original contents.)
- Open the OnStep folder you downloaded/unzipped from GitHub.
- Double click on OnStep.ino file (inside the OnStep folder.) This opens the project so you can edit the configuration.
- Choose only one Config.xxx.h file that matches your hardware! Instructions for configuration are in that file.
- From the spreadsheet enter the critical parameters: StepsPerDegreeAxis1, StepsPerDegreeAxis2, StepsPerWormRotationAxis1, PECBufferSize, and MaxRate into Config.xxx.h
- Fill in the "AXIS1/2 STEPPER DRIVER CONTROL" section with your AXISn_DRIVER_MODEL and AXISn_MICROSTEPS values. The AXISn_DISABLE HIGH default works with most common stepper drivers except the RAPS128 (LOW.) The AXISn_FAULT option is usually only used with TMC2130 stepper drivers but it can work with others. *** Notice that you can also reverse the direction of movement for each axis (AXISn_REVERSE_ON/OFF) in this section should that be required (and it frequently is.) You'll want to evaluate/correct this, if necessary, once connected and "operational". ***
- You should review all of the other settings in the Config.xxx.h file to be sure they match your hardware. Most of these are optional and OnStep will work reasonably well without changing them from the defaults. One exception to that is the MOUNT_TYPE_XXX parameter near the beginning of the configuration file. This defaults to _GEM but for _ALTAZM or _FORK mounts you'll want to change it now. Take a moment and read through... these are the features OnStep supports and this is an excellent place to learn about them. Each setting has a comment describing it's purpose and available options.
Uploading the Firmware
After you have done the above, proceed with the configuration:
- In the Arduino IDE select the correct serial port and board. For a Teensy3.2 I select 72MHz operation. For any Teensy3.x I select Optimize: "Faster".
- You can now upload the firmware using the button on the Arduino IDE toolbar.