Configure MKS-DLC32 for pen plotter hbot

Hi guys. As the name suggests I am in trouble trying to configure a huge pen plotter I bought from China. I basically have this A0 structure in Hbot configuration that I would love to wire with MKS-DLC32 controller (with silent trivers, I think TMC2209) and display. Any idea how can I configure the board for such configuration?

Bests!

2 Likes

Hey there mister! Isn’t this fortunate? I’m working on precisely the same setup! Welcome to the forum :smile:
Im using fluidNC, based on grbl. Really neat, but sometimes confusing coming from the marlin world.

I can share my settings, but that has to be tomorrow. Here is some rambling in another thread on my build: CoreXY Laser Engraver - #64 by turbinbjorn

1 Like

Here is my config. This version has a servo for z. Please share more details on your build, I’m curious to see!

board: MKS-DLC32 V2.1
name: tbs plotter zpin 22
meta: villamany 30/Jan/2023

kinematics:
  CoreXY:

stepping:
  engine: I2S_STATIC
  idle_ms: 255
  pulse_us: 4
  dir_delay_us: 1
  disable_delay_us: 0

axes:
  shared_stepper_disable_pin: I2SO.0
  x:
    steps_per_mm: 100
    max_rate_mm_per_min: 16000
    acceleration_mm_per_sec2: 1500
    max_travel_mm: 895
    soft_limits: false
    homing:
      cycle: 0
      positive_direction: false
      mpos_mm: 0.000
      feed_mm_per_min: 500.000
      seek_mm_per_min: 16000.000
      settle_ms: 500
      seek_scaler: 1.100
      feed_scaler: 1.100

    motor0:
      limit_neg_pin: gpio.36:low
      hard_limits: false
      pulloff_mm: 2.000
      stepstick:
        step_pin: I2SO.1
        direction_pin: I2SO.2:high

  y:
    steps_per_mm: 100
    max_rate_mm_per_min: 16000
    acceleration_mm_per_sec2: 1500
    max_travel_mm: 880
    soft_limits: false
    homing:
      cycle: 0
      positive_direction: false
      mpos_mm: 0.000
      feed_mm_per_min: 500.000
      seek_mm_per_min: 16000.000
      settle_ms: 500
      seek_scaler: 1.100
      feed_scaler: 1.100

    motor0:
      limit_neg_pin: gpio.35:low
      hard_limits: false
      pulloff_mm: 2.000
      stepstick:
        step_pin: I2SO.5
        direction_pin: I2SO.6:low
 
  z:
    steps_per_mm: 100
    max_rate_mm_per_min: 5000
    acceleration_mm_per_sec2: 200
    max_travel_mm: 5
    homing:
      cycle: 1
      mpos_mm: 0
      positive_direction: true

    motor0:
      rc_servo:
        pwm_hz: 50
        output_pin: gpio.22
        min_pulse_us: 1500
        max_pulse_us: 1300

i2so:
  bck_pin: gpio.16
  data_pin: gpio.21
  ws_pin: gpio.17

spi:
  miso_pin: gpio.12
  mosi_pin: gpio.13
  sck_pin: gpio.14

sdcard:
  cs_pin: gpio.15
  card_detect_pin: NO_PIN
#  card_detect_pin: gpio.39
  
control:
  safety_door_pin: NO_PIN
  reset_pin: NO_PIN
  feed_hold_pin: NO_PIN
  cycle_start_pin: NO_PIN
  macro0_pin: NO_PIN
  macro1_pin: NO_PIN
  macro2_pin: NO_PIN
  macro3_pin: NO_PIN

macros:
  startup_line0:
  startup_line1:
  macro0:
  macro1:
  macro2:
  macro3:

coolant:
  flood_pin: NO_PIN
  mist_pin: NO_PIN
  delay_ms: 0

  
user_outputs:
  analog0_pin: NO_PIN
  analog1_pin: NO_PIN
  analog2_pin: NO_PIN
  analog3_pin: NO_PIN
  analog0_hz: 5000
  analog1_hz: 5000
  analog2_hz: 5000
  analog3_hz: 5000
  #Beeper connector. Command: "M62 P0" turn beeper On. 
  #"G4 P0.5" wait for 0.5s. "M63 P0" turn beeper OFF
  digital0_pin: I2SO.7
  digital1_pin: NO_PIN
  digital2_pin: NO_PIN
  digital3_pin: NO_PIN

start:
  must_home: false
1 Like

Thanks for sharing you configuration.
I am not sure we have the same setup. Mine is a H bot, it is a single-long-belt system, don’t you have a CoreXY?

Bests,
Fabio

1 Like

Haha, indeed you are right! I’m sorry for confusing. I was just happy to see someone else trying to figure out the MKS DLC32 for a plotter. I still think we can benefit from sharing experiences during the build though. I’d still suggest fluidNC. I did never try the Makerbase default firmware though, perhaps it’ll suffice?

1 Like

