The MaxPCB and MaxESP Version 2
If you are looking for information on an earlier version of the MaxPCB that page can be found here.
The image below shows OnStep telescope controllers built on the MaxPCB Version 2 and MaxESP Version 2 PCB (open link and scroll down to see the bill-of-material.). Both are quite similar in features and so are covered together below. The MaxESP uses the more widely available/cheaper Node32s ESP32 micro-controller but be aware that it has limitations and more complex software and hardware configuration requirements relative to the MaxPCB2. You can see a comparison of features here. The very affordable EasyEDA service can be used to order either PCB (or obtain the Gerbers.) These PCBs are designed to fit inside the same commonly available aluminum case. Though the case flat end caps will need very careful need drilling, cutting, and filing to provide openings for the various connectors. If a 3D printer is available plastic end caps for the MaxPCB and MaxESP can be printed in little time or effort. This is the case the MaxPCB/MaxESP Version 2 is designed to fit: Aluminum Enclosure Electronic DIY PCB Instrument Project Box Case(120x97x40mm)
OnStep can use different "pin maps" and these PCBs were designed for the Config.MaxPCB.h or Config.MaxESP2.h wiring.
*** If using an MaxESP2 be sure to compile using the Config.MaxESP2.h configuration NOT Config.MaxESP.h ***
*** If using an MaxESP2 be sure the NodeMCU ESP32S you purchase has matching pin order (check silk screens match) and pin width (0.9".) ***
Whatever you build use an appropriate DC rated fuse (current rating depends on stepper drivers/motors/etc.)
The MaxESP is shown on the left, this is a minimum configuration with no RTC or Wifi (it still needs the micro-usb cable run from the ESP32S to the USB-B connector.) This also has the lower (5/16" x 5/16" aluminum) heat-sink block attached to the main stepper drivers.
The MaxPCB is shown to the right, all options, fully assembled.
OnStep Max notes for Rev. 2.x PCB:
*** Its up to you to understand the design, connection, limitations, and use of this device and it's components, I accept no responsibility. ***
The latest OnStep using Config.MaxPCB.h or Config.MaxESP2.h is required.
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 3A fuse (the fuse is 32VDC rated.)
I source most of my components from Mouser.com and again the exact components used are listed in the EasyEDA BOM (bill-of-material.)
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.
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.
There's 3.5mm spaced pads at each Axis1/2 stepper driver output for decent size screw down terminal blocks should that be favored over the RJ45 motor connections, as in applications driving stepper motors requiring higher power levels.
If building into the case this was designed for it is required that the Teensy3.5/3.6 and the Axis1/2 Stepper Drivers use standard 0.1" break-away pin and socket headers. The Axis1/2 Stepper Driver socket headers must be soldered down with care to be sure they are flush with the PCB surfaces (stepper driver and PCB!)
These breakaway pin headers 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 socket headers take more effort though. 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 xacto 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.
The OnStep Max 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 12VDC 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.
The MaxESP provides access to the ESP32S USB interface on a full-sized USB-B connector. The nearby header J6 has D-, D+, and +5V pins. These pins provide a data and +5V power connection between the PC and the ESP32S. To make this connection use a cut-off (straight) micro USB cable plugged into the ESP32S with the D-, D+, +5V leads terminated in a 3-position Molex KK. Plug this into the Max ESP USB header's corresponding pins. The ground connection is brought through on PCB traces so that wire in the USB cable can be cut-off and left disconnected.
Note: Since power, +5V, must be brought to the ESP32S for its USB interface to function the MaxESP (version 2.2 and later) has a diode in the main (Axis1/2) stepper driver section to make sure Vmot always comes up if Vio is present to protect SilentStepStick type stepper drivers.
***the MaxESP (version 2.0 and 2.1) do NOT include the Vio/Vmot diode and must use "silent step stick protectors" to do the same (as required.) These earlier versions also do NOT have provision to bring power to the NodeMCU ESP32S and may require some additional soldering/drilling to make the connection on the PCB bottom and bring a wire through***
The MaxPCB makes use of the Teensy3.5/3.6's Micro-USB port. To eliminate the possibility of powering the MaxPCB from the USB connection V+ (5V) power, the Teensy has a trace that should be cut. You can see where the trace is on this page labeled "cut to separate VIN from VUSB".
***never use the Teensy3.5/3.6's micro USB connector to feed power into the Teensy and MaxPCB***
Choice of Stepper driver:
- Axis1/2 (RA/Dec or Azm/Alt):
- SilentStepStick TMC2130 (read about the TMC2130 before buying!) is the most advanced stepper driver supported (operates in SPI mode.) Many options are available with these drivers, see OnStep's configuration file. This is the "officially supported" driver for the kit I supply and the heat-sink shims fit this driver only (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.)
- S109. Only goes to 32X micro-stepping but offers much better current handling.
- The usual inexpensive options can work well too, the DRV8825, A4988, LV8729. With the LV8729 probably being the best of these.
- Usually the maximum Vref for a pair of TMC2130 stepper drivers in this OnStep Max design is 1.5V (1.5A peak current which is 1.06A RMS,) however the exact limit will depend on the stepper motors, power supply voltage, typical ambient temperatures, etc.
- MaxESP/ESP32 Tip:
- The RA/Azm and Dec/Alt stepper driver sockets now fully support the SSS TMC2130 (including driver error detection.) They use a shared SPI bus (pins M0,M1,M3/M4) and for this reason other stepper drivers will have limitations if used in the sockets. For a S109, DRV8825, etc. you will be able to select only one micro-step mode (from any available) that applies to both drivers (Axis1 and Axis2) except for what the M2 control line allows. Here are some examples...
- S109: both the same (any mode) or 32X & 16X or 8X & 2X or 4X & 2X
- DRV8825: both the same (any mode) or 32X & 16X or 8X & 4X or 2X & 1X
- LV8729: both the same (any mode) or 128X & 64X or 32X & 16X or 8X & 4X or 2X & 1X
- 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) with the MaxESP2. You can use the power saving options available on the SSS TMC2130 though.
- *** MaxESP2 only: Some stepper drivers present a logic HIGH signal on M3 at startup which causes flash memory to operate at the wrong voltage and hence a failure to boot. Check the stepper driver specifications, and if safe, remove (cut off) the corresponding stepper driver pins to prevent this. ***
- *** MaxESP2 (version 2.0) only: Requires that the trace between pins labeled M3 and M4 on the Axis1/2 stepper drivers be cut to support some (other than TMC2130 etc.) stepper drivers since this connection sets logic HIGH on an ESP32 pin and interferes with boot state settings. ***
- Axis3/4 (Focuser and/or Rotator):
- 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.7A (MaxESP/ESP32 Tip: stay under 0.375A) 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 3x3 pin (or for the MaxESP 3x 2 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.
- Normally these drivers use lower power levels and so no heat-sink is required but the small ones usually included with A4988's and DRV8825's fit within the case without issue.
- SilentStepStick TMC2208/TMC2100 (the preferred drivers for these sockets.) Any available micro-step or decay mode can be selected using the jumpers described above.
- A4988. A great option, especially for tin-can stepper motors (which are in my opioion a great option for focusers/rotators) where there is often no advantage to using the TMC2208.
- The other inexpensive options can work well too, the DRV8825, LV8729.
- MaxESP/ESP32 Tip:
*** always follow the safety instructions when working with heat-sink compound ***
*** warning: never plug in or remove the stepper motor cables while powered up ***
The ST4 interface is automatically setup for operation on the correct pins (10,11,12,13) 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.
Hardware SPI interface:
Not supported on the MaxPCB/MaxESP Version 2. Note: This is separate from the SPI interface used for the TMC2130 stepper drivers.
Not built in for the MaxPCB Version 2 design, see the "Misc. I/O" section below. There is built-in bluetooth on the MaxESP Version 2 ESP32S micro-controller.
ESP8266 WiFi or W5500 Ethernet:
WiFi uses a WeMos D1 Mini Pro. An external antenna kit is also required. The ESP8266 needs to have my Wifi-Bluetooth firmware uploaded, the source code for this is in the /src/addons directory within your OnStep directory. It's an Arduino Sketch and there's instructions online for uploading via the Arduino IDE. Be sure to read/follow the instructions in its README.md and Config.h files! It is safe to plug into the WeMos D1 Mini and upload sketches without removing the device from the MaxPCB2 or MaxESP2. Also see the Wifi-Bluetooth Wiki page for more detailed information about getting this working.
- Doing a search "WeMos D1 Mini Pro" on eBay for this will return lots of hits.
- Beware that the cheap little external antenna shown with some of the models has poor performance.
- Often vendors sell the WeMos D1 Mini Pro separate from the antenna lead and antenna. I used an antenna from Mouser that worked well.
- The 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 (my kits include this modification.) 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.
Ethernet uses a Teensy3.2, W5500 module, and a custom PCB. Once this module is assembled it plugs right into the WeMos D1 Mini footprint on the MaxPCB2 (not compatible with the MaxESP2.) The Teensy3.2 needs to have my Wifi-Bluetooth firmware uploaded, the source code for this is in the /src/addons directory within your OnStep directory. It's an Arduino Sketch and there's instructions online for uploading via the Arduino IDE. Be sure to read/follow the instructions in its README.md and Config.h files! It is safe to plug into the Teensy3.2 and upload sketches without removing the device from the MaxPCB2. Also see the Ethernet Wiki page for more detailed information about getting this working.
DS3231 RTC (and I2C):
This provides the date/time as well as a PPS signal. The Teensy3.5/3.6 have a fairly accurate crystal oscillators and so PPS isn't needed for most users but if the DS3231 RTC available PPS can be used to improve tracking, though I doubt anyone will be able to tell the difference.
The typical DS3231 RTC modules have a second set of pads that let you access the I2C bus if you want to add other I2C devices.
OnStep currently supports three optional devices on this interface.
- The DS3231 RTC.
- The AT24C32 EEPROM (often onboard DS3231 modules.) Note: this selection isn't of much in this case use since the Teensy3.x already has faster EEPROM.
- The BME280 environmental sensor (for temperature, barometric pressure, humidity.)
- Aux3 and Aux4 on the DB9 connector ARE the I2C pins. If I2C is enabled Aux3/4 are not available for Home SW or accessory control. Also PPS isn't available on the the MaxESP.
***on the MaxPCB version 2.0, the PPS signal was incorrectly routed to the 32KHZ pin of the DS3231 where it should have gone to the SQW pin. If you really want the PPS feature (which again is not required) a quick fix would be to solder bridge the corresponding SQW and 32KHZ pins on the MaxPCB and cut off the module's 32KHZ pin***
Limit Sense (Aux7) and the Illuminated Reticule (Aux8) output are on a 3.5mm mini stereo jack to the right of the stepper driver jacks. The jack's collar is Gnd, it's ring (middle) is the Limit Sense, and it's tip is the Illuminated reticule. The Limit Sense input is protected against ESD with a 0.1uF capacitor and a reasonably strong 2K pull-up resistor. A switch (or series of switches wired in parallel) can close pulling the limit sense LOW to stop any slew and tracking. This can be physical limit switches and/or an emergency stop button. The Illuminated reticule output is NOT current limited but is protected against ESD with a 0.1uF capacitor. If using this to directly drive an LED be sure to add a resistor in series to limit the current.
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 on J9)
Pin 3: Encoder 1B, encoder input going to the WeMos D1 Mini
Pin 4: Encoder 2B, encoder input going to the WeMos D1 Mini
Pin 5: PEC
Pin 6: AUX3, typically used for a Home SW on RA or Azm (MaxESP/ESP32 Tip: if I2C is used this is SDA instead)
Pin 7: AUX4, typically used for a Home SW on Dec or Alt (MaxESP/ESP32 Tip: if I2C is used this is SCL instead)
Pin 8: Encoder 1A, encoder input going to the WeMos D1 Mini
Pin 9: Encoder 2A, encoder input going to the WeMos D1 Mini
- The Vsel shunt position at J9 also controls the pull-up voltage (if set on J10) for Encoder pins 3,4,8,9.
- MaxESP/ESP32 Tip:
- 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 Teensy3.5 is 5V tolerant but the Teensy3.6 and ESP32 are NOT 5V tolerant.
- Signals from the Encoder pins travel to the WeMos D1 Mini (ESP8266)
- The ESP8266 is 5V tolerant
SerialC (Teensy3.5/3.6 Serial4) Located under the DS3231 RTC this pin header has +5V and +3.3V power available in addition to the RX4 and TX4 connections. I suggest using a right angle pin-header in these pads or solder the wires directly in.
- For a Bluetooth module most users go with the Sparkfun Bluetooth Mate Silver or an HC05. In both cases refer to the BT module's manual or hookup guide to be sure the device is in slave mode and operating at 9600 baud. I leave it to the user to figure out connectors or other provision to get the BT signal outside of the aluminum case!
- For Ethernet the W5500ToMax PCB (W5500 and Teensy3.2) is probably the best option. The onboard Teensy3.2 has it's own USB interface which must be used to flash the add-on firmware for it. Do however be sure to disconnected the module from the MaxPCB if connecting to the Teensy3.2's micro USB for flashing (or cut the Teensy3.2's 5V USB power trace first.
- MaxESP/ESP32 Tip:
*** warning: never plug in or remove the Limit SW/Reticule or DB9 Connector or Serial cables while powered up ***