Skip to content

Hacking the OpenBuilds BlackBox X32

Shell M. Shrader edited this page Dec 22, 2022 · 6 revisions

Unimpressed with GrblHAL, maybe you want to run a version of Grbl you used on another ESP32 based controller such as Grbl_Esp32, or maybe you want to get all that you can out of your new controller by using the latest and greatest Grbl firmware out there (FluidNC)?

Before proceeding, I highly recommend you make a base (as-built) backup of your BlackBox X32. You can follow the procedure documented here to do so: https://openbuilds.com/threads/blackbox-x32-manually-backup-your-stock-firmware.19874/

FluidNC

Installing FluidNC is very easy and well documented. Head over to the FluidNC Releases page and download a distribution that matches your host computer (Windows == win64, Linux == posix). I recommend grabbing the latest and greatest release.

Follow the full install guide and then come back here for uploading and setting up your base config.yaml.

Base config.yaml for the OpenBuilds BlackBox X32

board: OpenBuilds BlackBox X32
name: BlackBox_X32_XYYZ-DOOR
meta: Handcrafted by Shell M Shrader
stepping:
  engine: RMT
  idle_ms: 255
  pulse_us: 2
  dir_delay_us: 1
  disable_delay_us: 0

axes:
  shared_stepper_disable_pin: gpio.17:low
  x:
    steps_per_mm: 200.000
    max_rate_mm_per_min: 1000.000
    acceleration_mm_per_sec2: 100.000
    max_travel_mm: 300.000
    soft_limits: false
    homing:
      cycle: 2
      feed_mm_per_min: 100.000
      seek_mm_per_min: 500.000
      settle_ms: 500
      seek_scaler: 1.100
      feed_scaler: 1.100

    motor0:
      limit_neg_pin: gpio.35
      limit_pos_pin: NO_PIN
      limit_all_pin: NO_PIN
      hard_limits: false
      pulloff_mm: 1.000
      standard_stepper:
        step_pin: gpio.12
        direction_pin: gpio.14

  y:
    steps_per_mm: 200.000
    max_rate_mm_per_min: 1000.000
    acceleration_mm_per_sec2: 100.000
    max_travel_mm: 300.000
    soft_limits: false
    homing:
      cycle: 2
      feed_mm_per_min: 100.000
      seek_mm_per_min: 500.000
      settle_ms: 500
      seek_scaler: 1.100
      feed_scaler: 1.100

    motor0:
      limit_neg_pin: gpio.34
      limit_pos_pin: NO_PIN
      limit_all_pin: NO_PIN
      hard_limits: false
      pulloff_mm: 1.000
      standard_stepper:
        step_pin: gpio.27
        direction_pin: gpio.26

    motor1:
      standard_stepper:
        step_pin: gpio.33
        direction_pin: gpio.32

  z:
    steps_per_mm: 200.000
    max_rate_mm_per_min: 300.000
    acceleration_mm_per_sec2: 100.000
    max_travel_mm: 50.000
    soft_limits: false
    homing:
      cycle: 1
      feed_mm_per_min: 100.000
      seek_mm_per_min: 200.000
      settle_ms: 500
      seek_scaler: 1.100
      feed_scaler: 1.100

    motor0:
      limit_neg_pin: gpio.39
      limit_pos_pin: NO_PIN
      limit_all_pin: NO_PIN
      hard_limits: false
      pulloff_mm: 1.000
      standard_stepper:
        step_pin: gpio.15
        direction_pin: gpio.2

spi:
  miso_pin: gpio.19
  mosi_pin: gpio.23
  sck_pin: gpio.18

sdcard:
  card_detect_pin: NO_PIN
  cs_pin: gpio.5

probe:
  pin: gpio.22:low
  check_mode_start: true

control:
  safety_door_pin: gpio.16:pu

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

start:
  must_home: false

coolant:
  mist_pin: gpio.21
  delay_ms: 0

