Last edited · 102 revisions  

 


The MaxPCB

NOTICE: On the Rev. 1.12 PCB: Since the ST4 port AND Focusers/Rotator all use similar modular jacks you must be sure to NEVER plug an ST4 device into a stepper motor jack.  More information is in the stepper driver section below.

The image below shows an OnStep built on a (version 1.2) MaxPCB.  The very affordable EasyEDA service can be used to order the PCB used to build this (or obtain the Gerbers.)  There's a BOM (bill-of-material) that lists all of the components needed to assemble one of these also on EasyEDA.  You can see the last of the now obsolete version 1.1x series MaxPCB's here.

Another design which is very similar is the MaxESP which is based on the cheaper but more limited ESP32 processor.  It has basically all features except there is only one focuser/rotator, no extra serial port (but Bluetooth is built into the ESP32) and crucially there is no support for stepper driver micro-step mode switching (using MICROSTEPS_GOTO) or the very nice TMC2130 stepper driver.  The ESP32 also, despite it's higher clock rate and processor dual cores, lacks the performance of a Teensy3.5 or Teensy3.6 running OnStep.

OnStep can use different "pin maps" and this PCB was designed for the Config.MaxPCB.h wiring!

Notice the 3A fuse next to the power connector in the lower left corner (current rating depends on stepper drivers/motors/etc.)

 



OnStep MaxPCB notes for Rev. 1.12, 1.13x, and 1.2x PCB's:

It's 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 is required.

Trace widths are sufficient for 3A (3 Amps) of current to the Axis1/2 stepper drivers plus running the 12V section.  Most 0.1" pin-headers are 3A rated.  The Molex KK headers 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 (except at R6 for the speaker which is 1/4 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.  I built with 1/4 watt resistors since that's what I have on-hand and they are a tight fit (a bit larger) but it worked out fine.

I specified Molex KK type connectors for the stepper drivers, fan, PEC, etc.  These are not required in most cases (the J1 power switch connection should be a Molex KK as specified, or directly soldered leads, though.)  There are other connectors like mini screw down terminals that can be used instead or break-away headers or right angle Molex KK.  The list goes on and on, the 0.1" spacing on these is very common for components.

If you're planning to socket the Teensy3.5/3.6, Stepper Drivers, etc.  I recommend, as part of your "kit" for building electronics stuff, that you get a pack of 0.1" break-away pin and socket headers.  These 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.  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.

Now to wire up switches, sockets, etc. you can build up nice jumper leads with the matching Molex KK series.  Or for a cheaper option get a good quality set of jumper wires with 0.1" pin/socket headers pre-installed (I use the SparkFun ones.)  Again, quality is important, the cheap knockoff ones don't have heavy gauge wire.


Power and USB:
The OnStep Max should be powered from the motor supply.  There's a 5V DC-DC and also a 12V DC-DC switching regulator.  These support an input voltage range of 15V to 36VDC (other components limit us to 24VDC however.)  The stepper drivers you choose will have a voltage rating which must also be considered.

  • The power switch header: There is a 2-pin power switch header labeled "J1" (and "SW",) this header's pins must be connected together for the PCB to power up.

For durability and to eliminate the possibility of powering the MaxPCB from the USB connection's V+ (5V) power, the MaxPCB has a full-sized USB-B connector.  The nearby header has V+, D-, D+, and Gnd pins.  I do not connect the V+ pin to anything.  The D-, D+, and Gnd pins provide a data connection between the PC and the Teensy3.x

  • One option is to use the D- and D+ solder pads on the back of the Teensy3.x near it's Micro USB connector and the ground through-hole near it's reset button.   I use a good quality socket header jumper (from Sparkfun) and twist the lead before cutting one side off to the lengths required and stripping about 1/8" bare.  I then tin the bare wire with solder in preparation for soldering to the Teensy's D- and D+ pads and ground through-hole.  With the wire end parallel the bare section is laid across the pads and a light touch on the wire with the solder iron from above makes the connection.  Solder the ground lead into the through hole near the reset switch which can be identified here and is marked "GND" on the Teensy's back. The jumper lead sockets can then be plugged into the USB connector pins D-, D+, and G pins (D- to D- and D+ to D+.)
  • Another option is to use a cut-off (right angle) Micro USB cable plugged into the Teensy3.x with the D-, D+, and Gnd leads plugged into the Max PCB's USB header's corresponding pins.

***never use the Teensy3.x's Micro USB connector to feed power into the Teensy3.x and MaxPCB components***


