Difference between revisions of "Recore A4"
(→Install STM32 firmware) |
(→Inductive Sensor) |
||
(8 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
==Recore Rev A4== | ==Recore Rev A4== | ||
+ | <div class="res-img"> | ||
[[File:Recore header.png]] | [[File:Recore header.png]] | ||
+ | </div> | ||
Recore is a 3D-printer control board running Linux. It is specifically tailored to be compatible with Klipper and OctoPrint. The main features are: | Recore is a 3D-printer control board running Linux. It is specifically tailored to be compatible with Klipper and OctoPrint. The main features are: | ||
* Allwinner A64 SoC, quad core CPU running at 1 GHz. | * Allwinner A64 SoC, quad core CPU running at 1 GHz. | ||
Line 57: | Line 59: | ||
|233 | |233 | ||
|- | |- | ||
− | |STEP | + | |STEP 0 |
|PL4 | |PL4 | ||
|4 | |4 | ||
|- | |- | ||
− | |STEP | + | |STEP 1 |
|PL5 | |PL5 | ||
|5 | |5 | ||
|- | |- | ||
− | |STEP | + | |STEP 2 |
|PL6 | |PL6 | ||
|6 | |6 | ||
|- | |- | ||
− | |STEP | + | |STEP 3 |
|PL7 | |PL7 | ||
|7 | |7 | ||
|- | |- | ||
− | |STEP | + | |STEP 4 |
|PL8 | |PL8 | ||
|8 | |8 | ||
|- | |- | ||
− | |STEP | + | |STEP 5 |
|PL9 | |PL9 | ||
|9 | |9 | ||
|- | |- | ||
− | |STEP | + | |STEP 6 |
|PL10 | |PL10 | ||
|10 | |10 | ||
|- | |- | ||
− | |STEP | + | |STEP 7 |
|PL11 | |PL11 | ||
|11 | |11 | ||
|- | |- | ||
− | |DIR | + | |DIR 0 |
|PE8 | |PE8 | ||
|136 | |136 | ||
|- | |- | ||
− | |DIR | + | |DIR 1 |
|PE9 | |PE9 | ||
|137 | |137 | ||
|- | |- | ||
− | |DIR | + | |DIR 2 |
|PE10 | |PE10 | ||
|138 | |138 | ||
|- | |- | ||
− | |DIR | + | |DIR 3 |
|PE11 | |PE11 | ||
|139 | |139 | ||
|- | |- | ||
− | |DIR | + | |DIR 4 |
|PE12 | |PE12 | ||
|140 | |140 | ||
|- | |- | ||
− | |DIR | + | |DIR 5 |
|PE13 | |PE13 | ||
|141 | |141 | ||
|- | |- | ||
− | |DIR | + | |DIR 6 |
|PE14 | |PE14 | ||
|142 | |142 | ||
|- | |- | ||
− | |DIR | + | |DIR 7 |
|PE15 | |PE15 | ||
|143 | |143 | ||
Line 236: | Line 238: | ||
|PF1 | |PF1 | ||
|161 | |161 | ||
+ | |- | ||
+ | |STEPPER UART_RX 0-3 | ||
+ | |PB1 | ||
+ | | | ||
+ | |- | ||
+ | |STEPPER UART_TX 0-3 | ||
+ | |PB0 | ||
+ | | | ||
+ | |- | ||
+ | |STEPPER UART RX 4-5 | ||
+ | |PD1 | ||
+ | | | ||
+ | |- | ||
+ | |STEPPER UART TX 4-5 | ||
+ | |PD0 | ||
+ | | | ||
|} | |} | ||
Line 340: | Line 358: | ||
|Brown | |Brown | ||
|12V | |12V | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | ===TMC2209=== | ||
+ | The 6 stepper drivers on Recore are of type TMC2209 from Trinamic. Each stepper has a configuration interface with a bidirectional UART port that is connected to a pin on the A64. The GPIO bit-banging functionality of Klipper is used to communicate with the stepper drivers. | ||
+ | |||
+ | Here is a table with pins and addresses for the steppers | ||
+ | {| class="wikitable" | ||
+ | !colspan="3"|Stepper driver config | ||
+ | |- | ||
+ | |Name | ||
+ | |Pins | ||
+ | |Address | ||
+ | |- | ||
+ | |S0 | ||
+ | |PB0/PB1 | ||
+ | |0 | ||
+ | |- | ||
+ | |S1 | ||
+ | |PB0/PB1 | ||
+ | |1 | ||
+ | |- | ||
+ | |S2 | ||
+ | |PB0/PB1 | ||
+ | |2 | ||
+ | |- | ||
+ | |S3 | ||
+ | |PB0/PB1 | ||
+ | |3 | ||
+ | |- | ||
+ | |S4 | ||
+ | |PD0/PD1 | ||
+ | |0 | ||
+ | |- | ||
+ | |S5 | ||
+ | |PD0/PD1 | ||
+ | |1 | ||
|- | |- | ||
|} | |} | ||
Line 853: | Line 908: | ||
accurate. The connected thermistor is a TDK [https://product.tdk.com/info/en/catalog/datasheets/503021/tpd_commercial_ntc-thermistor_ntcg_en.pdf NTCG104EF104FT1X] | accurate. The connected thermistor is a TDK [https://product.tdk.com/info/en/catalog/datasheets/503021/tpd_commercial_ntc-thermistor_ntcg_en.pdf NTCG104EF104FT1X] | ||
The connected Thermocouple has a (25/100) beta value of 4327. | The connected Thermocouple has a (25/100) beta value of 4327. | ||
+ | Beta 25/85 used in Klipper is 4308K | ||
+ | |||
In order to use the inputs for thermocouple, the pull-up resistors must be deactivated: | In order to use the inputs for thermocouple, the pull-up resistors must be deactivated: | ||
Line 1,066: | Line 1,123: | ||
An experiment with a constant current load drawing 20 A from the bed connector with and without a 92 mm fan on top of the board for forced convection. The temperature measured was with the on board thermistor. Using a thermal camera, the temperature displayed matches well with the temperature reported by the camera. However, in Rev A2, this is not the hottest point on the board. The MOSFET controlling the bed seems to consistently get the highest temperature. The reason for this is probably due to a 3.3 V VGS. | An experiment with a constant current load drawing 20 A from the bed connector with and without a 92 mm fan on top of the board for forced convection. The temperature measured was with the on board thermistor. Using a thermal camera, the temperature displayed matches well with the temperature reported by the camera. However, in Rev A2, this is not the hottest point on the board. The MOSFET controlling the bed seems to consistently get the highest temperature. The reason for this is probably due to a 3.3 V VGS. | ||
+ | <div class="res-img"> | ||
[[File: Temperature-fan-off.pdf.png]] | [[File: Temperature-fan-off.pdf.png]] | ||
− | + | </div> | |
+ | <div class="res-img"> | ||
[[File:Temperature-fan.pdf.png]] | [[File:Temperature-fan.pdf.png]] | ||
+ | </div> | ||
====Inrush current==== | ====Inrush current==== | ||
During turn on of the high power stage, there will be an inrush current to charge up the bank of capacitors present on the board. | During turn on of the high power stage, there will be an inrush current to charge up the bank of capacitors present on the board. | ||
If no loads are turned on, the inrush current reaches 31 A at peak. This is important to consider when setting the current limit with device tree. | If no loads are turned on, the inrush current reaches 31 A at peak. This is important to consider when setting the current limit with device tree. | ||
+ | <div class="res-img"> | ||
[[File:Inrush current A3.png]] | [[File:Inrush current A3.png]] | ||
+ | </div> | ||
===Temperature low pass filter=== | ===Temperature low pass filter=== |
Latest revision as of 12:57, 29 February 2024
Contents
- 1 Recore Rev A4
- 2 Hardware overview
- 3 Connectors
- 4 Software for Recore
- 5 Software for Recore
- 6 Manual control and testing
- 7 Performance
- 8 FAQ
- 8.1 Q: Where can I ask for help?
- 8.2 A: You can join the Discord: https://discord.gg/bCnp9H5SB5
- 8.3 Q: What comes in the box with the Recore? Specifically, terminal connectors for power, etc?
- 8.4 A: It's only the board, no connectors at all.
- 8.5 Q: What's the maximum current draw for heat bed?
- 8.6 A: This has been tested up to 20 A
- 8.7 Q Why are there unused and unbroken out pins on the STM32 MCU?
- 8.8 A: The pins that are needed from the MCU have been routed out plus two pins available on an external header.
- 8.9 Q: I have a gadget that I want to connect with SPI. Is that possible?
- 8.10 A: There are 6 pins available from the main SoC that can be used for various things.
- 8.11 Q: What exactly is the role of the AR100 device?
- 8.12 A: The AR100 handles the fast realtime aspects, mainly the stepper motors
- 8.13 Q: What voltage fans are supported?
- 8.14 A: The same voltage as the input voltage, either 12 V or 24 V. You can experiment with PWM for running lower voltage fans on 24 V input
- 8.15 Q: Where is the board layout file?
- 8.16 A: The Layout file will not be available. It is an "open schematic" board, not open source hardware.
- 8.17 Q: Where are you shipping from?
- 8.18 A: Early prototypes (Rev A4) will be shipping from Norway. Eventually shipping will be from a warehouse in the US
- 9 Known Issues
Recore Rev A4
Recore is a 3D-printer control board running Linux. It is specifically tailored to be compatible with Klipper and OctoPrint. The main features are:
- Allwinner A64 SoC, quad core CPU running at 1 GHz.
- 1 GB or DDR3 RAM
- 8 GB of on board eMMC
- Gigabit Ethernet
- 6 TMC2209, 2 A stepper motor drivers
- 3 heater outputs + high power heated bed
- 4 USB High Speed ports
- 4 thermistor/thermocouple inputs (software selectable)
- Comes with Debian Linux with Klipper and OctoPrint installed
This document is for Recore Revision A4. For previous hardware revisions, please see:
Hardware overview
Pinout
A64
I the following table the pins used for End-stops and stepper control are described. The "bank and pin" can be used to specify the pin numbers in klipper. The "Number" column is useful for testing things on the command line in conjunction with gpiod.
Pinout | ||
---|---|---|
Name | Bank and pin | Number |
END STOP 0 | PH4 | 228 |
END STOP 1 | PH5 | 229 |
END STOP 2 | PH6 | 230 |
END STOP 3 | PH7 | 231 |
END STOP 4 | PH8 | 232 |
END STOP 5 | PH9 | 233 |
STEP 0 | PL4 | 4 |
STEP 1 | PL5 | 5 |
STEP 2 | PL6 | 6 |
STEP 3 | PL7 | 7 |
STEP 4 | PL8 | 8 |
STEP 5 | PL9 | 9 |
STEP 6 | PL10 | 10 |
STEP 7 | PL11 | 11 |
DIR 0 | PE8 | 136 |
DIR 1 | PE9 | 137 |
DIR 2 | PE10 | 138 |
DIR 3 | PE11 | 139 |
DIR 4 | PE12 | 140 |
DIR 5 | PE13 | 141 |
DIR 6 | PE14 | 142 |
DIR 7 | PE15 | 143 |
STEP DIAG 0 | PE0 | 128 |
STEP DIAG 1 | PE1 | 129 |
STEP DIAG 2 | PE2 | 130 |
STEP DIAG 3 | PE3 | 131 |
STEP DIAG 4 | PE4 | 132 |
STEP DIAG 5 | PE5 | 133 |
STEP DIAG 6 | PE6 | 134 |
STEP DIAG 7 | PE7 | 135 |
OC-ALERT | PG0 | 192 |
OC-RESET | PG1 | 193 |
EN-HP | PG2 | 194 |
UC-INT-1 | PG3 | 195 |
UC-NRST | PG4 | 196 |
UC-BOOT | PG5 | 197 |
ES-EN-12V | PG8 | 200 |
EN-HDMI-PWR | PG9 | 201 |
EN-THERMISTORS | PG10 | 202 |
EN-ENDSTOPS | PG11 | 203 |
USB-PWR-EN-0 | PH0 | 224 |
USB-PWR-EN-1 | PH1 | 225 |
USB-PWR-EN-2 | PH2 | 226 |
USB-PWR-EN-3 | PH3 | 227 |
GAIN-ENABLE-T0 | PD4 | 100 |
GAIN-ENABLE-T1 | PH11 | 235 |
GAIN ENABLE T2 | PE17 | 160 |
PU-ENABLE-T0 | PD6 | 102 |
PU-ENABLE-T1 | PD24 | 120 |
PU ENABLE T2 | PF0 | 160 |
PU ENABLE T3 | PF1 | 161 |
STEPPER UART_RX 0-3 | PB1 | |
STEPPER UART_TX 0-3 | PB0 | |
STEPPER UART RX 4-5 | PD1 | |
STEPPER UART TX 4-5 | PD0 |
STM32F030
Pinout | ||
---|---|---|
Name | Bank and pin | Number |
THERMISTOR 0 | PA0 | 6 |
THERMISTOR 1 | PA1 | 7 |
THERMISTOR 2 | PA2 | 8 |
THERMISTOR 3 | PA3 | 9 |
BOARD VOLTAGE | PA4 | 10 |
BOARD CURRENT | PA5 | 11 |
BOARD TEMPERATURE | PA6 | 12 |
COLD JUNCTION | PA7 | 13 |
FAN 0 | PB0 | 14 |
FAN 1 | PB1 | 15 |
FAN 2 | PB5 | 28 |
FAN 3 | PB4 | 27 |
HEATER E0 | PA8 | 18 |
HEATER E1 | PA9 | 19 |
HEATER E2 | PA10 | 20 |
HEATER BED | PA11 | 21 |
USER LED | PA12 | 22 |
EXT 1 | PA8 | 32 |
EXT 2 | PB7 | 30 |
Inductive Sensor
Connect the inductive sensor on ES0. You can choose either 5V or 12V output on the voltage pin.
Pinout | |
---|---|
Name | Number |
Black | signal |
Blue | GND |
Brown | 12V |
TMC2209
The 6 stepper drivers on Recore are of type TMC2209 from Trinamic. Each stepper has a configuration interface with a bidirectional UART port that is connected to a pin on the A64. The GPIO bit-banging functionality of Klipper is used to communicate with the stepper drivers.
Here is a table with pins and addresses for the steppers
Stepper driver config | ||
---|---|---|
Name | Pins | Address |
S0 | PB0/PB1 | 0 |
S1 | PB0/PB1 | 1 |
S2 | PB0/PB1 | 2 |
S3 | PB0/PB1 | 3 |
S4 | PD0/PD1 | 0 |
S5 | PD0/PD1 | 1 |
Connectors
Four pin male: TBP01P1-508-04BE
Two pin male: TBP01P1-508-02BE
Software for Recore
Recore should come pre-flashed with ReFactor image. If you want to update that, here are the steps:
- Flash the ReFactor Linux distro to a USB drive.
- Insert the Recore board in a host computer with the USB-C connector.
- If the eMMC is blank or the "FEL" button is pressed, the board will go into bootloader mode.
- Upload SPL, EL3 and u-boot through the USB port.
- The board will boot using the USB drive.
- Copy the contents of the USB drive into the eMMC/Internal flash.
ReFactor
Flashing ReFactor from a USB drive
Get the latest ReFactor image from here: https://github.com/goeland86/ReFactor/releases for example:
wget https://github.com/goeland86/ReFactor/releases/download/v3.0.0-RC4/ReFactor-recore-v3.0.0-RC4.img.xz
Assuming you have managed to boot Recore from a USB flash drive and you have the ReFactor image available in the same folder, you can use dd to do a direct transfer of the image from the USB drive to eMMC.
xz -v -d -c Refactor-recore-v3.0.0-RC3.img.xz | dd of=/dev/mmcblk0
Booting from USB if an OS is present on the eMMC
If the eMMC is parititioned and has an OS, u-boot will launch right into that. In order to override that and load the boot script from a USB dongle, stop u-boot by pressing a key and then write:
run bootcmd_usb0
In order to mount the root filesystem on the USB stick, you must change the kernel command line. In the file /boot/armbianEnv.txt add the line:
extraargs=root=/dev/sda1
This can be done on the USB stick.
USB initilization takes several seconds, so it has been disabled by default on the later u-boot in Refactor. If USB is not initialized, you can do it manually from u-boot:
usb reset
Install Klipper
With ReFactor, klipper comes pre-installed. However some quirks needs to be done in order to get it working.
cd /home/debian mv klippy-env klippy-env-py3 virtualenv -p /usr/bin/python2 klippy-env source klippy-env/bin/activate pip --upgrade pip install pyserial greenlet cffi jinja2 deactivate
After the quirks, restart klipper:
systemctl restart klipper
You can check the log by writing
tail -f /tmp/klippy.log
Install STM32 firmware
This flash scripts requires gpiod
sudo apt install gpiod
cd /home/klipper/klipper cp .config_stm32 .config make gpioset 1 197=1; gpioset 1 196=0; make serialflash FLASH_DEVICE="/dev/ttyS4 -i -196,196"; gpioset 1 197=0
Install AR100 firmware
The AR100 needs a cross compilation toolchain. It can be downloaded from feeds.iagent.no:
cd /opt wget http://feeds.iagent.no/toolchains/or1k-linux-musl.tar.xz tar xf or1k-linux-musl.tar.xz export PATH=$PATH:/opt/output/bin
cd /home/debian/klipper/ cp .config_ar100 .config make
Running Klipper
After a reboot, the ar100 firmware needs to be reflashed. We will get this into an automatic routine eventually, bit for now:
sudo /home/klipper/klipper/scripts/flash-ar100.py /home/klipper/klipper/out/ar100.bin
While details are ironed out there is a script that can be used to restart Klipper that will handle resetting things and setting up the steppers etc.
/home/klipper/klipper/scripts/restart-recore.py
Giving right privileges for AR100 restart
The AR100 flasher and reset script needs to be run as root. We create a group called flashers, add klipper to that and gie the group sudo access to the script
sudo addgroup flashers sudo adduser klipper flashers echo '%flashers ALL=(ALL) NOPASSWD: /home/klipper/klipper/scripts/flash-ar100.py *, /usr/bin/gpioset *' > /etc/sudoers.d/flashers
Install Octoprint
su klipper cd ~ sudo apt update sudo apt install python-pip python-dev python-setuptools python-virtualenv git libyaml-dev build-essential mkdir OctoPrint && cd OctoPrint virtualenv venv source venv/bin/activate pip install pip --upgrade pip install octoprint ./venv/bin/octoprint serve
Add a systemd start-up script
nano /lib/systemd/system/octoprint.service
Add the following content
[Unit] Description=The snappy web interface for your 3D printer After=network-online.target Wants=network-online.target [Service] Type=simple User=klipper ExecStart=/home/klipper/OctoPrint/venv/bin/octoprint [Install] WantedBy=multi-user.target
Enable and start script
sudo systemctl enable octoprint sudo systemctl start octoprint
Software for Recore
Recore should come pre-flashed with ReFactor image. If you want to update that, here are the steps:
- Flash the ReFactor Linux distro to a USB drive.
- Insert the Recore board in a host computer with the USB-C connector.
- If the eMMC is blank or the "FEL" button is pressed, the board will go into bootloader mode.
- Upload SPL, EL3 and u-boot through the USB port.
- The board will boot using the USB drive.
- Copy the contents of the USB drive into the eMMC/Internal flash.
ReFactor
Flashing ReFactor from a USB drive
Get the latest ReFactor image from here: https://github.com/goeland86/ReFactor/releases for example:
wget https://github.com/goeland86/ReFactor/releases/download/v3.0.0-RC4/ReFactor-recore-v3.0.0-RC4.img.xz
Assuming you have managed to boot Recore from a USB flash drive and you have the ReFactor image available in the same folder, you can use dd to do a direct transfer of the image from the USB drive to eMMC.
xz -v -d -c Refactor-recore-v3.0.0-RC3.img.xz | dd of=/dev/mmcblk0
Booting from USB if an OS is present on the eMMC
If the eMMC is parititioned and has an OS, u-boot will launch right into that. In order to override that and boot from a USB dongle, stop u-boot by pressing a key and then write:
setenv devnum 0 run usb_boot
Install Klipper
With ReFactor, klipper comes pre-installed. However some quirks needs to be done in order to get it working.
cd /home/debian mv klippy-env klippy-env-py3 virtualenv -p /usr/bin/python2 klippy-env source klippy-env/bin/activate pip --upgrade pip install pyserial greenlet cffi jinja2 deactivate
After the quirks, restart klipper:
systemctl restart klipper
You can check the log by writing
tail -f /tmp/klippy.log
Install STM32 firmware
This flash scripts requires gpiod
sudo apt install gpiod
cd /home/klipper/klipper cp .config_stm32 .config make sudo ./scripts/flash-stm32.sh out/klipper.bin (might have to be run several times)
Install AR100 firmware
The ar100 needs to be compiled on an x86_64 computer. The reason for this is the lack of an or1k toolchain for aarch64. On a host computer:
cp .config_ar100 .config make scp out/ar100.bin root@recore.local:/home/klipper/klipper/out/
On the Recore board:
sudo /home/klipper/klipper/scripts/flash-ar100.py /home/klipper/klipper/out/ar100.bin
Running Klipper
After a reboot, the ar100 firmware needs to be reflashed. We will get this into an automatic routine eventually, bit for now:
sudo /home/klipper/klipper/scripts/flash-ar100.py /home/klipper/klipper/out/ar100.bin
While details are ironed out there is a script that can be used to restart Klipper that will handle resetting things and setting up the steppers etc.
/home/klipper/klipper/scripts/restart-recore.py
Giving right privileges for AR100 restart
The AR100 flasher and reset script needs to be run as root. We create a group called flashers, add klipper to that and gie the group sudo access to the script
sudo addgroup flashers sudo adduser klipper flashers echo '%flashers ALL=(ALL) NOPASSWD: /home/klipper/klipper/scripts/flash-ar100.py *, /usr/bin/gpioset *' > /etc/sudoers.d/flashers
Install Octoprint
su klipper cd ~ sudo apt update sudo apt install python-pip python-dev python-setuptools python-virtualenv git libyaml-dev build-essential mkdir OctoPrint && cd OctoPrint virtualenv venv source venv/bin/activate pip install pip --upgrade pip install octoprint ./venv/bin/octoprint serve
Add a systemd start-up script
nano /lib/systemd/system/octoprint.service
Add the following content
[Unit] Description=The snappy web interface for your 3D printer After=network-online.target Wants=network-online.target [Service] Type=simple User=klipper ExecStart=/home/klipper/OctoPrint/venv/bin/octoprint [Install] WantedBy=multi-user.target
Enable and start script
sudo systemctl enable octoprint sudo systemctl start octoprint
Manual control and testing
To use the examples in this section, first install gpiod
apt install gpiod
Power domains
There are 9 power domains around the board controlling voltage on different pins:
- Input power controls power to 4 high power outputs, the 4 fans and the 6 stepper drivers. This input has current monitoring, fast acting over current protection, voltage monitoring, temperature monitoring and reverse polarity protection.
- Thermo couple power Controls +5V/1A output to the ADCs. This can be used for turning on power to the analog pins.
- End stop power Controls +5V/1A output on the six endstops. Ganged. ES5 can be switched to have 12V output. The 12V output has a
100mA internal current limit.
- 4 USB host power domains Controls 5V/1A current output to the usb host connectors. These are turned on by u-boot.
- HDMI 5V output Controls the 5V/1A HDMI output. Turned on by u-boot.
Input stage
Reset over current protection and set it in "one-shot" mode.
gpioset 1 193=0 gpioset 1 193=1
The over current protection can also be set in "transparent" mode, where the current alarm will be reset automatically. Note that this is a bad idea for general operation, only use for testing.
gpioset 1 193=0
Enable 24V input
gpioset 1 194=0
End stop 5V /12V
End stop 0 to 4 has a programmable +5V output voltage. End stop 5 has +5V or +12V selectable.
To enable +5V on ES 0...4
gpioset 1 203=1
To disable again
gpioset 1 203=0
To switch to 12V output on ES5
gpioset 1 199=1
To disable again
gpioset 1 199=0
End stops values
To see what value the end stops have
gpioget 1 228 # ES 5 gpioget 1 229 gpioget 1 230 gpioget 1 231 gpioget 1 232 gpioget 1 233 # ES 0
HDMI power
echo 201 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio201/direction echo 1 > /sys/class/gpio/gpio201/value
TMC2209
In window/shell 1:
stty -F /dev/ttyS2 raw -echoe -echo xxd -c 4 /dev/ttyS2
In window/shell 2:
echo -n -e '\x5\x0\x6\x6F' > /dev/ttyS2
The return should be along the lines of
00000000: 0500 066f ...o 00000004: 05ff 0620 ... 00000008: 0001 4058 ..@X
To read the OTP registers
echo -n -e "\x5\x0\x5\x21" > /dev/ttyS2 echo -n -e "\x5\x0\x5\x21" > /dev/ttyS3 echo -n -e "\x5\x1\x5\x97" > /dev/ttyS2 echo -n -e "\x5\x1\x5\x97" > /dev/ttyS3 echo -n -e "\x5\x2\x5\x7a" > /dev/ttyS2 echo -n -e "\x5\x2\x5\x7a" > /dev/ttyS3 echo -n -e "\x5\x3\x5\xcc" > /dev/ttyS2 echo -n -e "\x5\x3\x5\xcc" > /dev/ttyS3
To set the OTP register to use RDSon:
echo -n -e "\x5\x0\x84\x0\x0\xbd\x6\xac" > /dev/ttyS2
To check that no errors are reported by the steppers write this on the command line. If a "1" shows up, that is an indication that the motor is reporting an error.
gpioget 1 128 gpioget 1 129 gpioget 1 130 gpioget 1 131 gpioget 1 132 gpioget 1 133
STM32F031
There is a small firmware to test all functionality that is controlled by the STM32F031 chip on the board. Once uploaded to the board using the flash script, the firmware will turn on all LEDs it controls and send back ADC readings.
To flash this firmware to the STM32:
gpioset 1 197=1 gpioset 1 196=0 stm32flash -i -196,196 -w Sumato-f031.bin -v -g 0x00 /dev/ttyS1 gpioset 1 197=0 stm32flash -i -196,196 /dev/ttyS1
To see the ADC readings:
stty -F /dev/ttyS3 38400 raw cat /dev/ttyS3
You should see something like
ADC T0: 0 ADC T1: 0 ADC T2: 0 ADC T3: 0 ADC U: 2338 ADC I: 0 ADC TB: 3417
The following one-liners assumes gawk is installed.
Reading Current
The current shunt resistor is 1 mOhm, the amplifier is 20 times, the vref is 3.3V, so we get: (adc_val/4096*3.3)*1000/20 = (adc_val/4096)*165 You can convert the current (as in amps) reading to something useful like this:
cat /dev/ttyS4 | awk '/I:/ { printf "scale=4; (%i/4096)*165\n", $3; fflush(); }' | bc -l
Reading Board Temperature
To see the temperature readings, try this :
export beta=4327 cat /dev/ttyS1 | awk '/TB:/ { printf "scale=4; 4327/l( (4700/((3.3/(3.3*%i/4096))-1.0))/0.05306820342563400000) -273.15\n", $3; fflush(); }' | bc -l | awk '{print strftime("%k:%M:%S"), $0; fflush();}'
Reading Input Voltage
To see voltage on the input, it can be converted like this:
exec 4</dev/ttyS4 5>/dev/ttyS4 echo -n ";A4;" >&5 read -t1 reply <&4 echo $reply | awk '{ printf "scale=4; (%i/4096)*3.3*((100+10)/10)\n", $4; fflush(); }' | bc -l
Thermistor inputs
To enable pull-up on input for using thermistors for temperature measurements:
gpioset 1 102=1 gpioset 1 120=1 gpioset 1 160=1 gpioset 1 161=1
Setting Op-amp gain to 1:
gpioget 1 100 gpioget 1 235 gpioget 1 145 gpioget 1 34
In the device tree file, the gpio/ldos must be set to gpio input:
&gpio0_ldo { function = "gpio_in"; };
Thermocouple input
Either a thermocouple or a thermistor can be used as input on the T0-T3 inputs.
Bias
The thermocouple is set up to have a Bias of 0.7V/100 on the input which enables negative values (lower than the board temperature) as input to the ADCs. With the input short circuited, the bias can be recorded. Typical values are 750 This needs to be subtracted from the result.
Cold junction compensation
Another important aspect is cold junction compensation. There is a thermistor connected on the board close to the thermocouple inputs which can be used to measure the temperature close to the input junction. This temperature must be added in software.
For Rev A3, the cold junction compensation is actually located a bit away from the junction, so it might not be accurate. The connected thermistor is a TDK NTCG104EF104FT1X The connected Thermocouple has a (25/100) beta value of 4327. Beta 25/85 used in Klipper is 4308K
In order to use the inputs for thermocouple, the pull-up resistors must be deactivated:
gpioget 1 102 gpioget 1 120 gpioget 1 160 gpioget 1 161
Also, the op-amp needs a gain of 100:
gpioset 1 100=0 gpioset 1 235=0 gpioset 1 145=0 gpioset 1 34=0
Finally, the input bias needs to be enabled. The following LDOs needs to be enabled:
reg_ldo_io0 reg_ldo_io1 reg_dldo3 reg_dldo4
AR100
Please see: AR100
Performance
Start-up time
With a maximum clock for MMC2 of 200 MHz, here is the start-up time:
root@recore-3:~# systemd-analyze Startup finished in 5.128s (kernel) + 11.567s (userspace) = 16.695s graphical.target reached after 11.421s in userspace
Measured voltages
Instruments used:
- Siglent SDM3065X, 6.5 digit multimeter
- HP 3458A, 8.5 digit multimeter
- HP 3245A, Universal Source
Microcontroller voltages
VDDA uC: 3.312 V
VDD uC: 3.312 V
Voltage from the PMIC supplied as bias:
0.706 V
Offset and Gain Measurements
Input voltage measured with SDM3065X, output voltage measured with 3458A. Programmable Voltage reference used was the DIY DAC cape made by Elias. Measurements should be repeated with HP 3245A.
Op-amp gain measurements | ||
---|---|---|
Vin (mV) | Vout (V) | Gain |
1.0103 | 0.754 | 95.73 |
2.0038 | 0.8492 | 95.78 |
3.013 | 0.9457 | 95.72 |
4.0032 | 1.04 | 95.60 |
5.0108 | 1.1372 | 95.78 |
6.0016 | 1.232 | 95.76 |
7.0094 | 1.3285 | 95.76 |
8.0015 | 1.4235 | 95.76 |
9.0106 | 1.5201 | 95.76 |
10.0005 | 1.615 | 95.77 |
11.0102 | 1.7116 | 95.76 |
12.0042 | 1.8067 | 95.75 |
13.0142 | 1.9035 | 95.76 |
14.0056 | 1.9985 | 95.76 |
15.0145 | 2.095 | 95.76 |
16.0055 | 2.1899 | 95.76 |
17.0145 | 2.2865 | 95.75 |
18.0055 | 2.3813 | 95.75 |
19.0163 | 2.4783 | 95.76 |
20.0067 | 2.5723 | 95.72 |
An experiment was done using an HP 3245A and a HP 3458A measuring the input and output voltages and calculating offset and gain. This will become a part of a calibration routine during final testing and flashing, values should be stored with the board.
Input 1 Vin Vout Offset 0.0003 0.6685 0.6685 Vin set Vin Vout Gain Deviation -5 mV -4.9983 0.1840 96.93 0.16 0 mV 0.0003 0.6685 96.76 -0.01 5 mV 5.0000 1.1523 96.77 0.00 10 mV 10.0013 1.6355 96.69 -0.08 15 mV 15.0005 2.1198 96.75 -0.01 20 mV 20.0005 2.6025 96.70 -0.07 Average gain 96.77 Input 2 Vin Vout Offset 0.0017 0.6485 0.6483 Vin set Vin Vout Gain Deviation -5 mV -4.9961 0.1722 95.30 -0.07 0 mV 0.0017 0.6485 95.37 -0.01 5 mV 5.0014 1.1253 95.37 -0.01 10 mV 10.003 1.6025 95.39 0.01 15 mV 15.0021 2.0793 95.38 0.01 20 mV 20.0023 2.5559 95.37 -0.01 Average gain 95.38 Input 3 Vin Vout Offset 0.0013 0.6560 0.6559 Vin set Vin Vout Gain Deviation -5 mV -4.9969 0.1794 95.35 -0.02 0 mV 0.0013 0.6560 95.35 -0.03 5 mV 5.0012 1.1329 95.38 0.01 10 mV 10.0025 1.6098 95.37 -0.01 15 mV 15.0015 2.0864 95.36 -0.02 20 mV 20.0013 2.5631 95.35 -0.02 Average gain 95.36 Input 4 Vin Vout Offset 0.0024 0.6498 0.6496 Vin set Vin Vout Gain Deviation -5 mV -4.9954 0.1714 96.98 1.18 0 mV 0.0024 0.6498 94.50 -1.31 5 mV 5.0015 1.1283 95.96 0.16 10 mV 10.0028 1.6069 95.83 0.02 15 mV 15.0024 2.0853 95.78 -0.02 20 mV 20.0022 2.5642 95.78 -0.02 Average gain 95.81
5V Buck converter ripple and noise
The 5V step down/Buck converter is a AOZ2151PQI-10. It can provide 4A and has an input voltage range of 12-28V. It is hard wired to be in PWM mode. PFM mode results in a loud whine.
Below is a screenshot of the ripple and noise across the the 5V rail with a normal kernel running.
Input stage
An experiment with a constant current load drawing 20 A from the bed connector with and without a 92 mm fan on top of the board for forced convection. The temperature measured was with the on board thermistor. Using a thermal camera, the temperature displayed matches well with the temperature reported by the camera. However, in Rev A2, this is not the hottest point on the board. The MOSFET controlling the bed seems to consistently get the highest temperature. The reason for this is probably due to a 3.3 V VGS.
Inrush current
During turn on of the high power stage, there will be an inrush current to charge up the bank of capacitors present on the board. If no loads are turned on, the inrush current reaches 31 A at peak. This is important to consider when setting the current limit with device tree.
Temperature low pass filter
A Low pass filter has been added on each of the temperature input channels. The cut-off frequency is below what my oscilloscope can handle, but a plot in the time domain verifies a 7 Hz -3dB point.
ADC offset and gain measurements
To measure the ADC offset error, measure the voltage on the uC input pin and record when the transition from 0 to 1 occurs. It should occur at 0.5 LSB = 3.3/4096/2 = 0.4028 mV. Offset: 55.35 mV - 0.4028 mV = 54.95 mV
FAQ
Q: Where can I ask for help?
A: You can join the Discord: https://discord.gg/bCnp9H5SB5
Q: What comes in the box with the Recore? Specifically, terminal connectors for power, etc?
A: It's only the board, no connectors at all.
There will be a bag of connectors available to purchase eventually, but for now you will have to supply your own.
Q: What's the maximum current draw for heat bed?
A: This has been tested up to 20 A
Q Why are there unused and unbroken out pins on the STM32 MCU?
A: The pins that are needed from the MCU have been routed out plus two pins available on an external header.
Q: I have a gadget that I want to connect with SPI. Is that possible?
A: There are 6 pins available from the main SoC that can be used for various things.
There is no hardware SPI, but you can make a program that uses soft SPI. There is no dedicated I2C, but perhaps that would be a nice addition.
Q: What exactly is the role of the AR100 device?
A: The AR100 handles the fast realtime aspects, mainly the stepper motors
Q: What voltage fans are supported?
A: The same voltage as the input voltage, either 12 V or 24 V. You can experiment with PWM for running lower voltage fans on 24 V input
Q: Where is the board layout file?
A: The Layout file will not be available. It is an "open schematic" board, not open source hardware.
Q: Where are you shipping from?
A: Early prototypes (Rev A4) will be shipping from Norway. Eventually shipping will be from a warehouse in the US
Known Issues
Too low capacitance on USB nodes
High current draw on USB lines can cause instability in some devices. Specifically having a webcam or a wifi dongle and a Manga Screen 2 can cause flicker on the screen.
Manga Screen EDID not always read correctly
There seems to be a timing issue with powering the display and reading the EDID. The EDID is not always read correctly during boot.
Ethernet adapter not reset correctly
Often times the ethernet chip is not reset correctly. The symptoms are that no IP address is given to the board. A possible workaround is a manual reset of the eth chip:
gpioset 1 110=0 sleep 1 gpioget 1 110
Reboot possibly not working when power by USB
It seems that powering the board by USB might cause reboot to have problems. Needs verification.