PWM:
  pwm_hz: 5000
  output_pin: gpio.25
  enable_pin: gpio.13
  direction_pin: gpio.4
  disable_with_s0: false
  s0_with_disable: true
  spinup_ms: 30000
  spindown_ms: 10000
  tool_num: 0
  speed_map: 0=0.000% 1000=100.000%

Considerations

The above config.yaml assumes you are running NC limit switches and a NC safety door

...
    motor0:
      limit_neg_pin: gpio.35
...
control:
  safety_door_pin: gpio.16:pu
...

If you run your limits NO, you'll need to add the :low modifier to the appropriate pin entries. For example, to run your X axes with a NO limit switch, you would configure it like so:

  x:
    ...
    homing:
      ...
    motor0:
      limit_neg_pin: gpio.35:low
      ...
      standard_stepper:
        ...

If you do not have a safety door you can omit the safety_door entry entirely or flip it to :low (same can be done if yours is NO):

If you need to reverse any of your steppers directionally, the same procedure applies to them. Simply add the :low modifier for the applicible motorX: direction_pin value.

If you are driving a laser, replace the PWM spindle entry with Laser. The FluidNC wiki goes into all of this in further detail.

Uploading config.yaml

Screenshot 2022-12-22 at 12 33 07 PM Screenshot 2022-12-22 at 12 33 46 PM

Fine-tuned config.yaml

The below config.yaml example is what I am running on my own 750x750 Queen Bee Pro. You will notice I have homing enabled and hard/soft limits both turned on as well. Lastly, take a look at the PWM speed_map entry. This is a cool feature that enables you to rescale your spindle speed on a custom curve.

board: Open Builds BlackBox X32
name: BlackBox_X32_XYYZ-DOOR
meta: Handcrafted by Shell M Shrader
stepping:
  engine: RMT
  idle_ms: 255
  pulse_us: 2
  dir_delay_us: 1
  disable_delay_us: 0
  segments: 12
axes:
  shared_stepper_disable_pin: gpio.17:low
  shared_stepper_reset_pin: NO_PIN
  x:
    steps_per_mm: 200.0
    max_rate_mm_per_min: 3000.0
    acceleration_mm_per_sec2: 100.0
    max_travel_mm: 505.0
    soft_limits: true
    homing:
      cycle: 2
      allow_single_axis: true
      positive_direction: true
      mpos_mm: 0.0
      feed_mm_per_min: 100.0
      seek_mm_per_min: 2000.0
      settle_ms: 500
      seek_scaler: 1.1
      feed_scaler: 1.1
    motor0:
      limit_neg_pin: gpio.35
      limit_pos_pin: NO_PIN
      limit_all_pin: NO_PIN
      hard_limits: true
      pulloff_mm: 5.0
      standard_stepper:
        step_pin: gpio.12
        direction_pin: gpio.14
        disable_pin: NO_PIN
  y:
    steps_per_mm: 200.0
    max_rate_mm_per_min: 3000.0
    acceleration_mm_per_sec2: 100.0
    max_travel_mm: 505.0
    soft_limits: true
    homing:
      cycle: 2
      allow_single_axis: true
      positive_direction: true
      mpos_mm: 0.0
      feed_mm_per_min: 100.0
      seek_mm_per_min: 2000.0
      settle_ms: 500
      seek_scaler: 1.1
      feed_scaler: 1.1
    motor0:
      limit_neg_pin: gpio.34
      limit_pos_pin: NO_PIN
      limit_all_pin: NO_PIN
      hard_limits: true
      pulloff_mm: 5.0
      standard_stepper:
        step_pin: gpio.27
        direction_pin: gpio.26
        disable_pin: NO_PIN
    motor1:
      limit_neg_pin: NO_PIN
      limit_pos_pin: NO_PIN
      limit_all_pin: NO_PIN
      hard_limits: false
      pulloff_mm: 5.0
      standard_stepper:
        step_pin: gpio.33
        direction_pin: gpio.32
        disable_pin: NO_PIN
  z:
    steps_per_mm: 200.0
    max_rate_mm_per_min: 600.0
    acceleration_mm_per_sec2: 100.0
    max_travel_mm: 105.0
    soft_limits: true
    homing:
      cycle: 1
      allow_single_axis: true
      positive_direction: true
      mpos_mm: 0.0
      feed_mm_per_min: 100.0
      seek_mm_per_min: 300.0
      settle_ms: 500
      seek_scaler: 1.1
      feed_scaler: 1.1
    motor0:
      limit_neg_pin: gpio.39
      limit_pos_pin: NO_PIN
      limit_all_pin: NO_PIN
      hard_limits: true
      pulloff_mm: 5.0
      standard_stepper:
        step_pin: gpio.15
        direction_pin: gpio.2:low
        disable_pin: NO_PIN
