# Configure Marlin for tool changing system

I am planning to build a CoreXY machine with a tool changing system. I am using Marlin firmware and BigTreeTech SKR PRO as the controller board. There are 3 options in Marlin for tool changing systems:

I want to use the switching tool head in my project using a servo/stepper motor. So I have 2 questions:

1. Should I use a servo or stepper motor? Which one does the board and firmware support?
2. Where should I connect the servo/stepper on the SKR PRO and what should the value of SWITCHING_TOOLHEAD_SERVO_NR be?

Note: I am also using a BLTouch leveling sensor So I can't connect the servo to the BLTouch servo port.

Edit: After so much research, finally, I found the way to do this. For the first question, Servo is the best choice. First, we need to configure tool change x and y position and servo rotation angle in configuration.h file and leave SWITCHING_TOOLHEAD_SERVO_NR as it is. Also, uncomment #define NUM_SERVOS and set it to 2.Then we need to open Marlin\src\pins\stm32f4\pins_BTT_SKR_PRO_common.h file and in the Servos section, add the following line:

#define SERVO1_PIN                          PC9


In the end, connect the servo signal pin to the PC9 pin on extension 1 and the VCC and GND pin to the pins next to the PC9 pin that are GND and 5V.

Note: I haven't tested this because I don't have this board. If this way doesn't work, please tell me in comments.

• To my knowledge a single PWM pin in exposed on extension port 1, but recalling Arduino tinkering you can use any digital or analog pin for a servo. For a stepper you require more pins to control the movement, how many tools are you focussing on? Each tool requires a feeder stepper... E3D uses Duet boards, they have many options for additional steppers (either through extension boards). – 0scar Sep 1 '20 at 7:53
• @0scar SKR PRO has 3 extruder outputs and because I use 2 of them, 1 of them (e2) will be unused. Also, my preference is to use a servo motor. But I don't know how to connect it to the board and configure marlin for it (pins.h, configuration.h,configuration_adv.h) – Mahan Lameie Sep 1 '20 at 8:40

1. Use a servo. This way you can use the digital pins to control it; or in your specific case PWM_PC9
• Thanks for your answer. Can you please tell me what SWITCHING_TOOLHEAD_SERVO_NR is and how can I use it, if you know? – Mahan Lameie Sep 1 '20 at 7:46
• First, we need to configure tool change x and y position and servo rotation angle in configuration.h file and leave SWITCHING_TOOLHEAD_SERVO_NR as it is. Also, uncomment #define NUM_SERVOS and set it to 2.Then we need to open Marlin\src\pins\stm32f4\pins_BTT_SKR_PRO_common.h file and in the Servos section, add the following line: #define SERVO1_PIN PC9 In the end, connect the servo signal pin to the PC9 pin on extension 1 and the VCC and GND pin to the pins next to the PC9 pin that are GND and 5V. – Mahan Lameie Sep 2 '20 at 16:36