Difference between revisions of "Retool A2"

From iagent
Jump to: navigation, search
(Klipper config)
(Pinout diagram)
Line 18: Line 18:
 
[[File:Retool A2 pinout diagram 1.png]]
 
[[File:Retool A2 pinout diagram 1.png]]
 
</div>
 
</div>
 +
 +
{| class="wikitable" style="width: 100%;
 +
! Name !! GPIO !!style="border-right:solid 2px;"| Number !! Name !! Bank and pin !!style="border-right:solid 2px;"| Number !! Name !! Bank and pin !! Number
 +
|-
 +
| STEP || GPIO6 ||style="border-right:solid 2px;"| 6 || END STOP 0 || PH4 ||style="border-right:solid 2px;"|228 || OC-ALERT || PF6 || 166
 +
|-
 +
| DIR || GPIO5 ||style="border-right:solid 2px;"| 5 || END STOP 1 || PH5 ||style="border-right:solid 2px;"| 229 || OC-RESET || PF4 || 164
 +
|-
 +
| ENN || GPIO10 ||style="border-right:solid 2px;"| 10 || END STOP 2 || PH6 ||style="border-right:solid 2px;"| 230 || EN-HP || PF5 || 165
 +
|-
 +
| CLK || GPIO8 ||style="border-right:solid 2px;"| 8 || END STOP 3 || PH7 ||style="border-right:solid 2px;"| 231 || UC-INT-1 || PG3 || 195
 +
|-
 +
| DIAG || GPIO9 ||style="border-right:solid 2px;"| 9 || END STOP 4 || PH8 ||style="border-right:solid 2px;"| 232 || UC-NRST || PG4 || 196
 +
|-
 +
| STEP 5 || PL9 ||style="border-right:solid 2px;"| 9 || END STOP 5 || PH9 ||style="border-right:solid 2px;"| 233 || UC-BOOT || PG5 || 197
 +
|-
 +
| STEP 6 || PL10 ||style="border-right:solid 2px;"| 10 || GAIN-ENABLE-T0 || PD4 ||style="border-right:solid 2px;"| 100 || ES-EN-12V || PF0 || 160
 +
|-
 +
| STEP 7 || PL11 ||style="border-right:solid 2px;"| 11 || GAIN-ENABLE-T1 || PH11 ||style="border-right:solid 2px;"| 235 || EN-THERMISTORS || PF1 || 161
 +
|-
 +
| DIR 0 || PE8 ||style="border-right:solid 2px;"| 136 || GAIN ENABLE T2 || PE17 ||style="border-right:solid 2px;"| 145 || EN-ENDSTOPS || PF2 || 162
 +
|-
 +
| DIR 1 || PE9 ||style="border-right:solid 2px;"| 137 || GAIN ENABLE T3 || PB2 ||style="border-right:solid 2px;"| 34 || USR-BTN || PB3 || 35
 +
|-
 +
| DIR 2 || PE10 ||style="border-right:solid 2px;"| 138 || PU-ENABLE-T0 || PG10 ||style="border-right:solid 2px;"| 202 || USR-PIN || PF3 || 163
 +
|-
 +
| DIR 3 || PE11 ||style="border-right:solid 2px;"| 139 || PU-ENABLE-T1 || PG11 ||style="border-right:solid 2px;"| 203 || SBU1 || PC0 || 64
 +
|-
 +
| DIR 4 || PE12 ||style="border-right:solid 2px;"| 140 || PU ENABLE T2 || PG12 ||style="border-right:solid 2px;"| 204 || SBU2 || PC2 || 66
 +
|-
 +
| DIR 5 || PE13 ||style="border-right:solid 2px;"| 141 || PU ENABLE T3 || PG13 ||style="border-right:solid 2px;"| 205 ||  ||  ||
 +
|-
 +
| DIR 6 || PE14 ||style="border-right:solid 2px;"| 142 || OFFSET-T0 || PG0 ||style="border-right:solid 2px;"| 192 ||  ||  ||
 +
|-
 +
| DIR 7 || PE15 ||style="border-right:solid 2px;"| 143 || OFFSET-T1 || PG1 ||style="border-right:solid 2px;"| 193 ||  ||  ||
 +
|-
 +
| STEP DIAG 0 || PE0 ||style="border-right:solid 2px;"| 128 || OFFSET-T2 || PG3 ||style="border-right:solid 2px;"| 194 ||  ||  ||
 +
|-
 +
| STEP DIAG 1 || PE1 ||style="border-right:solid 2px;"| 129 || OFFSET-T3 || PG8 ||style="border-right:solid 2px;"| 200 ||  ||  ||
 +
|-
 +
| STEP DIAG 2 || PE2 ||style="border-right:solid 2px;"| 130 || STEPPER UART 0-3 || PE16 ||style="border-right:solid 2px;"| 144 ||  ||  ||
 +
|-
 +
| STEP DIAG 3 || PE3 ||style="border-right:solid 2px;"| 131 || STEPPER UART 4-5 || PD24 ||style="border-right:solid 2px;"| 120 ||  ||  ||
 +
|-
 +
| STEP DIAG 4 || PE4 ||style="border-right:solid 2px;"| 132 || STEPPER UART 6 || PD2 ||style="border-right:solid 2px;"| 98 ||  ||  ||
 +
|-
 +
| STEP DIAG 5 || PE5 ||style="border-right:solid 2px;"| 133 || STEPPER UART 7 || PD3 ||style="border-right:solid 2px;"| 99 ||  ||  ||
 +
|-
 +
| STEP DIAG 6 || PD0 ||style="border-right:solid 2px;"| 96 || STEPPERS ENABLE || PL12 ||style="border-right:solid 2px;"|  ||  ||  ||
 +
|-
 +
| STEP DIAG 7 || PD1 ||style="border-right:solid 2px;"| 97 ||  ||  ||style="border-right:solid 2px;"|  ||  ||  ||
 +
|}
  
 
==Wire diagram==
 
