Comparing Versions of FYSETC S6

Comparing revisions and .

The FYSETC S6 3D Printer Board (V1.2 and V2.0)


The FYSETC S6 is a 32-bit board for 3D printers.


Advantages


Ready made board, no discrete components to order, and no soldering required to put it together

Lots of pins for every feature that OnStep supports (limit switch, PEC, ...etc.)

Faster than the STM32 Blue Pill

Allows for up to 9 alignment stars

Alignment error resolution down to 16"



Limitations


Regular non-SPI drivers (LV8729, S109) cannot have a different microstepping for slewing. The TMC SPI ones (TMC2130, TMC5160) will have that feature. However, you can speed up the non-SPI drivers by changing STEP_WAVE_FORM to PULSE for a 60% slewing speed increase, all else being equal, and depending on whether the motors can tolerate higher RPM.

Basic Information


The detailed information on this board can be found on the FYSETC S6 Wiki page.


The datasheet for the MCU is on Github. A complete reference to the MCU pin mapping for the board, not just the ones defined by the OnStep pinmap, is the one defined for the 3d printer software 'Marlin' used on this board.


Note that although the TMC2208 and TMC2209 are supported for 3D printers, OnStep does not support the UART interface for these steppers. Do not use any other driver than: TMC5160, TMC2130, LV8729 or S109.


Here is a video of a Vixen SXD mount being controlled using the FYSETC S6 in a minimal configuration (axis1, axis2, and WiFi only).


Another short video of the same mount slewing at 4 degrees/second with a Celestron C8 SCT, Canon DSLR, and 60mm guide scope.


This is a photo of the FYSETC S6 Board, the XH2.54 Connector version (white connectors).


The BOOT0 button is visible below the wires that go to the WeMos D1 Mini. On the V2.0 board, the BOOT0 button is replaced with a 3-pin header where the center and right pin (marked 3.3V in the FYSETC Wiki) are connected to enter upload mode on reboot. In this image two LV8729 are used for Axis1 (X), and Axis2 (Y)






Basic Build


Here is an example of what is practically a minimal build: only Axis1, Axis2, and WeMos for WiFi.


This is the S6 board in a cardboard box, with a 2.1/5.5mm screw terminal connector for 12V power, attached using a cable tie. The cardboard box is strengthens against dew by using transparent packing tape.








Axis1 is connected to the X-Mot, and Axis2 to the Y-Mot connectors on the board. Both are wired to RJ45 Breakout boards, with each two adjacent pins soldered together using a solder bridge, and insulated using heat shrink and electric tape.


The WeMoS D1 Mini goes to the UART1 connector, and is also insulated using electrical tape.








The cardboard box has openings for the various ports. Here the power, USB, RA, Dec ports are shown.








GPS can be added using an ATGM336H module (preferred) or a U-Blox NEO 7M - these have both been verified to work. There are several advantages to the ATGM336H device: size (see below for comparison picture), it comes with an active antenna on a short lead (the NEO 7M is quite deaf indoors without an external active antenna) and it doesn't interfere with entering firmware update mode on the S6 (see below the next few pictures for a discussion of that). Possible disadvantages of the ATGM336H are that it doesn't have a USB port so you can't test its performance on a PC without using a USB-to-serial adapter and if you need an external antenna (e.g. your telescope is in a metal dome) you will need to get one with an SMA-to-IPEX converter since almost all external active antennas come with SMA connectors and the jack on the ATGM336H is a tiny IPEX-type connector. Only the VCC, GND, and TX pins of the GPS module need to be connected for reception of time and location.





Additionally, you can use the PPS pin for pulse per second clock correction to achieve the highest possible clock accuracy. The following picture shows a U-Blox NEO 7M module connected to the Serial3 port on the S6 EXP1 connector (remember to connect the TX output of the GPS to the Serial3 RX pin). The picture also shows the connection of PPS via the green wire to the appropriate PPS-detect pin on EXP2. The module is shown against the side of the box so that the external antenna right angle SMA connector (included but must be soldered in manually) is accessible from the outside.





