MPCNC BTT Octopus firmware help

Hi guys, first of all hi to everyone! I’m new in this forum as well as in the CNC world.
I have a lot of experience in 3D printers (almost exclusively with Klipper firmware) but I find myself out of my element when dealing with Marlin.
I wanted to ask if someone might be able to help me in building a firmware that will work with a BTT Octopus Pro, since I have some of them at home, and I’m trying to use as most of my stuff as I can, to reduce the build cost.
Thanks to everyone that will take the time to even read!

1 Like

Put klipper on it.

Edit: seriously. I had some issues doing it. But it appears it will work now. I’m going to do a test cut this evening with it and it should be fine. The artifacts I was seeing did translate to movements. Those are not there anymore and I expect it to just work.

2 Likes

cnc features are highly experimental and not officially supported in Klipper, since I’m new to the cnc world and I don’t have (at least for now) a ton of time to put into it, I wanted to put Marlin so at least I can follow all the guides and ask for help since 99% of people who built MPCNC use that… also since it works on the SKR it should be quite easy to make it work on the octopus, I just needed a couple of hints on how to build the firmware correctly with VSC… if someone can give me a hand I will be very grateful, if not ill just buy the SKR board

The biggest catches are getting the dual motor axes set up. Dual X and dual Y and of course the dual endstops to go with.

I used an SKR Pro for Marlin so of course the pre-configured firmware worked fine, and I never looked into it past that.

I did switch from the Marlin, but to a Duet board and RepRap Firmware.

Consider downloading the SKR Pro firmware and looking at the setup for the X and Y axes, then make changes to the Octopus standard firmware to match. If you aren’t good with the firmware editing and debugging, a supported board is your best bet. That said, I think some people have used the Octopus successfully.

If you are buying a board, I would suggest that the Jackpot board Jackpot CNC Controller – V1 Engineering Inc is a great option. FluidNC is very much adapted for CNC (GRBL compatable) and the Jackpot board will come with the selected firmware flashed and tested.

1 Like

I understand that the support angle, but not the “highly” experimental part. Totally your call.

There is some detail that must be combed through to make it work. I now have 2 cncs running it. Given what you are doing for the octopus to run Marlin, the configuration work is similar. It is all about assigning pins in the config file and plugging things in, checking, changing, and reflashing for marlin or rebooting for klipper. These cncs are effectively 3d printers minus the extruder.

The last time I checked there wasn’t much about using Klipper with CNCs, but lot of time has passed, so if now the situation got better, I surely will go for the Klipper way. Also because I built countless printers so I can debug things much much faster with Klipper than with Marlin, which the last time I used was probably 3 years ago. Do you have some links to GitHub or stuff like that for CNCs cfgs with Klipper? or guides and stuff like that, for reference. Thank you!

I think I’ll try the Klipper way since I already have all the hardware at home. If I’ll not succeed, I’ll buy the board you suggested me. Only thing that held me back from buying at the V1 store directly is that I live in Italy, so shipping time and cost will be higher, and I have to deal with customs (which is annoying and there are random taxes based on the guy humor)

Gotcha.

FYI, the Jackpot could be ordered from JLPCB (manufacturer) which will probably cost a bit less and might be faster. Still imported from China though, so no escaping the customs roulette wheel.

In the EU zone, Duet hardware might be a good choice too. Not many of us use it, but I’ve set up a few V1 CNC machines with the Duet hardware, and there are others here.

Well, others have done Klipper as well, so you should be able to get it sorted.

I’ll share my mpcnc config and my MP3DP config. The mpcnc runs an skr, but it has the macros for CNC. And the mp3dp has the pin assignments for the octopus. By combining the pin assignments from the octopus with the stripped down (extruderless) setup on the skr. You should be off and running in a short amount of time. The rub here is I can’t send it until I get back home late this evening. You may figure it out by then. There are skr config fragments in that thread linked above.

the big secret for klipper with a cnc: all you need is a few custom macros for CNC and removing all extruder references.

I’d suggest googling an image of your octopus and knowing the pin names and where you plan to connect X1 and Y1 that are the second channel for those axes. Both boards run TMC2209 stepper controllers.

skr code:

[include mainsail.cfg]

# Specs:
# - SKR 1.2 Pro
# - TMC2209
# - 1.8 stepper on XYZ
# - Dual X (X and E0 = X1)
# - Dual Y (Y and E1 = Y1)
# - Dual Physical endstops on X
# - Dual Physical endstops on Y
# - Fysetc Mini 12864 LCD Display v2.1 RGB

[mcu]
serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_410053000451313036333036-if00
#[mcu] 
#serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_12345-if00 

[printer] 
kinematics: cartesian 
max_velocity: 3000 
max_accel: 550 
max_accel_to_decel: 350 
max_z_velocity: 75 
max_z_accel: 150 
square_corner_velocity: 1 