==Wire diagram==

Revision as of 10:41, 30 May 2025

Retool and Resend A2.png

Retool is a USB based tool head that works well with Recore. It has

  • 1 TMC2209 stepper motor driver for an extruder
  • 1 ADXL343 accelerometer for input shaping
  • 1 Mosfet for a heater
  • 1 Input for thermistor
  • 3 Fan outputs with tach feedback
  • 1 Peltier cooling output
  • 1 inductive probe input
  • 1 Neopixel output
  • 2 End stop inputs

Pinout diagram

Retool A2 pinout diagram 1.png

Name GPIO Number Name Bank and pin Number Name Bank and pin Number
STEP GPIO6 6 END STOP 0 PH4 228 OC-ALERT PF6 166
DIR GPIO5 5 END STOP 1 PH5 229 OC-RESET PF4 164
ENN GPIO10 10 END STOP 2 PH6 230 EN-HP PF5 165
CLK GPIO8 8 END STOP 3 PH7 231 UC-INT-1 PG3 195
DIAG GPIO9 9 END STOP 4 PH8 232 UC-NRST PG4 196
STEP 5 PL9 9 END STOP 5 PH9 233 UC-BOOT PG5 197
STEP 6 PL10 10 GAIN-ENABLE-T0 PD4 100 ES-EN-12V PF0 160
STEP 7 PL11 11 GAIN-ENABLE-T1 PH11 235 EN-THERMISTORS PF1 161
DIR 0 PE8 136 GAIN ENABLE T2 PE17 145 EN-ENDSTOPS PF2 162
DIR 1 PE9 137 GAIN ENABLE T3 PB2 34 USR-BTN PB3 35
DIR 2 PE10 138 PU-ENABLE-T0 PG10 202 USR-PIN PF3 163
DIR 3 PE11 139 PU-ENABLE-T1 PG11 203 SBU1 PC0 64
DIR 4 PE12 140 PU ENABLE T2 PG12 204 SBU2 PC2 66
DIR 5 PE13 141 PU ENABLE T3 PG13 205
DIR 6 PE14 142 OFFSET-T0 PG0 192
DIR 7 PE15 143 OFFSET-T1 PG1 193
STEP DIAG 0 PE0 128 OFFSET-T2 PG3 194
STEP DIAG 1 PE1 129 OFFSET-T3 PG8 200
STEP DIAG 2 PE2 130 STEPPER UART 0-3 PE16 144
STEP DIAG 3 PE3 131 STEPPER UART 4-5 PD24 120
STEP DIAG 4 PE4 132 STEPPER UART 6 PD2 98
STEP DIAG 5 PE5 133 STEPPER UART 7 PD3 99
STEP DIAG 6 PD0 96 STEPPERS ENABLE PL12
STEP DIAG 7 PD1 97

Wire diagram

Retool A2 wire diagram.png

3D model

3D model for using Retool A2 with Voron 2.4/Stealthburner https://www.printables.com/model/1190587-voron-24-retool-a2-holder

Klipper config

Scheamtics.png
[mcu retool]
serial: /dev/serial/by-id/usb-Klipper_rp2040_E661AC8863905924-if00

[static_digital_output retool_led]
pins: retool:gpio2

[output_pin fan_r_1]
pin: retool:gpio1

[output_pin fan_r_2]
pin: retool:gpio12

[output_pin fan_r_3]
pin: retool:gpio21

[tmc2209 extruder3]
uart_pin: retool:gpio7
uart_address: 0
run_current: 0.500
hold_current: 0.500
sense_resistor: 0.1
stealthchop_threshold: 250

#endstop_pin: retool:gpio4
#enable_pin: !retool:gpio10
#rotation_distance: 40
#microsteps: 16
#position_endstop: 0
#position_max: 200
#homing_speed: 20.0

[extruder3]
step_pin: retool:gpio6
dir_pin: retool:gpio5
heater_pin: retool:gpio0
sensor_type: EPCOS 100K B57560G104F
sensor_pin: retool:gpio28
rotation_distance: 40
microsteps: 16
nozzle_diameter: 0.400
filament_diameter: 1.75
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_extrude_temp: 30
min_temp: -272
max_temp: 300