kinematics:
  Cartesian: null
spi:
  miso_pin: gpio.19
  mosi_pin: gpio.23
  sck_pin: gpio.18
sdcard:
  cs_pin: gpio.5
  card_detect_pin: NO_PIN
control:
  safety_door_pin: gpio.16:pu
  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
coolant:
  flood_pin: NO_PIN
  mist_pin: gpio.21
  delay_ms: 0
probe:
  pin: gpio.22:low
  check_mode_start: true
macros:
  startup_line0: null
  startup_line1: null
  macro0: null
  macro1: null
  macro2: null
  macro3: null
start:
  must_home: true
  deactivate_parking: false
  check_limits: true
parking:
  enable: false
  axis: Z
  target_mpos_mm: -5.0
  rate_mm_per_min: 800.0
  pullout_distance_mm: 5.0
  pullout_rate_mm_per_min: 250.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
  digital0_pin: NO_PIN
  digital1_pin: NO_PIN
  digital2_pin: NO_PIN
  digital3_pin: NO_PIN
arc_tolerance_mm: 0.002
junction_deviation_mm: 0.01
verbose_errors: false
report_inches: false
enable_parking_override_control: false
use_line_numbers: false
planner_blocks: 16
PWM:
  pwm_hz: 5000
  direction_pin: gpio.4
  output_pin: gpio.25
  enable_pin: gpio.13
  disable_with_s0: false
  s0_with_disable: true
  spinup_ms: 10000
  spindown_ms: 10000
  tool_num: 0
  speed_map: 0=0.000% 0=30.000% 6000=30.000% 24000=100.000%
  off_on_alarm: false

For more information on FluidNC's config.yaml setup, take a look at the configuration section of their wiki: http://wiki.fluidnc.com/en/config/overview


Grbl_Esp32

I've created a set of machine files for Grbl_Esp32 you can flash on your BlackBox X32. Once you have it installed, you are able to apply OTA firmware updates directly from the WebUI moving forward -- even if you want to jump to FluidNC.

How to Install

Grab the machine file that matches your setup. If your setup isn't listed, create a discussion and I'll do my best to accommodate your request.

Follow the FluidNC installation guide documented above. This will give us a nice clean spiffs partition for us to install Grbl_Esp32 on via an OTA. Once the install is done, open the WebUI and use the Firmware OTA update option in ESP3D:

Screenshot 2022-12-22 at 12 26 23 PM

Select the machine file you downloaded for your configuration and wait for the installation to complete.

Lastly, it is a good idea to install the Grbl_Esp32 WebUI instead of the FluidNC one. To do so, grab the Grbl_Esp32 index.html.gz archive and upload it via the spiffs file upload option in ESP3D:

Screenshot 2022-12-22 at 12 33 07 PM Screenshot 2022-12-22 at 12 33 46 PM

Better Grbl Support Considerations

As of v2.3.0, bgs fully supports FluidNC settings and configuration file management.

Screenshot 2022-12-22 at 3 01 15 PM Screenshot 2022-12-22 at 3 01 35 PM

Better Grbl Support is also 100% compatible with Grbl_Esp32 (GrblHAL too). All error, alarm, and settings descriptions are up to date, supporting all flavors of Grbl available today.