The MiniPCB Version 1
The image below shows an OnStep built on a MiniPCB Version 1. This PCB is designed primarily for situations where we want the controller built into the mount though 3D printable case designs are available. If building a basic controller in its own case the MiniPCB Version 2 is the way to go.
The very affordable EasyEDA service can be used to order an updated version of 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.
OnStep can use different "pin maps" and this PCB was designed for the Config.MiniPCB.h wiring!
Not shown here but whatever you build use an appropriate DC rated fuse (current rating depends on stepper drivers/motors/etc.)
OnStep Mini notes for Rev. 1.27x PCB:
It's up to you to understand the design, connection, limitations, and use of this device and its components, I accept no responsibility.
The latest OnStep using Config.MiniPCB.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 2A 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. 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.2, Stepper Drivers, ESP-01, 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 Mini should be powered from the motor supply. A switching regulator provides 5V DC to the Teensy3.2 etc. This has an input voltage range of 7V to 36VDC (other components limit us to 24VDC however.) The stepper driver 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", this header's pins must be connected together for the PCB to power up.
For durability and to eliminate the possibility of powering the MiniPCB from the USB connection's V+ (5V) power, the MiniPCB has a full-sized USB-B connector. The nearby header has D-, D+, and possibly V+ and/or Gnd pins. The D-, D+ pins provide a data connection between the PC and the Teensy3.2
- One option is to use the D- and D+ solder pads on the back of the Teensy3.2 near its Micro USB connector. 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. 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. The jumper lead sockets can then be plugged into the USB connector pins D-, D+ (D- to D- and D+ to D+.)
Note: For older MiniPCB designs where there is a ground pad "Gnd" next to the D- and D+ pads (for a 3 or 4-position Molex KK connector) near the MiniPCB USB connector run a ground wire from the Teensy through-hole near its reset button (identified here and marked "G" on the Teensy's back) to this ground or its corresponding connector pin.
Note: For older MiniPCB designs where there is a V+ pad next to the D- and D+ pads (for a 4-position Molex KK connector) do not connect it to anything.
- Another option is to use a cut-off (right angle) Micro USB cable plugged into the Teensy3.2 with the D-, D+, and Gnd leads plugged into the MiniPCB's USB header's corresponding pins. Note that the 3D printable case design isn't made to accommodate this however and some modifications to the side panel will probably be necessary.
***never use the Teensy3.2's Micro USB connector to feed power into the Teensy3.2 and MiniPCB***
Choice of Stepper driver:
The Stepper driver sockets are designed for compatibility with most Pololu style stepper driver modules...
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, A4988, LV8729, S109 require their pins 5 and 6 (SLP and RST) to be connected together to enable the module. This can be done, again, by using a shunt on headers J5 and J10. The shunt should connect M3-to-M4 (Axis1) and M3-to-M4 (Axis2.)
The ST4 interface is automatically setup for operation on the correct pins (10,11,12,13) by the Config.MiniPCB.h 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 pullups of the Teensy3.2. 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:
Not supported on the MiniPCB. Note: This is separate from the SPI interface used for the TMC2130 stepper drivers.
WiFi, Ethernet, and Bluetooth:
There is a ESP-01 ESP8266 and HC05 footprint sockets that use SerialB (at Serial1 and active by default in OnStep) and any of the following can plug in. This design uses the main serial port on the RX and TX pins.
For WiFi these instructions to upload firmware.
- WiFi uses an ESP-01 ESP8266. The antenna is positioned on the PCB corner to mitigate interfearance with other components on the PCB.
- Bluetooth uses an HC05 or HC06 module. Be sure to get one with pins matching the PCB silkscreen. 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.
- If not using Aux1/2 for anything else (TMC2130) you can use a shunt on AUX1-to-GPIO0 and AUX2-to-ESP_RST to enable firmware upload to the ESP module through the Teensy3.2. In that case, for firmware upload control there's a OnStep command ":ESPFLASH#" that can be sent just prior to uploading firmware (through the Teensy3.2 at 115200 baud) to the ESP-01.
- If using BT and not the ESP-01 resistors at R5, R6, and R7 can be omitted.
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 Teensy3.2 has a fairly accurate crystal oscillator and this isn't needed for most users now. The connection is, however, supported on Pin28 (solder pad) on the bottom of the Teensy3.2.
Limit Sense, labeled "Lm" near the stepper driver outputs. 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.
PEC, periodic error correction input, labeled "PEC" near the stepper driver outputs. 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.
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 sealed (metal?) case/box with proper design I can see using it.
Special notes for vertical builds (as done for my EM10 mount):
- I used a panel mount DC power jack and just soldered the terminals down to the PCB. This takes a coaxial DC plug 5.5mm OD, 2mm center pin.
- The Fuse holder/fuse combination is too tall on the front of the PCB. It can be installed on the back or contacts bridged and install a fuse elsewhere.
- For the EM10 controller I soldered a mini toggle switch directly to the PCB. Actually I installed a pin header first then soldered the switch terminals to that.
- I did not use sockets for the Teensy3.2, stepper drivers, or ESP8266 in this build (too tall.)
- 0.1" Pin headers for the stepper motors, PEC, and the Stat2 LED (for polar 'scope illuminated reticule) were all soldered to the back of the PCB.
- Additional Parts for the 3D printed panel design:
- Mouser #: 611-7101-001, Mfr: 7101SYZQE, Desc. Toggle Switches ON-ON SPDT SLDR MNT (not documented but likely to work)
- Mouser #: 490-PJ-005A, Mfr: PJ-005A, Desc. DC Power Connectors Power Jacks (not documented but likely to work)
- Mouser #: 154-UL-6662, Mfr: Same, Desc. Modular Connectors / Ethernet Connectors JACK PCB 6P-6C BLK
- Mouser #: 710-61400413321, Mfr: 61400413321, Desc. USB Connectors WR-COM Type B 4Pin Vertical Female
- Mouser #: 576-0297002.WXNV, Mfr. #: 0297002.WXNV, Desc.: Automotive Fuses32V 2A Mini
Here's the vertical built MiniPCB during test fitting with its 3D printed face plate (the STL and CAD files are available):