[verify_heater extruder3]
check_gain_time: 2400

[adc_temperature retool_fan_current_0]
temperature1: 0
voltage1: 0
temperature2: 33
voltage2: 3.3

[temperature_sensor retool_fan_current_0]
adc_voltage: 3.3
sensor_pin: remote:gpio29
sensor_type: remote_fan_current_0
max_temp: 2.0
gcode_id: RemoteFanCurrent0

[adxl345]
cs_pin: remote:gpio25
spi_bus: spi1c

[resonance_tester]
accel_chip: adxl345
probe_points:
    100, 100, 20  # an example
    
[probe]
pin: remote:gpio22
#--------------------------------------------------------------------
x_offset: 0
y_offset: 25.0
z_offset: 0	
speed: 10.0
samples: 3
samples_result: median
sample_retract_dist: 3.0
samples_tolerance: 0.01
samples_tolerance_retries: 3

# Set this high to use GPIO20 as high frequency input
[static_digital_output Relit_direction]
pins: !remote:gpio19

[neopixel relit]
pin: remote:gpio20
chain_count: 12


[fan peltier]
pin: remote:gpio3
max_power: 0.1
cycle_time: 0.00001 #0.01
hardware_pwm: True


serial: /dev/serial/by-id/usb-Klipper_rp2040_E66368651B257D22-if00

[static_digital_output remote_led]
pins: remote:gpio2

[static_digital_output nepixel_dir]
pins: !remote:gpio19

[fan]
pin: remote:gpio21
tachometer_pin: remote:gpio23
cycle_time: 0.10

[fan_generic peltier]
pin: remote:gpio3
hardware_pwm: True
cycle_time: 0.000001

[heater_fan hotend_fan]
pin: remote:gpio1
heater: extruder
heater_temp: 50.0

[tmc2209 extruder]
uart_pin: remote:gpio7
uart_address: 0
run_current: 0.800
hold_current: 0.500
sense_resistor: 0.1
stealthchop_threshold: 0

[extruder]
step_pin: remote:gpio6
dir_pin: remote:gpio5
enable_pin: !remote:gpio10
heater_pin: remote:gpio0
sensor_type: ATC Semitec 104GT-2
sensor_pin: remote:gpio28
##  Update value below when you perform extruder calibration
##  If you ask for 100mm of filament, but in reality it is 98mm:
##  rotation_distance = <previous_rotation_distance> * <actual_extrude_distance> / 100
##  22.6789511 is a good starting point
rotation_distance: 22.6789511   #Bondtech 5mm Drive Gears
gear_ratio:  50:10              #BMG Gear Ratio
microsteps: 16
nozzle_diameter: 0.800
filament_diameter: 1.75
control: pid
pid_Kp=28.278
pid_Ki=1.611
pid_Kd=124.070
min_extrude_temp: 15
min_temp: -273
max_temp: 500
pressure_advance: 0.03
##  Default is 0.040, leave stock
pressure_advance_smooth_time: 0.040

[adc_temperature remote_current]
temperature1: 0
voltage1: 0
temperature2: 10
voltage2: 1.0

[temperature_sensor remote_current]
adc_voltage: 3.3
sensor_pin: remote:gpio29
sensor_type: remote_current
max_temp: 3.0

[temperature_sensor remote_mcu]
sensor_type: temperature_mcu
sensor_mcu: remote

[adxl345]
cs_pin: remote:gpio25
spi_bus: spi1c

[resonance_tester]
accel_chip: adxl345
probe_points:
    125, 125, 20
    
[probe]
pin: remote:gpio4
x_offset: 0
y_offset: 25.0
z_offset: 0
speed: 10.0
samples: 3
samples_result: median
sample_retract_dist: 3.0
samples_tolerance: 0.01
samples_tolerance_retries: 3

[neopixel relit_head]
pin: remote:gpio20
chain_count: 4
initial_RED: 1.0
initial_GREEN: 1.0
initial_BLUE: 1.0

Klipper firmware compilation

The unit comes with firmware pre-installed. If you want to upgrade the firmware, these are the steps to reproduce. This can be done directly from Recore, or from a regular computer. If the device ID doesn't match, the board is not in DFU mode, and needs to be manually started that way. Use a paperclip or some wire, unplug the USB of the device, short the two round pads on the back of the PCB and plug in the USB. At that point the RP2040 will be in DFU mode, allowing it to be flashed.

cd /home/debian/klipper
cp test/configs/rp2040.config .config
make olddefconfig
make -j
make flash FLASH_DEVICE="2e8a:0003"

After that, the board should be visible as OpenMoko, Inc. rp2040

Screenshot from 2024-09-04 18-41-48.png

Enter boot mode from the command line

cd /home/debian/klipper/scripts
python3 -c 'import flash_usb as u; u.enter_bootloader("<DEVICE>")'
Entering bootloader on <DEVICE>

<DEVICE> is typically "/dev/ttyACM0" or similar.