[gcode_arcs] 
resolution: 10

[pause_resume] 
recover_velocity: 50

[skew_correction] 

[display_status] 

#####################################################################
# X Stepper Settings
#####################################################################

[stepper_x]
homing_positive_dir: False
step_pin: PE9
dir_pin: PF1
enable_pin: !PF2
endstop_pin: PB10
homing_retract_dist: 0
microsteps: 32
rotation_distance: 32
full_steps_per_rotation: 200
position_min: -25
position_endstop: -3
position_max: 500
homing_speed: 70.0

[tmc2209 stepper_x]
uart_pin: PC13
diag_pin: PB10
run_current: 0.850
hold_current: 0.500
stealthchop_threshold: 200
#driver_SGTHRS: 120 # 255 is most sensitive value, 0 is least sensitive 

[stepper_x1]
step_pin: PE14
dir_pin: !PA0
enable_pin: !PC3
endstop_pin: PE15
microsteps: 32
rotation_distance: 32
full_steps_per_rotation: 200
#position_min: 0
#position_endstop: 0
#position_max: 250
#homing_speed: 70.0

[tmc2209 stepper_x1]
uart_pin: PD4
diag_pin: PE12
run_current: 0.850
hold_current: 0.500
stealthchop_threshold: 200

#####################################################################
# Y Stepper Settings
#####################################################################

[stepper_y]
homing_positive_dir: False
step_pin: PE11
dir_pin: !PE8
enable_pin: !PD7
endstop_pin: PE12
microsteps: 32
rotation_distance: 32
full_steps_per_rotation: 200
position_min: -30
position_endstop: -19
position_max: 790
homing_speed: 70.0

[tmc2209 stepper_y]
uart_pin: PE3
diag_pin: PE12
run_current: 0.850
hold_current: 0.500
stealthchop_threshold: 200

[stepper_y1]
step_pin: PD15
dir_pin: PE7
enable_pin: !PA3
endstop_pin: PE10
microsteps: 32
rotation_distance: 32
full_steps_per_rotation: 200
#position_min: 0
#position_endstop: 0
#position_max: 225
#homing_speed: 70.0

[tmc2209 stepper_y1]
uart_pin: PD1
diag_pin: PE10
run_current: 0.850
hold_current: 0.500
stealthchop_threshold: 200

#####################################################################
# Z Stepper Settings
#####################################################################

[stepper_z]
step_pin: PE13
dir_pin: PC2
enable_pin: !PC0
endstop_pin: !PG8
microsteps: 32
rotation_distance: 8
full_steps_per_rotation: 200
homing_positive_dir: False
position_endstop: 2
position_max: 90
homing_speed: 5.0
position_min: -75


[tmc2209 stepper_z]
uart_pin: PE1
diag_pin: PG8
run_current: 0.850
hold_current: 0.600
stealthchop_threshold: 100

#####################################################################
# Fans
#####################################################################

#[controller_fan tmc_fan]

[fan_generic tmc_fan]
# stepper fan
pin: PC8

[fan]
#for box
pin: PE5

[temperature_fan pi]
pin: PE6
sensor_type: temperature_host
min_temp: 10
max_temp: 90
control: pid
pid_Kp: 2
pid_Ki: 4
pid_kd: 0.1

#####################################################################
# Display (like one for marlin with a button)
#####################################################################

[board_pins]
aliases:
    EXP1_1=PG4, EXP1_3=PD11, EXP1_5=PG2, EXP1_7=PG6, EXP1_9=<GND>,
    EXP1_2=PA8, EXP1_4=PD10, EXP1_6=PG3, EXP1_8=PG7, EXP1_10=<5V>,
    EXP2_1=PB14, EXP2_3=PG10, EXP2_5=PF11, EXP2_7=PF12,  EXP2_9=<GND>,
    EXP2_2=PB13, EXP2_4=PB12, EXP2_6=PB15, EXP2_8=<RST>, EXP2_10=PF13

# Fysetc Mini 12864 LCD Display
#[display]
#lcd_type: uc1701
#cs_pin: EXP1_3
#a0_pin: EXP1_4
#rst_pin: EXP1_5
#contrast: 63
#encoder_pins: ^EXP2_5, ^EXP2_3
#menu_reverse_navigation: True
#click_pin: ^!EXP1_2
#3spi_software_miso_pin: EXP2_1
#spi_software_mosi_pin: EXP2_6
#spi_software_sclk_pin: EXP2_2
#menu_timeout: 30


##  mini12864 LCD Display
[display]
lcd_type: uc1701
cs_pin: EXP1_3
a0_pin: EXP1_4
rst_pin: EXP1_5
encoder_pins: ^EXP2_5, ^EXP2_3
click_pin: ^!EXP1_2
contrast: 63
spi_software_miso_pin: EXP2_1
spi_software_mosi_pin: EXP2_6
spi_software_sclk_pin: EXP2_2