Note: If you use a U-Blox NEO 7M module (and this may occur with other modules too) there is, at present, a quirk to know about with upload mode. The U-Blox module begins blasting NMEA messages into the serial port as soon as it receives power and it seems that this interferes with the establishment of the STM bootloader device (Windows or Linux). The result is that the upload device on the host port comes up only infrequently when rebooted with the BOOT0 button held, the BOOT0 jumper in place or (more importantly) when the Web Server 'Reboot OnStep for firmware upload' feature is used for remote software upload. This has been seen with the GPS on either Serial2 and Serial3


One workaround for this, which is useful for a remote observatory situation where you need to update the firmware remotely, is to install a simple switch in the GPS module power line but this requires you to physically move it - not a real problem if you are physically present but it defeats the purpose of remote uploads.


A tested solution to this is to use an inexpensive Arduino IRF520 MOSFET module to enable the power to the GPS only when OnStep is started normally.





By connecting a +5V and GND source from the S6 (e.g. from one of the EXP connectors) to the module's Vin and GND input connections, the GPS power to the module's V+ and V- (which is GND) connections and SIG to a 3.3V output controllable as an OnStep Aux Feature switch, you can get OnStep to turn on this module only when it starts normally and it will not start when you boot into upload mode. The additional configuration requirement to have the control output switch on during OnStep initialization is to configure an Auxiliary Feature section as follows (here I use the E1-MOT PD-EN connector, right side pin, similar to the OneWirePin placement). Note that you cannot use a FAN or HEATER pin for this because the S6 board switches GND, not +ve power on these connectors and the IRF520 would see that as the trigger voltage, which it would complete to the GND input, and always be triggered on.



#define FEATURE4_NAME "GPSPOWER"
#define FEATURE4_PURPOSE SWITCH
#define FEATURE4_TEMP OFF
#define FEATURE4_PIN PC5
#define FEATURE4_DEFAULT_VALUE ON



Obviously, this IRF520 module solution can be used as a template for any other SWITCH-type auxiliary feature that cannot be provided through the FAN or HEATER connections.
Where To Buy


The board is available on FYSETC's store on AliExpress.
Cables


There are two versions, depending on the type of connectors used, XH and MX.


The XH 2.54 connectors are the more commonly used type in the 3D printer world, and you can get ready made cables on AliExpress or where ever else you buy 3D printing supplies. For the motors and the WeMos, a standard 4-wire cable is used. For the other connectors on the board, they are 2-wire and 3-wire.


The MX (Molex) connector version comes with the Molex shells for each of the 2, 3 and 4 pin connectors and includes the crimp terminals so this is an option if you have the ability to properly crimp the terminals.


If you are going to go for the XH connector type in expectation of using pre-made pigtail wires there is an important buying decision to be made... current carrying capacity for the motor connections. Most pre-made cables use 26 guage wire but 26 guage wire only has a DC current carrying capacity of 0.361A. This will only be adequate for smaller size steppers (e.g. NEMA17 0.9A set for ~40% current, NEMA14, NEMA11 etc). If you are going to use higher current steppers (with an appropriate higher current driver) it is recommended that you use 22 guage wire which has a current carrying capacity 2.5x higher (0.92A). It is possible to find pre-made JST-XH 2.54mm 4-pin connectors using 22 guage wire but there are far fewer vendors to choose from and you have to be sure it says '22 guage' or '22AWG' in the product description.