For sure we can share the project, it would greatly help both. Atm I received a machine that is hbot while I ordered a corexy, I’m trying to figure out how to solve with the seller. Btw the final idea is to switch to a cartesian with dual Y stepper, since the machine is very big (A0 format). I’m a bit of a thinkerer so I guess I’ll make a custom CNC and then configure Makerbase or fluidNC to my needs. The actual control unit they shipped to me is compatible with axidraw software, it is not that bad actually but definitely not the most customizable thing. Did you managed to plot something?

1 Like

I am in the process of designing, building, and configuring FluidNC for a custom laser engraver and it sounds like it is a very similar situation to what you are looking for. Cartesian system with dual Y motors for autosquaring.

You can check out the progress of the build here and I would be happy to help work through your build with you if you need anything.

2 Likes

Thanks for sharing man. Is FluidNC compiled from scratch or was something already precompiled? Moreover I will need to control a servo for the pen/pencil.

1 Like

FluidNC is a firmware that you will flash onto your MKS DLC32. FluidNC requires a configuration file or “YAML” file which tells the controller how your machine is setup (steppers, endstops, I/O ports, and other config items). So you will flash FluidNC to the controller and then upload your custom .yaml file to the controller for it to use.

The YAML files are really not too complicated. You can take an existing one that closely resembles your machine and change around a few things to make it work for you. This is what I did. I took an existing YAML file for a cartesian machine with one Y motor, one X motor, and one Z motor. I then changed it by assigning the Z motor to be a second Y motor (Y2) and changing its corresponding endstop to respond to that motor.

1 Like

Thanks for the tip. I’ll dig into it. My first concern is atm the accuracy. The structure is very big I need to achieve an acceptable repetibility on the movements. Moreover, I’m not sure if FluidNC is compatible with AxiDraw software, this would be great btw.

1 Like

I’m not sure about the axidraw software, how well it works. It took a little learning to figure out how to deal controlling the fluidNC. I tried using my favorite gcode sender cnc.js, but couldn’t make it connect. I’ve ended up using the stock web GUI, ESP3D, which works fairly well. It’s inferior to cnc.js in my opinion, but when I got my head around how to CAM stuff in estlcam for this specific use, it turned out okay.

Yes - I’ve managed to run a servo from the MKS DLC32 board, I used the z probe pins. The config/yaml I posted is how I set up the servo. The z probe is pin 22 on this board.

1 Like

Hi everyone! Sorry for the late reply. I finally managed to buy so wood base in order to mount everything. I still miss to realize a couple of extension cable to properly try everything. And, btw, still waiting for main parts from china. However this is a picture of the build. I want to use one motor for x, one motor for y1 and another for y2. So that I should have sensorless auto homing like on 3d printers (for which I have a bit more experience). Right now I’m flashing the MKS DLC32 with FluidNC and I’ll try to understand how does this work.

As you can see I’m planning to use a nylon 3.85mm filament as guide for the x and stepper motor cables, while on the left I ordered a chain cable holder.

Probably in the very near future I’ll design a custom pen holder 3d printable is anyone is interested.

Any suggestion on how to create the gcodes? Will I even use gcode like in 3d printers for such machine?

1 Like

Do you mind to share your YAML configuration?

1 Like

Aren’t you specifying that your machine is a CoreXY in the configuration?

1 Like

Yes, we’ve already talked about it :wink:

The corexy setup is different, but I guess the config for tmc2209 drivers would be the same. I haven’t changed anything from the fluidNC wiki though. I have tweaked the vref-pot quite a bit. I did never figure out how to measure it with a meter and do the calculations - so I changed it back and forth until I found a good balance between the motors holding and not getting too hot. For me it’s quite close to the lowest setting, maybe only 60 degrees of rotation from there.

1 Like

Yeah man, you’re alright :slight_smile:

I did some advancements, now the board MKS DLC-32 has been modified to support UART for TMC2209 drivers. The thing I am missing is the sensorless homing right now. Seems difficult to get it work.

Do you have any experience about it?

However this is my configuration

board: MKS-DLC32 V2.1
name: PenPlotter_A0
meta: (Jun 2023) by SerFabio89

stepping:
  engine: I2S_STATIC
  idle_ms: 255
  pulse_us: 2
  dir_delay_us: 1
  disable_delay_us: 0

uart1:
  txd_pin: gpio.18
  rxd_pin: gpio.23
  rts_pin: NO_PIN
  cts_pin: NO_PIN
  baud: 115200
  mode: 8N1