##  To control Neopixel RGB in mini12864 display
[neopixel btt_mini12864]
pin: EXP1_6
chain_count: 3
initial_RED: 0.1
initial_GREEN: 0.5
initial_BLUE: 0.8
color_order: RGB

##  Set RGB values on boot up for each Neopixel. 
##  Index 1 = display, Index 2 and 3 = Knob
[delayed_gcode setdisplayneopixel]
initial_duration: 1
gcode:
        SET_LED LED=btt_mini12864 RED=1 GREEN=0 BLUE=1 INDEX=2 TRANSMIT=0
#        SET_LED LED=btt_mini12864 RED=1 GREEN=0 BLUE=0 INDEX=2 TRANSMIT=0
#        SET_LED LED=btt_mini12864 RED=1 GREEN=0 BLUE=0 INDEX=3 
#----------------------------------------------------------------------------------------------------------------------------------------------


#####################################################################
# Misc
#####################################################################
[force_move]
enable_force_move: True

[pause_resume]

[virtual_sdcard]
path: ~/printer_data/gcodes

[save_variables]
filename: ~/printer_data/.saved_variables/variables.cfg

######################################################################
# Macros to interpret gcode from marlin post processor
######################################################################

[gcode_macro M03]
gcode:  
    M3 {% for p in params %}{'%s%s' % (p, params[p])}{% endfor %}

[gcode_macro M05]
gcode:  
    M5 {% for p in params %}{'%s%s' % (p, params[p])}{% endfor %}

[gcode_macro G00]
gcode:  
    G1 {% for p in params %}{'%s%s' % (p, params[p])}{% endfor %}
    
[gcode_macro G01]
gcode: 
    G1 {% for p in params %}{'%s%s' % (p, params[p])}{% endfor %}

[gcode_macro G02]
gcode: 
    G2 {% for p in params %}{'%s%s' % (p, params[p])}{% endfor %}

[gcode_macro G03]
gcode: 
    G2 {% for p in params %}{'%s%s' % (p, params[p])}{% endfor %}

[gcode_macro G04]
gcode: 
    G4 {% for p in params %}{'%s%s' % (p, params[p])}{% endfor %}

[gcode_macro DUMP_VARIABLES]
gcode:
    {% set filter_name = params.NAME|default('')|string|lower %}
    {% set filter_value = params.VALUE|default('')|string|lower %}
    {% set show_cfg = params.SHOW_CFG|default(0)|int %}
    
    {% set out = [] %}

    {% for key1 in printer %}
        {% for key2 in printer[key1] %}
            {% if (show_cfg or not (key1|lower == 'configfile' and key2|lower in ['config', 'settings'])) and (filter_name in key1|lower or filter_name in key2|lower) and filter_value in printer[key1][key2]|string|lower %}
                {% set dummy = out.append("printer['%s'].%s = %s" % (key1, key2, printer[key1][key2])) %}
            {% endif %}
        {% else %}
            {% if filter_name in key1|lower and filter_value in printer[key1]|string|lower %}
                {% set dummy = out.append("printer['%s'] = %s" % (key1, printer[key1])) %}
            {% endif %}
        {% endfor %}
    {% endfor %}
    
    {action_respond_info(out|join("\n"))}

################################################################
# MACROS for CNC
##################################################################

#[gcode_macro SET_TOOLHEAD_OFFSET] 
#gcode: {% set xo = 
#  printer.toolhead.position.x|float %} {% set yo = 
#  printer.toolhead.position.y|float %} {% set zo = 
#  printer.toolhead.position.z|float %} 
#  SET_GCODE_OFFSET x={xo} y={yo} z={zo}

#[gcode_macro CLEAR_TOOLHEAD_OFFSET] 
#gcode: 
#  SET_GCODE_OFFSET x=0 y=0 z=0 

#[gcode_macro TOOL_ON] 
#gcode:
#  SET_PIN PIN=tool_power VALUE=1 
#  SET_PIN PIN=tool_power_led VALUE=1 

#[gcode_macro TOOL_OFF] 
#gcode:
#  SET_PIN PIN=tool_power VALUE=0 
#  SET_PIN PIN=tool_power_led VALUE=0 

[gcode_macro HOME_XY] 
gcode:
  #G28 Z 
  G91
  G0 Z5
  G90
  G28 XY 
  #SET_SKEW XY=1701.8,1700.6875,1200 

[gcode_macro PARK_TOOL] 
gcode: 
  {action_respond_info("*** REMINDER: switch off spindle manually ***")} 
  #TOOL_OFF 
  #CLEAR_TOOLHEAD_OFFSET 
  #G0 Z65 
 # G0 X40 Y50 
 # G1 Z25

