The MaxESP Version 3
If you are looking for information on an earlier version of the MaxESP that page can be found here.
A PDF file with assembly instructions and details can be downloaded here: https://onstep.groups.io/g/main/files/Documents%20and%20Guides/Onstep%20MaxESP3%20Assembly%20Instructions.pdf
A PDF file of a fully annotated schematic can be downloaded here: https://onstep.groups.io/g/main/files/Documents%20and%20Guides/Onstep%20MaxESP3%20PCB%20Schematic%20Anotated.pdf
The image below shows a OnStep telescope controller built on the MaxESP Version 3 PCB. This design uses the ESP32 and offers a good balance of features and performance including the ability to operate the mount and two focusers or a focuser and rotator. It provides internal sockets for a DS3231 RTC and Wifi (or Ethernet.) It also has I/O brought out on a DB9 connector where it's easy wire other devices in, like a PEC sensor and encoders. The MaxPCB2 is more flexible supporting many features without tradeoffs (since they have more pins) but the ESP32 has a few capabilities of its own, like support for Bluetooth built-in.
The case this Max series PCB is designed to fit is here: Aluminum Enclosure Electronic DIY PCB Instrument Project Box Case(120x97x40mm). The included case flat end panels can be prepared with very careful drilling, cutting, and filing to provide openings for the various connectors. Better, if a 3D printer is available the panels can be printed with little time or effort from these design files.
The very affordable EasyEDA service can be used to order this version of the PCB (or obtain the Gerbers.) You can see a comparison of micro-controller features here (again, this is an ESP32.) The BOM with most required components is present in the EasyEDA schematic, however, here in the US one can use this Mouser.com project to order. That gets you most everything except the Teensy, stepper drivers, and 0.1" pin and socket headers, these can be obtained Amazon, eBay, etc.
*** If using an MaxESP3 be sure the ESP32S you purchase has matching pin order (check silk screens match) and pin width (0.9".) Unfortunately the vendor I used is now gone from eBay. There are others options that appear to be correct and I've looked over this ESP32S and would say it's a very good bet to work. ***
Whatever you build use an appropriate DC rated fuse (current rating depends on stepper drivers/motors/etc.)
This is a MaxESP3 configured with the DS3231 RTC, BME280, and Wifi modules. A pair of TMC5160 stepper drivers are in the Axis1/2 sockets while the Focuser/Rotator sockets have DRV8825 stepper drivers.
Features:
- This controller was designed to be a compact and elegant goto controller with support for the most desirable secondary features available in OnStep.
- Performance: The MaxESP3 supports the ESP32S micro-controller. The ESP32S has very good performance.
- Non-volatile memory/EEPROM: Built-in, no external device required. The ESP32S has 4KB (by flash memory emulation) which is enough for user catalog storage.
- Fairly easy OnStep firmware upload compared to some other options.
- Easier WiFi firmware upload/update, the WeMos D1 Mini ESP8266 has a builtin micro-usb to plug into (just unplug the module from the PCB first!)
- Back connections:
- A pair of jacks to the RA/Dec or Alt/Azm stepper motors.
- A pair of jacks to the focuser/rotator stepper motors.
- A 1/8" mini stereo jack for Limit Sense and Illuminated Reticle connections.
- Front connections:
- Micro-USB port provides a USB virtual serial port interface for connection from a PC.
- Industry standard RJ12 jack ST4 interface with optional 5V power on pin 1. This supports the BHC and SHC but it is up to you to verify the compatibility of any other device attached (camera guide port, etc.)
- A D-SUB 9-pin jack (DB9.) This has connections for the PEC index signal, encoders, and home switches (or I2C instead so this can accept an BME280 I2C weather sensor.) There are screw terminal DB9 plugs to simplify hookup of these devices.
- Coaxial DC power jack, 24V 5A rated.
- Internal connections:
- The I2C bus pass-through is available on the DS3231 RTC module.
- Bluetooth support is built into the ESP32S.
- Protection
- Basic I/O ESD protection with capacitors and resistors where practical.
General Notes:
*** Its up to you to understand the design, connection, limitations, and use of this device and it's components, I accept no responsibility. ***
You should read this entire page and review the EasyEDA design and BOM before starting the build...
Design Notes:
- Voltage and Current Handling: Trace widths are sufficient for 3A (3 Amps) of current to the stepper drivers. Most 0.1" pin-headers are 3A rated. The Molex KK are 4A rated. Current/voltage ratings of all components should be followed also. The power jack in the BOM is rated at 5A and 24VDC, I use a 2A fuse (the fuse is 32VDC rated.)
- Components Sources: I often use Mouser.com and the exact components (where available) are listed in the EasyEDA bill-of-material. Since EasyEDA doesn't always show full BOM details you may need to open the schematic and select the BOM from the toolbar to see full details. Some components like resistors and capacitors are available in kits with a variety of values for relatively low cost from eBay, Amazon, etc. I would not expect the quality of those to be in the same class as a respectable brand sourced from Mouser.com or Digikey or Farnell. This can be especially important for electrolytic capacitors.
- Generic Components: Some components, such as resistors, are generic so feel free to pick a 1/8 watt or 0.1 watt metal film or carbon resistor of approximately the same value I used, give or take even 50% of the value is ok in all cases. LED's will be brighter or dimmer depending on their associated resistor value so feel free to experiment (within the limits of the LED) before soldering those in if you like. You could even buy a resistor kit for future projects and have all common values on-hand they don't cost much.
- Polarity: Many components have polarity markings. The resistor networks (like RP1) have a dot on the pin 1 end which matches with the small box on the PCB silk-screen. The electrolytic capacitors have the negative side clearly marked, that goes near the wide marking inside the circle on the silk-screen (the + is also present on the other side.) For LED's the short lead is the cathode (-) and that goes on the flat side of the silk-screen circle. Other components have a silkscreen that matches up with their appearance, the diodes and voltage regulators for example. Finally, be careful to plug in the modules correctly also! (microcontroller, stepper drivers, etc.)
- Power Header: The J1 power switch connection should be a Molex KK as specified or directly soldered leads from a switch. Since the case doesn't really have room for a switch I simply add a shunt to short these contacts so the board powers up when plugged.
- Alternate Stepper Driver Output Connections: There's 3.5mm spaced pads at Axis1/2 stepper driver outputs for decent size screw down terminal blocks (AMP 1776275-4 for example) or soldering leads from DIN (etc.) jacks directly should that be favored over the RJ45 motor connections. This may be helpful in applications driving stepper motors requiring higher power levels or where you anticipate heavy use/harsh conditions. The Axis3/4 stepper driver outputs (for focuser or rotator) have similar provision for 2.54mm screw down terminals (Phoenix Contact 172672 for example) too.
- Case Height: If building into the case (and panels) this was designed for it is required that the microcontroller use standard 0.1" break-away pin and socket headers.
- Breakaway Pin and Socket Headers: These breakaway pin headers (both types) are available on eBay, Amazon, etc. The pin headers can be broken off to any length you need by hand (best with needle nose pliers though.) The standard socket headers often don't come in the correct length (or are cheaper to buy in standard sizes) so they take more effort to size. A jewelers file kit usually has a little triangular file that can score the plastic to snap them off where you need. I use an X-ACTO razor saw but the concept is the same. Another file can be used to trim up the end so the extra ragged plastic doesn't interfere (like it will at the stepper driver sockets if not filed down to the correct size.) I use a little bench grinder.
- Tip:
- When sizing the socket headers for the stepper drivers the spacing tolerances are tight so check them carefully to be sure you have a good fit with all installed before soldering. I like to purchase 8 position sockets to avoid this. You do get 4x 8-position with a WeMos D1 Mini Pro Kit too though.
Power:
The MaxESP3 should be powered from the motor supply. A switching regulator provides 5V DC to the micro-controller, etc. This has an input voltage range of 15V to 36VDC (other components limit us to 24VDC however.) You can also omit the 12V regulator and bridge the pads as indicated on the silkscreen (with a jumper wire) to allow operation in the 7 to 15VDC range instead. The stepper drivers you choose will have a voltage ratings which must also be considered.
- The power switch header: There is a 2-pin power switch header labeled "J1", this header's pins must be connected together for the PCB to power up. A switch is not normally used for this build so a shunt should be placed over the pins.
USB:
The MaxESP3 makes use of the ESP32's Micro-USB port. Since power can be brought into the MaxESP3 via. this USB port there are motor supply protection diodes for TMCxxxx drivers included in this design. Those diodes (on the PCB bottom under the stepper drivers) are specified as SMT parts. If soldering those is a concern a similarly spec'd diode with leads (one with low voltage drop and sufficient current handling) can be substituted since the PCB is designed with through holes and SMT pads.
Choice of Stepper driver:
- Axis1/2 (RA/Dec or Azm/Alt):
- SilentStepStick TMC2130 or TMC5160 (read about these drivers before buying!) are the most advanced stepper drivers supported (operating in SPI mode) and are the recommended drivers. Many options are available with these, see OnStep's configuration file. For the TMC5160 usually no heat-sink is required. For the TMC2130 use heat-sink shims (two aluminum bars 5/16" x 5/16" x 1-5/8" and 3/8" x 3/8" x 1-5/8" stacked to reach the case top they are held in place with electrically insulating heat-sink adhesive tape and have heat-sink compound between them.) To adjust Vref or access the drivers after the shim is in place you must gently pry the edge of the heat-sink shim up while holding the stepper drivers down. It helps if the controller was recently on and/or the shim is warmed up a bit to release the tape.
- Many other drivers can work too but you'll have to devise your own aluminum shim or use the factory heat-sinks, there's a summary here.
- Tip:
- SSS TMC2130/TMC5160 status and error detection feature is optional, you must shunt the Aux2 selection AX1&2 MISO to allow its use ("T" shaped pins near the DS3231 and WeMos D1 Mini that also allow selection of ESP8266 RST control or Focuser1 enable AXIS4 EN control instead.)
- Usually the maximum current for a pair of TMC2130 stepper drivers in this design is 1.5A peak which is 1.06A RMS, however the exact limit will depend on the stepper motors, power supply voltage, typical ambient temperatures, etc.
- The Axis1 and Axis2 ENable control line is also shared between the drivers. For this reason you can't use the AXIS2_AUTO_POWER_DOWN_ON option (to save power.). You can use the power saving options available on the SSS TMC2130/TMC5160 to achieve a similar effect though.
- SSS TMC2130/TMC5160 status and error detection feature is optional, you must shunt the Aux2 selection AX1&2 MISO to allow its use ("T" shaped pins near the DS3231 and WeMos D1 Mini that also allow selection of ESP8266 RST control or Focuser1 enable AXIS4 EN control instead.)
- Axis3/4 (Focusers and/or Rotator):
- The SilentStepStick TMC2100 is the preferred driver for these sockets. Any available micro-step/decay mode can be selected using the jumpers described above. They also support automatic stand-still power reduction (if the ENable pin is left floating/OPEN.) Alternatively there are TMC2130 drivers designed for stand alone operation, termed "DIY", which should in theory behave just like TMC2100's but I have not tested those.
- The A4988, DRV8825 are great options as well due to their very low cost and especially for tin-can stepper motors there is often no advantage to using a more advanced stepper driver. Seems some LV8729's have issues with the floating enable design (see below) so stay away from those in these sockets.
- Tip:
- Focuser1 enable pin control is optional, you must shunt the Aux2 selection AXIS4 EN to allow its use ("T" shaped pins near the DS3231 and WeMos D1 Mini that also allow selection of AX1&2 MISO control or ESP8266 RST control instead.) If AXIS4_EN is not used the Focuser1 enable pin is N/C ("open".)
- Rotator or Focuser2 AXIS3 has no ENable pin control so is N/C ("open" only.)
- The stepper driver/motor supply for this section is regulated at 12V and can supply up to 1A continuous. I recommend staying at or under 0.75A to leave some margin in use. How much current should be supplied depends on the stepper motor and application and this limit. To figure out if it's ok to simply set Vref to give the full current for the stepper motor make sure the power P=IV (current * voltage) is <= 4.2 watts. For a NEMA17 3.9V 1.5A motor that's 5.8 watts, so a bit too much, but feel free to reduce the current to a level that can be handled and use that (or less) as a basis (1.0A) for the Vref setting instead. Setting Vref is covered here.
- These stepper drivers operate in a fixed micro-step mode selected on the 3x 3 pin headers under to each stepper driver.
- Each header has pins labeled with M0, M1, and M2 (as they are called for a DRV8825 but named otherwise depending on the stepper driver.) Other pins on the headers are labeled "G" or "3V3". So, placing a jumper (shunt) between M0 and the 3V3 row will pull the M0 pin HIGH. Placing a jumper between M0 and the G row (if present) will pull the pin LOW. Omitting the jumper will leave the pin floating OPEN.
- Each header has pins labeled with M0, M1, and M2 (as they are called for a DRV8825 but named otherwise depending on the stepper driver.) Other pins on the headers are labeled "G" or "3V3". So, placing a jumper (shunt) between M0 and the 3V3 row will pull the M0 pin HIGH. Placing a jumper between M0 and the G row (if present) will pull the pin LOW. Omitting the jumper will leave the pin floating OPEN.
- Normally these drivers use lower power levels and so no heat-sink is required but the small ones usually included with various Step Stick drivers fits within the case without issue.
- Focuser1 enable pin control is optional, you must shunt the Aux2 selection AXIS4 EN to allow its use ("T" shaped pins near the DS3231 and WeMos D1 Mini that also allow selection of AX1&2 MISO control or ESP8266 RST control instead.) If AXIS4_EN is not used the Focuser1 enable pin is N/C ("open".)
- The SilentStepStick TMC2100 is the preferred driver for these sockets. Any available micro-step/decay mode can be selected using the jumpers described above. They also support automatic stand-still power reduction (if the ENable pin is left floating/OPEN.) Alternatively there are TMC2130 drivers designed for stand alone operation, termed "DIY", which should in theory behave just like TMC2100's but I have not tested those.
*** always follow the safety instructions when working with heat-sink compound ***
*** warning: never plug in or remove the stepper motor cables while powered up ***
ST4 interface:
The ST4 interface is automatically setup for operation on the correct pins by the configuration file. You simply have to turn the option on. If the hand-control option is used additional capabilities become available, read the configuration file for more information. The 2k resistor network RP1 is for pulling up the ST4 lines to +3.3V and offers better noise immunity than the weak built-in pull-up resistors of the micro-controller. There is also a pin header near the ST4's RJ12 modular jack labeled "ST4 +5V" (J12) where a shunt can be installed to place 5VDC on pin 1 of the jack (required if using a Smart Hand Controller.) It is up to you to confirm the electrical compatibility of anything you plug into this port.
Hardware SPI interface:
Not supported. Note: This is separate from the SPI interface used for the TMC2130/TMC5160 stepper drivers.
Bluetooth:
There is built-in Bluetooth on the ESP32S micro-controller. This interface can be configured using the settings for SerialC in OnStep's Config.h file.
WiFi, Ethernet:
There is one WeMos D1 Mini footprint socket that uses SerialB (at Serial2 and active by default in OnStep) and any of the following can plug in. This design uses the main serial port at WeMos D1 Mini pins labeled RX and TX.
For the WiFi and Ethernet devices follow these instructions to upload firmware.
- WiFi uses either an ESP8266 WeMos D1 Mini or ESP32 WeMos D1 Mini (a "TTGO T7 V1.3" for example.) A device with provision for external antenna is recommended, if using the standard aluminum case, i.e. a WeMos D1 Mini Pro.
- Ethernet uses a Teensy3.2, W5500 module, and a custom PCB. Once this module is assembled it plugs right into the WeMos D1 Mini socket and positions the Ethernet jack at the case edge where a cutout can be made to allow access to the RJ45 connector.
- Tips:
- The WeMos D1 Mini Pro needs to have a "0 Ohm" SMT resistor moved (soldered in alternate position) to disable the on-board antenna and enable external antenna connection. This is a delicate process and requires moderate soldering skill. I moved the resistor first to see how difficult that was, then removed it and bridged the correct SMT pads with solder (0 ohm so either way is fine.) You can see info. about this process here.
DS3231 RTC (and I2C):
This optional module provides the date/time and a PPS signal (using Aux7) if desired. Enabling the DS3231 RTC also enables the ESP32 I2C bus and overrides Home SW support since I2C is on the same Aux3/4 pins. Since Aux3/4 (SDA/SCL) along with power/ground are available on the DB9 connector it is then possible to attach other supported I2C devices outside the MaxESP3 case via the DB9 connector. This is desirable since one supported device that really matters is the BME280 which measures temperature, pressure, humidity and should be well outside the case for accurate measurements.
Misc. I/O:
There are pins designated Aux7 and Aux8 which can be used to support a single feature on each. They are also brought out on the 3.5mm mini stereo jack to the right of the stepper driver jacks should you want external access to them. The jack's collar is Gnd, its ring (middle, Aux7) is often used for Limit Sense, and its tip (Aux8) is often used for the Illuminated Reticle.
Aux7 is an input only pin and can be used for the following (selected by positioning a shunt on the appropriate labeled pins under the DS3231 RTC module:)
- Limit Sense - A switch (or series of switches wired in parallel) can close pulling the limit sense LOW to stop any slew and tracking. The Limit Sense input is protected against ESD with a 0.1uF capacitor and a reasonably strong 2K pull-up resistor. This can be physical limit switches and/or an emergency stop button.
- PPS - from the DS3231 RTC. Pulse per second provides OnStep with an more accurate clock source for precision timing of steps.
Aux8 is an input or output pin and can be used for one of the following:
- Status LED - the PCB is equipped with a single status LED. Not an recommended option, omit the LED unless in use.
- Status LED2 - the PCB is equipped with a single status LED. Not an recommended option, omit the LED unless in use.
- Buzzer - the PCB is equipped with a buzzer for audible alerts. This is enabled by placing a shunt on the appropriate labeled pins under the WeMos D1 Mini.
- Reticle - typically this would be attached by plugging into the mini stereo jack. If using this to directly drive an LED be sure to add a resistor in series to limit the current.
- OneWire - supports DS2413 (dual GPIO) and DS18B20 (temperature.) Allows for temperature compensated focusing, dew heater control, intervalometer, etc. Typically this would be attached by plugging into the mini stereo jack.
A DB9 Connector (D sub-miniature 9-pin) provides connections for:
Pin 1: Ground
Pin 2: Vsel (3.3V or 5V according to the shunt position labeled "VSEL" near the DB9 connector, J9)
Pin 3: Encoder 1B, encoder input going to the WeMos D1 Mini (pulled up or down according to the shunt position labeled "ENC PULL" between the DB9 and WeMos D1 Mini, J10)
Pin 4: Encoder 2B, encoder input going to the WeMos D1 Mini (as above, shunt position "ENC PULL")
Pin 5: PEC
Pin 6: Aux3, typically used for a Home SW on RA or Azm but can be used any purpose (dew heater for instance, on/off switch, etc.) If I2C is used this is SDA instead.
Pin 7: Aux4, typically used for a Home SW on Dec or Alt but can be used any purpose (dew heater for instance, on/off switch, etc.) If I2C is used this is SCL instead.
Pin 8: Encoder 1A, encoder input going to the WeMos D1 Mini (as above, shunt position "ENC PULL")
Pin 9: Encoder 2A, encoder input going to the WeMos D1 Mini (as above, shunt position "ENC PULL")
- The shunt position labeled "VSEL" also controls the pull-up voltage (if shunt position "ENC PULL" is set for pull-up) for Encoder pins 3,4,8,9.
- Tips:
- The Vsel shunt must be set to 3.3V or 5V, not omitted!
- Signals from PEC, AUX3, and AUX4 travel to the main MCU.
- The ESP32 is NOT 5V tolerant.
- Signals from the Encoder pins travel to the WeMos D1 Mini (ESP8266.)
- The ESP8266 pins are not 5V tolerant (there was a time a year or three back when most everyone thought its pins were 5V tolerant and we have a long history of using it like it is.)
*** the DA112S1 SMT diode array provides ESD protection on the DB9 signal lines and is an optional and experimental component I omit from my builds although I get the impression it works properly from other users. ***
*** warning: never plug in or remove the Limit SW/Reticule or DB9 Connector or Serial cables while powered up ***