Choice of Stepper driver:
The Stepper driver sockets are designed for compatibility with most Pololu style stepper driver modules...

  • 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.  Additionally, Aux1 and Aux2 can be used to carry the SPI SDO (data out) signals from the drivers to the Teensy and allows OnStep to query the stepper drivers about their Fault status.  This is enabled by using a shunt on headers J5 and J10.  The shunt should connect AUX1-to-M3 (Axis1) and AUX2-to-M3 (Axis2.)
    • SilentStepStick TMC2100 (read about the TMC2100 before buying!) is also supported.  Most users will run in either 16x spread-cycle or 16x stealth-chop (w/ 256x interpolation.)  Be aware that certain pins need to be left physically disconnected to properly set these up.  Again, see OnStep's configuration file for details.  The Diag0 output can be wired to Aux1/2 to provide fault detection (in lieu of other features.)
    • StepStick (Pololu, etc.) DRV8825 and A4988's, require their RST/SLP pins to be connected to enable the module.  This can be done, again, by using a shunt on headers J18 and J19.  The shunt should connect M3-to-M4 (Axis1) and M3-to-M4 (Axis2.)
    • The RAPS128 should work also.

  • 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 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 6-position pin header adjacent to each stepper driver.
    • Each 6-position header has pins labeled with "M0" and "M1" (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 3v3 will pull the M0 pin HIGH.  Placing a jumper between M0 and G will pull the pin LOW.  Omitting the jumper will leave the pin floating OPEN.  The M2 jumper (newer boards) is only able to select OPEN or HIGH.
    • For a TMC2100 or TMC2208 (the preferred drivers for these sockets) this will allow selection of any available micro-step or decay mode (M0 is CFG1 and M1 is CFG2.)
    • There are also a pair of 2-position headers labeled "EN AX3" and "EN AX4" who's use depends on the stepper driver:
      • DRV8825: shorted = enabled, open = disabled
      • A4988: shorted = enabled, open = disabled
      • TMC2100: shorted = enabled, open = enabled with 34% stand-still power reduction in 3 seconds.
      • TMC2208: shorted = enabled, open = disabled.  Stand-still power reduction is configurable with one-time UART serial setup.
      • On newer MaxPCB's there are shunt positions that connect Aux5 and Aux6 to allow OnStep to enable/disable Axis3 and Axis4 as required.
    • There is provision for Focusers/Rotator registered jacks (RJ) on the PCB to making assembly easier.
      • You may also choose to not install the the RJ connectors and mount whatever connectors you like on the case.
      • On the MaxPCB Rev.1.13 these are RJ22 jacks.
      • On the MaxPCB Rev. 1.12 these are RJ11 jacks and care should be taken to never inadvertently plug an ST4 device into a stepper motor jack.
        • Dust covers are available (eBay, Amazon, etc.) that can be used over the stepper motor jacks when not in use to help guard against this.
        • Another option would be to use RJ22 jacks on the Rev 1.12 PCB, which would require a little DIY effort but should be possible (with a small round file and some epoxy) since the connectors are very similar.

ST4 interface:

On the MaxPCB Rev. 1.12 care should be taken to never inadvertently plug an ST4 device into a stepper motor jack.

The ST4 interface is automatically setup for operation on the correct pins (24,25,26,27) by the Config.MaxPCB.h file.  This is enabled by setting ST4_ON in the configuration file.  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 pullups of the Teensy. Be sure to solder the device to the bottom of the circuit board and watch that the pins/soldering doesn't interfere with the modular connector.


Hardware SPI interface (RTC and PPS):
This interface is available under the PCB between the pins of the Teensy.  The footprint matches the DS3234 RTC module should you choose to use one.  The DS3234 RTC module can provide date/time and a PPS signal to OnStep.  Use RTC_DS3234 in the configuration file to enable the RTC.  OnStep on the Mega2560 needed some help from an accurate clock source.  So a Pulse Per Second signal from a GPS or RTC was used.  The Teensy has a fairly accurate crystal oscillator and this isn't needed for most users.  The connection is, however, supported on Pin28 and that's connected to the SPI port footprint for the DS3234.  Use PPS_SENSE_ON in the configuration file to enable PPS.


I2C Interface:
This is available on the PCB near the Focuser/Rotator stepper drivers.  This connector provides an I2C connection (Teensy SCL1/SDA1) with 3.3v power but without pullups. 

The most recent OnStep 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 (temperature, barometric pressure, humidity.)

Serial1 and Serial4:
The MaxPCB has two serial ports which OnStep can use to communicate with other devices.  The pins of these ports have +5V and +3.3V power available in addition to the RX and TX connections.  I used breakaway socket headers for these connections instead of the Molex KK since that works out better for the options below.

An add-on Ethernet OR Wifi and/or Bluetooth module can plug into these ports.

Note: The MaxPCB version 1.2x and MaxESP have a WeMos D1 Mini socket and this uses Serial1.  The MaxESP (ESP32S) has no Serial4 port, however, it has Bluetooth built-in.

  • For a Bluetooth module, the Sparkfun Bluetooth Mate Silver (an RN42, setup like this) can plug directly into either port (omit the module's pins for "CTS-I" and "RTS-O".)  The HC05 type module will require using jumper wires, for example, to make the power/signal lines connect properly.  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.
  • Use the WeMos D1 Mini for WiFi as this plugs directly in. The WeMos has it's own USB interface which must be used to flash the add-on firmware into it.
    • Older MaxPCB's (version 1.1x) need jumper wires to make the power/serial connections (for serial use it's D7/RXD2 and D8/TXD2 pins.)
    • For these also be sure to disconnected from the MaxPCB if connecting to their USB for flashing (with 5V power.)
  • Use the W5500ToMax PCB (W5500 and Teensy3.2) for Ethernet as this plugs directly in. The Teensy3.2 onboard has it's own USB interface which must be used to flash the add-on firmware into it.
    • Older MaxPCB's (version 1.1x) need jumper wires to make the power/serial connections (using Molex KK connectors.)
    • For these also be sure to disconnected from the MaxPCB if connecting to their USB for flashing (with 5V power.)

For the MaxPCB version 1.1x

  • If an ESP-01 WiFi module is desired I recommend placing it at the Serial1 position.  The ESP-01 can't plug directly in, but I've designed an adapter PCB ESPToMax.  Solder the ESP-01 down to the adapter (along with a few other components) and then plug right in.  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 it's README.md and Config.h files!  If not using Aux1/2 for anything else (TMC2130, etc.) you can use a jumper on AUX1-to-GPIO0 and AUX2-to-ESP_RST to enable firmware upload to the ESP-01 module through the Teensy.  If this is setup there's a command in OnStep ":ESPFLASH#" that can be sent (at 9600 baud to the Teensy) just prior to uploading firmware (through the Teensy at 115200 baud) to the ESP-01.

Misc:

Limit Sense, labeled "Lm" near the USB-B connector (or Serial4 on version 1.2x)  The two position connector has ground on Pin 1 and an input signal on Pin 2 which is normally pulled HIGH (3.3V) by a resistor R4.  A switch (or series of switches wired in parallel) can close (pulling Pin 2 LOW) to stop any slew and tracking.  This can be physical limit switches and/or a emergency stop button.  When aborting a slew OnStep uses the DegreesForRapidStop distance (from the Config.MiniPCB.h) to stop the mount.  To enable this feature use LIMIT_SENSE_ON in the configuration file.

PEC, periodic error correction input, labeled "PEC" is right next to the Limit connector.  The three position connector has ground on Pin 1, an input signal on Pin 2, and 3.3v power on Pin 3.  This arrangement can be used with an optical encoder or hall-effect (magnetic) sensor with minimal or no additional circuitry.  Often the critical RA axis of the mount uses a worm-wheel gear.  The worm has machining errors that repeat once per cycle and a physical sensor makes sure OnStep always knows where the worm is in that cycle.  See the PEC_SENSE section of the configuration file to set this up.

Aux3 and Aux4 are right next to the PEC connector, these are general purpose inputs or outputs.  The three position connectors have ground on Pin 1, an input signal on Pin 2, and 3.3v power on Pin 3.  For now the only option available on these pins is to control the EN (enable) signals for Axis3 and Axis4 (focuser and/or rotator stepper drivers.)   They might control a dew heater, shutter, screen for shooting flats, etc. (as can any connection labeled "Aux") or they be used for home switches.

FAN, This provides 5V power to run a little cooling fan if required.  I've never used it since the idea of blowing damp air through my controller just doesn't appeal to me!  In a larger (metal?) case/box with proper design I can see using it.

Note: The MaxPCB version 1.2x has all of the above connections, except the Limit sense, on a female D-Sub DB9 connector.  Also on this connector are A/B inputs for two Encoders which run to the WeMos D1 Mini (which handles the Encoder support.)  Please refer to the schematic to see what the DB9 pin assignments are.  Be aware that there are DB9 male connector available which have integral screw terminal blocks which allow no-soldering hookup of lead wires from encoders, pec, and home switches/etc. (on Aux3/Aux4.)  Also near the DB9 connector is a 3-position pin header which allows 3.3V OR 5V to be brought out on the DB9.  Should you opt to use 5V remember the Teensy3.6 is NOT 5V tolerant but the Teensy3.5 and ESP8266 are 5V tolerant!