axes:
  shared_stepper_reset_pin: NO_PIN
  shared_stepper_disable_pin: I2SO.0

  x:
    steps_per_mm: 100.000
    max_rate_mm_per_min: 12000.000
    acceleration_mm_per_sec2: 300.000
    max_travel_mm: 200.000
    soft_limits: true

    homing:
      cycle: 2
      allow_single_axis: true
      positive_direction: false
      mpos_mm: 0.000
      feed_mm_per_min: 300.000
      seek_mm_per_min: 5000.000
      settle_ms: 500
      seek_scaler: 1.100
      feed_scaler: 1.100

    motor0:
      limit_neg_pin: gpio.36
      hard_limits: false
      pulloff_mm: 5.000
      tmc_2209:
        uart_num: 1
        addr: 0
        r_sense_ohms: 0.110
        run_amps: 1.000
        hold_amps: 0.100
        microsteps: 16
        stallguard: 150
        stallguard_debug: true
        toff_disable: 0
        toff_stealthchop: 5
        toff_coolstep: 3
        run_mode: StealthChop
        homing_mode: StealthChop
        use_enable: true
        step_pin: I2SO.1
        direction_pin: I2SO.2

  y:
    steps_per_mm: 100.000
    max_rate_mm_per_min: 12000.000
    acceleration_mm_per_sec2: 300.000
    max_travel_mm: 200.000
    soft_limits: true

    homing:
      cycle: 2
      allow_single_axis: true
      positive_direction: false
      mpos_mm: 0.000
      feed_mm_per_min: 300.000
      seek_mm_per_min: 5000.000
      settle_ms: 500
      seek_scaler: 1.100
      feed_scaler: 1.100

    motor0:
      limit_neg_pin: gpio.34
      hard_limits: false
      pulloff_mm: 5.000
      tmc_2209:
        uart_num: 1
        addr: 1
        r_sense_ohms: 0.110
        run_amps: 1.500
        hold_amps: 0.200
        microsteps: 16
        stallguard: 150
        stallguard_debug: true
        toff_disable: 0
        toff_stealthchop: 5
        toff_coolstep: 3
        run_mode: StealthChop
        homing_mode: StealthChop
        use_enable: true
        step_pin: I2SO.5
        direction_pin: I2SO.6

  z:
    steps_per_mm: 2.000
    max_rate_mm_per_min: 5000.000
    acceleration_mm_per_sec2: 1000.000
    max_travel_mm: 5.000
    soft_limits: true

    homing:
      cycle: 1
      allow_single_axis: true
      positive_direction: true
      mpos_mm: 5.000
      feed_mm_per_min: 200.000

    motor0:
      rc_servo:
        pwm_hz: 60
        output_pin: gpio.22
        min_pulse_us: 1500
        max_pulse_us: 1000

i2so:
  bck_pin: gpio.16
  data_pin: gpio.21
  ws_pin: gpio.17

spi:
  miso_pin: gpio.12
  mosi_pin: gpio.13
  sck_pin: gpio.14

sdcard:
  cs_pin: gpio.15
  card_detect_pin: gpio.39

control:
  safety_door_pin: NO_PIN
  reset_pin: NO_PIN
  feed_hold_pin: NO_PIN
  cycle_start_pin: NO_PIN
  macro0_pin: gpio.27:low:pu
  macro1_pin: gpio.33:low:pu
  macro2_pin: NO_PIN
  macro3_pin: NO_PIN

macros:
  startup_line0:
  startup_line1:
  macro0: $H
  macro1: $HZ
  macro2:
  macro3:

start:
  must_home: false

type or paste code here

type or paste code here
1 Like

Here is my custom yaml file. Not sure if it will directly apply to your setup though.

Burny.zip (1011 Bytes)

1 Like

Thanks a lot man, I’ll check it as soon as I’ll have a chance. Btw I managed to configure everything, most of my issues were caused by a broken TMC2209 driver (uart not responding) but I was lucky enought to be able to control the machine with only two drivers. Anyway, I’ll attach my complete and corrected configuration on this thread ASAP. It is a pleasure to finally see it working )) You can check the video in the zip attached if you want to is it action. The camera was too close to capture the whole structure (1.5x1m)

IMG_8545 (online-video-cutter.com).mp4.zip (3.2 MB)

2 Likes

Hi everyone. Just wanted so share some updates.
The machine seems to work correctly.

The temporary design is a dual Y axis stepper (with single drive cause… one of the TMC2209 drivers I have is not responding to UART - ordered 5 new drivers from AliExpress n.d.r.) and a single X axis stepper. The actuator for pen/pencil/other is a simple servo. I had to use ethernet cable to control the servo cause the cable length is huge (A0 size machine) and the noise coming from the cables of the X axis stepper were making a mess. I installed chain guides to have something reliable and also a fan on the stepper drivers cause they were becoming hot too fast, despite I’m using the CoolStep mode that it is supposed to reduce the currents.

You can find some pictures of the machine attached and also the configuration that at this moment I’m using. The paper you see is size A3 and I have no space at home to place the beast, so it lies on my bed.

Future plans are to modify the MKS DLC32 in order to have UART mode enabled without jumpers, switching to a dual Y axis drivers and most importantly to make a pen holder from scratch and 3D print it. I have a heavy modified Anycubic i3 Mega that is more than capable for this.

Any suggestion is highly appreciated.

config.zip (1.0 KB)




2 Likes

Pen plotter actuator wip.
MG996R servo and MGN12H linear guide. All in for stability. Already 3D printed, now waiting for the part from AliExpress


1 Like