This repository contains the Klipper/Moonraker configuration for a Kossel delta printer (MKS SBASE v1.3 / LPC176x) running with Mainsail.
- Printer: Kossel 3D Delta Printer
- Controller: MKS SBASE v1.3 (uses LPC176x) - MKS SBASE GitHub
- Kinematics: Delta
- Build Area: 110mm radius
- Hotend: Standard 0.4mm nozzle
- Bed: Heated bed with Honeywell thermistor
- Extruder: 1.75mm filament, 22.73mm rotation distance
- Display: RepRapDiscount 128x64 Full Graphic Smart Controller (ST7920)
- Probe: Z-probe with auto-bed leveling
- Accelerometer: FLY-ADXL345 USB for resonance testing
Main configuration file containing:
- Delta kinematics setup
- Stepper motor configuration (A, B, C towers + extruder)
- Hotend and heated bed configuration
- Probe settings for auto-bed leveling
- Input shaping for vibration reduction
- Display configuration
- Current control via MCP4451 digipots
Moonraker configuration file containing:
- Klippy socket path
- Update manager config (Mainsail + mainsail-config)
Accelerometer configuration for resonance testing:
- FLY-ADXL345 USB accelerometer setup
- Resonance testing configuration
- Reference: Mellow USB Accelerometer ADXL345 Documentation
Convenience macros for common calibration tasks:
RUN_PROBE_CALIBRATERUN_PROBE_ACCURACYRUN_BASIC_DELTA_CALIBRATE
Macro wrapper for Klipper enhanced delta calibration:
DELTA_ANALYZE_ENHANCED- Stores the
DELTA_ANALYZEmeasurement commands in one place - Runs
DELTA_ANALYZE CALIBRATE=extendedwith your recorded measurements
- Delta Radius: 103.174mm (auto-calibrated; see
SAVE_CONFIG) - Arm Length: 208.1mm
- Print Radius: 110mm
- Max Velocity: 200mm/s
- Max Acceleration: 10000mm/s²
- Type: MZV
- Frequency: X=45.6Hz, Y=48.6Hz (see
SAVE_CONFIG)
The accelerometer is not always connected. In printer.cfg the include for accelerometer.cfg is intentionally commented out.
Enable it when the sensor is plugged in:
- Connect the USB accelerometer
- Edit
printer.cfgand uncomment the line:# [include accelerometer.cfg]
- Restart Klipper
Verify the sensor is working:
ACCELEROMETER_QUERYMeasure baseline noise:
MEASURE_AXES_NOISERun resonance tests (example):
TEST_RESONANCES AXIS=X
TEST_RESONANCES AXIS=YGenerate new input shaper values:
SHAPER_CALIBRATE
SAVE_CONFIGDisable it again when done (so Klipper will start without the sensor):
- Re-comment the
include accelerometer.cfgline inprinter.cfg - Restart Klipper
- Z Offset: 24.33mm (see
SAVE_CONFIG) - Speed: 5mm/s
- Samples: 5 (median result)
- Pressure Advance: 0.28
- Smooth Time: 0.04s
- Nozzle Diameter: 0.4mm
- Filament Diameter: 1.75mm
To calibrate the probe Z-offset:
-
Home the printer:
G28 -
Move to center of build area:
G0 X0 Y0 Z30 -
Test probe deployment:
QUERY_PROBE -
Perform manual Z-offset calibration:
PROBE_CALIBRATE- Follow the on-screen prompts
- Use a piece of paper to test nozzle-to-bed distance
- Adjust until you feel slight drag when moving paper
-
Save the new Z-offset:
SAVE_CONFIG -
Verify the setting:
GET_PROBE
Current Z-offset: 24.33mm (can be updated after calibration)
This repo is intended to live at ~/kossel-config on the Raspberry Pi, and you symlink Klipper's config directory to the repo.
Expected on the Pi:
- Repo:
/home/anthony/kossel-config - Mainsail macros:
/home/anthony/mainsail-config/mainsail.cfg - Klipper config directory:
/home/anthony/printer_data/config(symlink to/home/anthony/kossel-config/config)
Note: config/printer.cfg includes Mainsail macros via an absolute path:
config/printer.cfgincludes/home/anthony/mainsail-config/mainsail.cfg
The intended flow is now MainsailOS first, then a small Ansible pass to apply this repo.
- Flash
MainsailOSand enable SSH + Wi-Fi in Raspberry Pi Imager. - Boot the Pi once and let first-boot provisioning finish.
- Run the Ansible playbook:
ansible-playbook ansible/klipper-setup.ymlNotes:
- The playbook forwards your SSH agent so the Pi can clone
git@github.com:...without storing your private key on the Pi. KlipperScreenis installed by default as part of this playbook. Opt out with-e install_klipperscreen=false.- By default the playbook installs the standard utility packages in this repo, runs
apt full-upgrade, configureszsh, applies the Wi-Fi tuning in the playbook, and linksprinter_data/configto this repo. - If
~/printer_data/configalready exists, the playbook backs it up to~/printer_data/config.pre-kossel-configand replaces it with a symlink to this repo.
- Run
DELTA_CALIBRATEcommand if tower positions change - Run
DELTA_ANALYZE_ENHANCEDafter printing/measuringcalibrate_size.stlfor dimensional tuning - Use
TEST_RESONANCESwith accelerometer for input shaping updates - Re-tune PID values if temperature control issues occur
- Update probe Z-offset if bed leveling accuracy degrades
Use either direct command or convenience macro:
DELTA_CALIBRATE
SAVE_CONFIGor:
RUN_BASIC_DELTA_CALIBRATE
SAVE_CONFIG- Print
calibrate_size.stlfrom the Klipper docs. - Measure center distances, outer distances, center pillar widths, and outer pillar widths.
- Update values in
config/delta_analyze_enhanced.cfg. - Run:
DELTA_ANALYZE_ENHANCED
SAVE_CONFIGNote: The enhanced measurements are only valid for the current config state. If you rerun DELTA_CALIBRATE or otherwise change delta geometry, reprint and remeasure before running enhanced calibration again.
This config has filament runout detection enabled. When a runout is detected, Klipper will execute PAUSE.
What happens on runout:
- The print pauses
- The toolhead parks (this config customizes the Mainsail PAUSE behavior to park at
X0 Y0with a small Z lift)
To recover:
- Replace/load filament (and make sure it is actually feeding)
- Heat the hotend if needed
- Purge a little filament and clean the nozzle
- In Mainsail, click
RESUME(or runRESUMEfrom the console)
Notes:
- Runout sensors are defined in
printer.cfgasfilament_switch_sensor filament_runoutandfilament_motion_sensor filament_motion(either can trigger a pause). RESUMEis configured to check the runout sensor set in_CLIENT_VARIABLE.variable_runout_sensorand will refuse to resume if it still reports "no filament".
Licensed under the MIT License - see LICENSE.