If you are going to crimp your own connectors (of either type... you can buy unassembled XH housings and crimp pins if you don't buy the MX version that comes with them) then you should probably use 22 guage wire for the motor connections in order to be future-proof. The MX and XH crimp connectors and housings will accommodate 22 to 26 guage wire. 26 guage wire is acceptable for all other (logic) connectors with the possible exception of the FAN connectors depending on what you are going to do with them.


For the EXP1 and EXP2 extensions, a 10-position, dual-row ribbon cable would be a possibility but these are getting hard to find and it is not easy working with the individual conductors in ribbon cables once you get to where you want to go. The proper 10 position dual-row Molex connectors (Mouser part #538-22-55-2102) would be the preferred option but you need to be able to crimp Molex terminals (and these are one step smaller than the usual ones).

Status


OnStep has been ported to work successfully with the S6 board by Khalid Baheyeldin, with help from Howard Dutton for the ever challenging timer code.


At present the following has been verified to work:


Tracking LED

Buzzer

Axis 1 (marked X-MOT) and Axis 2 (marked Y-MOT)

Focuser 1 (Axis4, marked E0-MOT)

Regular (non-SPI) drivers (LV8729, S109)

Support for SPI drivers (TMC2130 and TMC5160). TMC2130 is tested but AXISn_DRIVER_STATUS TMC_SPI may be problematic (set to OFF if you have problems).

WiFi support using a WeMos D1 Mini, connected to the UART1 connector near the center of the board. Note that the silkscreen to the left of the UART1 port on the top of the board is for the 3-pin limit switch headers further to the right, not the UART1 port ... go by the pin assignment silkscreen for UART1 on the back. Remember to wire TX to RX and RX to TX. Bluetooth should also work by substituting an HC-05 module since this is transparent to the software.

ST4 port/SHC - Requires a 2.2K Ohm bussed resistor network 5-pin. Or you can make your own using normal resistors.

PPS Sync (from GPS or from DS3231 RTC)

Acquisition of date and time from ZS-042 (I2C) RTC module but only if the EEPROM on it is disabled or its I2C address is moved out of conflict with the S6's onboard EEPROM by bridging all three of the A0, A1 and A2 jumpers.

Acquisition of date, time and location from GPS. Tested both Serial3 on EXP1 (TX3/RX3) and SoftwareSerial2 on Y+/Z+ end stops (TX2/RX2.) Note that you only need the RX pin (TX is not used.)

Acquisition of the ambient weather conditions using the SPI version of the BME280 (WEATHER BME280_SPI). The I2C version of the BME weather sensor does not work with this board at this time.

Limit switch

Home switch for Axis1 and Axis2

PEC sensor

Dew heaters, with optional DS18b20 'OneWire' sensors for intelligent heat output control

Ability to boot the controller into firmware upload mode using the 'Reboot OnStep for firmware upload' feature of the web server.



The following features are planned, but not yet tested:


Focuser 2 (Axis 5)

Rotator De-rotator (Axis3)

Reticle LED

3 X Fans (one can be for the board, another for the primary mirror, a third for the secondary)

4 X Thermometers

Ability to flash the WiFi module in-place using the ESPFLASH method

Pins


The OnStep pinmap for the S6 board can be viewed on the OnStep Github repository, the FYSETC S6 Webpage has useful information also as does the FYSETC S6 GitHub repository.


The voltages shown below are the defaults.


Many connections on the S6 board do what the name implies. The I2C and SPI ports, for example.


The UART1 port, on a connector to the left of the End Stops, is RX1/TX1 (Serial1) or SerialB in OnStep.
The UART2 port, on Y+/Z+ below, is RX2/TX2 (SoftwareSerial2) for GPS only in OnStep.
The UART3 port, on EXP1 below, is RX3/TX3 (Serial3) or SerialC in OnStep. This can be used as a command channel or for GPS.


Serial1/SerialB and End Stops:
UART1 X- (PB14) Y- (PB13) Z- (PA0) X+ (PA1) Y+ (PA2) Z+ (PA3)
X GND
X +5V X AX1 HOME X AX2 HOME X LIMIT X PEC X TX2 X RX2
X TX1 X GND X GND X GND X GND X GND X GND
X RX1 X +3V3 X +3V3 X +3V3 X +3V3 X +3V3 X +5V


EXP1 and EXP2 Headers:
EXP1
TONE PC9 X X PA8 ST4 RA-
RX3 PC11 X X PD2 ST4 DE-
TX3 PC10 X X PC12 ST4 DE+
ESP_GPIO0 PD0 X X PD1 ST4 RA+
GND X X +5V
EXP2
SPI-MISO PA6 X X PA5 SPI-SCK
STA-LED1 PC6 X X PA4 ESP_RST or SPARE SPI-CS
STA-LED2 PC7 X X PA7 SPI-MOSI
PPS PB10 X X RESET
GND X X +5V


The I2C Header:
I2C
X X X X
VCC GND SDA SCL

Software


To use the FYSETC S6 board, you need to use OnStep 4.24 or later.


In order to use this board, you need to install the STM32Duino Board Manager. See the Third Party Boards section on this page. The STM32Duino must be version 1.9.0 only. Both earlier and later version will not work for the FYSETC S6!


The URL to use is:


https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json


Also, on Windows, you need to use STM32CubeProgrammer in DFU mode, as described on this page.


Important: On Windows, the STM32Duino package uses a script to call the STM32CubeProgrammer in command-line mode to perform the actual upload. This script contains an incorrect address for the code segment start address (its probably correct for some boards but not the FYSETC S6). Currently the only way to change this to the correct value is to edit the script according to these instructions:


locate the file stm32CubeProg.bat. It should be at ~AppData\Local\Arduino15\Packages\STM32\Tools\STM32tools\1.4.0\tools\win\STM32CubeProg.bat but if the location changes in the future due to package updates you may need to search for it starting at ~\AppData\Local\Arduino15.

Open the file in your favorite editor

Change the value on the 'SET ADDRESS' line from 0x8000000 to 0x8010000

Save and exit



WARNING: If you fail to update the start address in the stm32CubeProg.bat script after STM32Duino package installation OR updating you will corrupt the bootloader on the board. You will have to refresh it from the master at https://github.com/FYSETC/
Bootloader-S6FYSETC-S6/blob/main/bootloader/Bootloader-FYSETC_S6.hex (and upload it at 0x8000000 using the STM32CubeProgrammer) in order to restore the ability for OnStep to run properly when uploaded at 0x8010000.


You will also need the digitalWriteFast from Watterott library. It has to be installed manually. Download the zip and extract it, then move the directory digitalWriteFast to Arduino\libraries. For Linux, the procedure is detailed here.
Flashing
For Windows:


You must select exactly the following options, otherwise some things will not work (e.g. USB port)


Board -> 3D printer boards

Board part number -> FYSETC_S6

U(S)ART Support -> Enabled (generic 'Serial')

USB Support (if available) -> CDC (generic 'Serial' supercede U(S)ART)

USB Speed (if available) -> Low/Full Speed

Optimize -> Fastest (-O3)

C Runtime Library -> Newlib Nano + Float Printf/Scanf

Upload Method -> STM32CubeProgrammer (DFU)



Press the Boot0 button near the center of the board, and while it is pressed, push then release the Reset button that is next to the USB port. To verify that the board has entered DFU mode, view the Device Manager and there should be a device called 'STM32 Bootloader' under the 'USB Serial Bus Devices' category.


The Arduino IDE should now be able to flash the board successfully.
After flashing is complete, you have to press the Reset button again (or cycle the power) to enter normal run mode. Once reset, the 'STM32 Bootloader' device will disappear from the Device Manager list. After OnStep starts, a COM port device should appear. Note that on the FYSETC_S6 board, the USB port is implemented purely in software, not via a hardware device, so if OnStep does not start there will be no port even though the cable is plugged in.
For Linux:


For Linux, you don't need to use the STM32CubeProgrammer. Rather, you can use the free DFU utility which is available in most Linux repositories.


Install it using:


$ sudo apt install dfu-util
Then place the board in DFU mode, using the button sequence described above.


$ dfu-util -l
Lists all devices. Check what alternative number is for Flash Memory.
After compiling, you will see a message like this:
../stm32CubeProg.sh 2 /tmp/arduino_build_846879/OnStep.ino.bin -g


And a failure message, because the above program is not found. Ignore that message.


Note the path of the OnStep.ino.bin file above.
Then use the DFU Utility to flash with the correct offset:
$ dfu-util -a 0 -s 0x08010000 -D /tmp/arduino_build_846879/OnStep.ino.bin
After flashing is done, you have to manually press the Reset button.
Return to revisions list