A collection of tips and how to's that are spread around the blog.
Let's build the MaxESP3
[Scroll down for MiniPBC2 Assembly]
OK, I got a little ahead of you and placed the resistors and junction pins.
Next let's place the caps.
On underside of the board are are the S310FA Schottky diodes. They are surface mount devices. If you prefer legged axial SB3100 diodes can be used in the holes provided. To reduce congestion under the RTC module I placed the AUX7 junction on the underside. Check with you enclosure to see if this fits. Maybe an external switch is in order?
Time for the female headers. I use an old driver to keep things aligned. When soldering the headers keep them close to the surface of the PCB there is not a lot of clearance in the metal enclosure.
Done with the driver headers, now do those for the ESP32 devboard, RTC and D1 mini wifi if they are to be used.
Time for the outputs; 2 RJ-45, 2 - 4 screw terminals and one mini phone jack. Might as well place the fuse while we're here.
Now on to the other end of the board. Place the RJ-12, the DE-9 connectors and the 5V power regulator.
Last is the 12V power regulator. The is only required if you plan to use a power supply rated at more than 15V. The regulator requires at least that much to put out 12V. Otherwise just jump the header pins for Vin and Vout.
The following is extracted from https://onstep.groups.io/g/main/wiki/3915
It includes instructions for uploading and configuring the OnStep firmware to the finished MaxESP3 controller;
Uploading the Firmware
In order to upload the firmware to your micro-controller, you need to complete several tasks.
Install and configure the Arduino IDE
Install the Arduino environment (IDE). The recent versions seem to be consistently reliable so download the latest (supported by Teensyduino if that's required) but not the "Windows app" version.
From the Arduino IDE:
If you will be using the ESP8266 to run the Smart Web Server (for WiFi) now is a good time to add support for that:
Select File>Preferences "Additional Boards Manager URLs" and add: http://arduino.esp8266.com/stable/package_esp8266com_index.json
Install support to your PC for this board from within the menu Tools>Board>Boards Manager.
Use ESP8266 version 2.4.2 (2.7.4 is also thought to be ok)
If you are using the ESP32 to run OnStep (or to run the Smart Hand Controller or Smart Web Server): Select File>Preferences "Additional Boards Manager URLs" and add: https://dl.espressif.com/dl/package_esp32_index.json
Install support to your PC for this board from within the menu Tools>Board>Boards Manager.
Use ESP32 version 1.0.4 only
Tip: Where more than one "Additional Boards Manager URLs" are present use a comma "," between the URLs.
Getting the OnStep Firmware
Unless the Wiki instructions for your particular board states otherwise, it is recommended that you use the latest OnStep release. Follow this link to GitHub and select the "Code" button, and choose "Download ZIP"
Unzip the folder to your PC. This can be on your desktop or in your ~/Documents/Arduino folder.
The directory will be named "OnStep-release-X.XX". You must rename the directory to "OnStep", otherwise you will not be able to compile properly. Double clicking on "OnStep.ino" will then open OnStep in the Arduino IDE (if everything is installed correctly.)
Also, remember there is separate (but related) source code for the Smart Hand Controller (SHC) and WiFi and Ethernet servers in the /src/addons directory within your OnStep directory. However, the Smart Web Server (SWS) is rapidly becoming a proven superior alternative to the WiFi and Ethernet Addons and I encourage its use.
Getting the Additional Libraries
There are several additional Arduino libraries that OnStep might need depending on the Config.h options enabled.
Download and unzip the IDE archive contents in your ~/Documents/Arduino/libraries folder to add support for any of these if needed.
The Makuna DS3231 and DS3234 RTC Library - https://github.com/Makuna/Rtc/archive/master.zip
The Arduiniana TinyGPS++ Library - http://arduiniana.org/libraries/tinygpsplus/
The Adafruit Sensor Library (for the BMP280/BME280/etc.) - https://github.com/adafruit/Adafruit_Sensor/tree/ab724dd4d8d97a8e34a1da07914781be50aa1089
The Adafruit BME280 Library - https://github.com/adafruit/Adafruit_BME280_Library/tree/156a0537d6b21aaab1d1f104a7001a38ca1ffce3
The Adafruit BMP280 Library - https://github.com/adafruit/Adafruit_BMP280_Library
The OneWire Library - https://github.com/hjd1964/OneWire
The DS18B20 Library - https://github.com/hjd1964/Arduino-Temperature-Control-Library
Tip: This is not a complete list but these are the most commonly used libraries.
When compiling if a required library is not present, the compiler will throw an error and show the line of code where that error happened. That line of code will always have a comment showing where to download the library.
Some libraries are available in the Arduino IDE for automatic download and install with the Sketch->Include Library->Manage Libraries... menu option. Sometimes this can lead to trouble as specific library versions are in some cases required and/or not present.
Preliminary Firmware Configuration
Before you start with the configuration, you should use the Configuration Calculator spreadsheet to calculate your mount's specific parameters.
Instead of editing the Config.h file manually, you can use the web based Online Configuration Generator to get a basic working configuration fast.
The values from the spreadsheet are critical in matching OnStep to your hardware. This includes your final stage gear ratio (GR2), your secondary (transfer) gear ratio (GR1), the full steps per rotation of your stepper motors and how many microsteps each motor full step is divided up into by your stepper driver. By default OnStep will operate at 1 degree/second slew speed. If the mechanical design warrants it feel free to adjust the SLEW_RATE_BASE_DESIRED and/or the runtime slew rate controls up or down as required to determine what the best SLEW_RATE_BASE_DESIRED is for your hardware.
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 and upload the software.
Select the tab for the Config.h file, Instructions for configuration are in that file. You may also take a look at the Wiki Configuration page.
Near the top enter the selection for the MaxESP3 PINMAP replacing OFF. A little further down is the MOUNT_TYPE parameter. This defaults to GEM but for ALTAZM or FORK mounts you'll want to change it now.
The AXIS1 RA/AZM section is next, enter the parameters from the spreadsheet:
AXIS1_STEPS_PER_DEGREE, AXIS1_STEPS_PER_WORMROT. Also, usually AXIS1_DRIVER_MODEL gets set to the type of stepper driver you're using (Config.h lists the types) and set AXIS1_DRIVER_MICROSTEPS to match the microstep mode you chose in the spreadsheet.
The AXIS2 DEC/ALT section follows, enter the parameters from the spreadsheet:
AXIS2_STEPS_PER_DEGREE. Also, usually AXIS2_DRIVER_MODEL gets set to the type of stepper driver you're using (Config.h lists the types) and set AXIS2_DRIVER_MICROSTEPS to match the microstep mode you chose in the spreadsheet.
*** Notice you can also reverse the direction of movement for each axis in this section using AXISn_DRIVER_REVERSE 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.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. 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 its purpose and available options. Each section has a comment with a link to an online Wiki page with an expanded description of each setting.
Uploading the Firmware
After you have done the above, proceed with the configuration. These are basic "generic" instructions for flashing a wide variety of OnStep hardware review the board's Wiki page for more specific instructions, if present:
In the Arduino IDE Tools menu select the correct board and port. For the most part boards can be easily found by name but a few are tricky:
The ESP32 comes in many types. Use the ESP32 Arduino Board manager and the ESP32 Dev Module from the flyout menu. Using its default settings generally seems to work for the variants we use. The Boot button on the module may need to be pressed for > 2 seconds to allow firmware upload. Note, this shouldn't be needed with a MaxESP3 or MiniESP3 if flahed while mounted on their PCBs, or the D1/R32.
Verifying That OnStep Is Working
Once the upload of the firmware is complete, you should verify that OnStep is running on your board.
To do this, open Serial Monitor in the Arduino IDE, set the baud to 9600, connect the USB to your computer, then enter the following command: :GVP#
If you get a response like this: On-Step#
Then OnStep is working as intended on your board, and responding to commands.
Well, about 70 MiniPCBv2 kits have gone out the door and very little seems to be happening at Alibaba's facility in San Bruno, CA where my orders go to die, so I thought that I should at least put up some information on the Mini kit.
Here's one laid out for assembly.
So let's build it!
I like to start like Steve Schwartz does with the smaller parts first. Not only can it be difficult to do it when space gets tighter, the smaller parts are generally of lower height, which helps keeping them seated until soldered.
Here I've placed the 6 ceramic capacitors (5 - 104 & 1 - 33). The 0.33µF is C5 2nd from the top at the right. All the others are 104s.
Only one diode D5. Note the polarity! Just 5 resistors. RP1 (on left just below Teensy) is the one to watch. On one side is inscribed • 2221. The pin under the • is positioned furthest to the left. The Axial resistors have no such polarities, but the do have values.
As you place these components spread the legs a bit to keep them in place when you turn over the board.
You want to leave a lump of solder that looks a bit like a Hersey Kiss. When you inspect the top of the board you should see that solder has wicked up through the via. Remember the heat of the iron will draw the solder to it.
Now place the electrolytic caps. Polarity again! These caps have a positive and negative pin. The poles are indicated on the PCB by a "+". There is a vertical band on the cap with "-" signs on to show the negative pin. The negative pole or ground is indicated by a white finger nail in the cap symbol.
Let's get into power with the voltage regulator. I've made a running change in the parts in the MiniPCBv2. The HW-813 has DC-DC power converter has caused some confusion and problems. It was intended as a replacement for the BOM's OKI78SR5/1.5W36C. The OKI part is about $6 delivered. The HW-813 was under a buck.
I've replaced it with the MP1584EN DC-DC power converter, which is a design very similar to the OKI. The MP1584EN is preset at 5V output. No traces have to be cut or is any bridging necessary as was the case with the HW-613. It is shipped with the pins installed. It costs a little more than a buck.
Now the power jack, fuse holder & switch header (1), a 2 pin length of male header.
The jack (3) is of the "M" coaxial type 5.5mm barrel and 2.2mm center pin. The fuse holder takes the "Micro" blade type. Use either a 2 or 3 amp.
Above the jack and fuse is the ST-4 port. This port is for the use of an autoguider, the Smart Hand Controller or the Not-So-Smart Hand Controller or as they like to call them in PW world, human interface devices. There are two parts involved here, the RJ-12 jack and a 2 pin length of male header.
The two pin header is jumped only when whatever is connected to the port needs 5V power. A shunt is used to close the circuit in that case.
Time for the female headers. These are a bit of pain to keep in place while soldering. I use a trick. After I've soldered another component there will usually be drop on solder on the tip of the iron. Rather that wiping it off I place it over one of the end female header holes. It's not enough to fill the hole, just enough to tack the header in place.
The header's pins are lined up in their holes and it and the PCB are held in place by your finger and thumb while the iron heats the solder. When the solder melts the pin will fall in place and should stay there while the board is put on the bench to solder the rest of the pins. Before soldering the header check that it's fairly perpendicular to the plane of the PCB. A light touch with the iron on end pin can ease a little adjustment. Solder at least one other pin to fully secure the header before fully soldering the end pin. Note the light dab of solder at the end pin of the header holes on the left.
With that out of the way we can solder the semiconductors to their male headers. Start by inserting the male pins into the female headers. Then position the module on the pins. A little adjustment of the headers may be needed to line everything up. Careful with the Teensy it can sit with the pins out of position.
Now there are some decisions to make. At the end of the PCB opposite the ST-4 port are four additional ports for the step motor, PEC, limit sense, and illuminated reticle connections. The kit includes connectors for these connections, however there are other hook ups to consider. For PEC, limit sense and the reticle you can use the mini phone jack connectors provided or run wires to another type. For the step motors RJ-45 8P/8C jacks are provided.
The idea behind the jacks is to use Ethernet patch cables. As the conductors used in these cables are quite small two of each are used to for each pole of the step motor. And that is certainly an option. In my experience connectors should be avoided if there is an option to use solder. And if mechanical connectors are to be used then modular telephone connectors aren't my first choice. Now some motors come with fairly nice cables with connectors for male headers as on the right below. These are fine for a while but over time they can loosen and lose continuity. The Dupont type can be removed from their shell and soldered in place. I use hot melt glue or shrink tubing for insulation.
On the left are another option, screw terminals.
If you'd rather use one of these options let me know and I can substitute them for the RJs.
What's left? Well there's the three LEDs, Status 1 through 3. 1 and 2 are power and tracking. #3 has something to do with limit sense? Positioning the LEDs really is going to vary with your enclosure design. Power and tracking are next to the ST-4 jack and can be soldered with their legs in most cases. The longer leg is the anode and goes in the through hole on the right when viewed as below.
Lastly is the power switch. solder the switch lead to the switch and when ready feed it in through its hole in the enclosure and connect it to its header. There is no reason that you can't just use a shunt on the switch header and use the power jack to control power.
That's it for assembly. Hope it helps.
The foregoing extraction from https://onstep.groups.io/g/main/wiki/3915 instructions for uploading and configuring the OnStep firmware to the finished MiniPCB2 controller. The only difference is that the Teensy MCU has its own Board Manager; Teensyduino.