[gcode_macro  FAKE_HOME]  
# this homes the machine to move it without actually using end stops
gcode:
  SET_KINEMATIC_POSITION X=0 Y=0 Z=0

[gcode_macro  FAKE_XY]
gcode:
  SET_KINEMATIC_POSITION X=0 Y=0

[gcode_macro  FAKE_Z]
gcode:
  SET_KINEMATIC_POSITION Z=0

[gcode_macro FW_RESTART] 
gcode: 
  FIRMWARE_RESTART 

#[gcode_macro WORKSPACE_1]
# Configured for 25.4mm stock height, 9mm spoilboard height, 6in stock width
#gcode: 
#  SET_GCODE_OFFSET x=0 y=0 z=0 
#  g0 z68 
#  g0 x322 y315 
#  g0 z64.4 
#  SET_GCODE_OFFSET x=322 y=315 z=39

#[gcode_macro TOOLCHANGE] 
#gcode: 
#  g0 z36 
#  g0 x-40 y-40 

#[gcode_macro TOOL_Z0] 
#gcode: 
#  g0 z36 
#  g0 x-40 y10 
#  g0 z0

This file works on my mpcnc with post processed code from estlcam. I have more testing to do with it, but it will run the files.

This is the mp3dp octopus code for just the pin assignments. I’m pretty sure I went channels 12345 for X,Y,Z,Z1,Z2

[tmc2209 extruder]
uart_pin: PE4
run_current: 0.70
stealthchop_threshold: 0 #999999

[tmc2209 stepper_x]
uart_pin: PC4
#diag_pin: PG6
run_current: 1 #AZA was 0.8
interpolate: False  
stealthchop_threshold: 0 #999999

[tmc2209 stepper_y]
uart_pin: PD11
#diag_pin: PG9
run_current: 1 #AZA was 0.8
interpolate: False
stealthchop_threshold: 0 # 999999

[tmc2209 stepper_z]
uart_pin: PC6
#diag_pin: PG10
run_current: 0.75
hold_current: 0.4
interpolate: False
stealthchop_threshold: 0 #999999

[tmc2209 stepper_z1]
uart_pin: PC7
#diag_pin: PG11
run_current: 0.75
hold_current: 0.4
interpolate: False
stealthchop_threshold: 0 #999999

[tmc2209 stepper_z2]
uart_pin: PF2
#diag_pin: PG12
run_current: 0.75
hold_current: 0.4
interpolate: False
stealthchop_threshold: 0 #999999

# driver 5 : uart_pin: PE4
# driver 6 : uart_pin: PE1
# driver 7 : PD3

###############################################################################################################################################
# motor definitions
################################################

# Driver0  This is the B motor on the left side

[stepper_x]
enable_pin: !PF14
step_pin: PF13
dir_pin: PF12
endstop_pin: PG6 ##carriage trigger
microsteps: 16
rotation_distance: 32
position_endstop: 0
position_max: 300
homing_speed: 100
second_homing_speed: 3

# Driver1  this is the A motor on the right side

[stepper_y]
enable_pin: !PF15
step_pin: PG0
dir_pin: PG1
endstop_pin: PG9 #left motor
microsteps: 16
rotation_distance: 32
position_endstop: 0
position_max: 300
homing_speed: 100
second_homing_speed: 3

## Driver2 for 1 of 3 z motors
#(front left)

[multi_pin z_enable]
pins: !PG5, PA9 #PG14

[stepper_z]
enable_pin: multi_pin:z_enable
step_pin: PF11
dir_pin: PG3
microsteps: 16
rotation_distance: 32
endstop_pin: probe:z_virtual_endstop
position_max: 395
position_min: -5.0
homing_speed: 50
second_homing_speed: 3
homing_retract_dist: 2

## Driver3 for 2 of 3 z motors
#(rear)

[stepper_z1]
enable_pin: !PA0
step_pin: PG4
dir_pin: PC1
microsteps: 16
rotation_distance: 32
endstop_pin: probe:z_virtual_endstop

## Driver4 for 3 of 3 z motors
#(front right)

[stepper_z2]
enable_pin: !PG2
step_pin: PF9
dir_pin: PF10
microsteps: 16
rotation_distance: 32
endstop_pin: probe:z_virtual_endstop
#--------------------------------------------------

once you map X, X1, Y, Y1, and Z then plug them in, you can use the fake home macro button and try moving them. reverse them by adding or removing the ! before the direction pin assignment.

Please check back in and let us know how it goes. I’m happy to provide context on any of the config above. I’m also interested in any improvements you make to it. Both configs are off functional systems. the first is an mpcnc and the second is a 3d printer (v4) that is using the same board you are setting up.

1 Like