Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 27 additions & 5 deletions src/components/widgets/toolhead/ToolheadCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -224,16 +224,15 @@ export default class ToolheadCard extends Mixins(StateMixin, ToolheadMixin) {
this.printerSettings.bltouch != null ||
this.printerSettings.smart_effector != null ||
this.printerSettings.cartographer != null ||
(
this.printerSettings.scanner != null &&
'sensor' in this.printerSettings.scanner &&
this.printerSettings.scanner.sensor === 'cartographer'
) ||
Object.keys(this.printerSettings)
.some(x => x.startsWith('probe_eddy_current '))
)
}

get printerSupportsAxisTwistCompensationCalibrate (): boolean {
return this.printerSettings.axis_twist_compensation != null
}

get printerSupportsBeaconCalibrate (): boolean {
return this.printerSettings.beacon != null
}
Expand All @@ -242,6 +241,13 @@ export default class ToolheadCard extends Mixins(StateMixin, ToolheadMixin) {
return this.printerSettings.cartographer != null
}

get printerSupportsCartographerAxisTwistCompensation (): boolean {
return (
this.printerSettings.cartographer != null &&
this.printerSettings.axis_twist_compensation != null
)
Comment on lines +244 to +248

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The [scanner] section is part of the old cartographer code and is deprecated and should be removed as noted here: https://docs.cartographer3d.com/cartographer-probe/installation-and-setup/software-configuration/klipper-setup

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Old cartographer scanner check removed in d973872.

}

get printerSupportsZEndstopCalibrate (): boolean {
return (
this.printerSettings.stepper_z?.position_endstop != null
Expand Down Expand Up @@ -338,6 +344,14 @@ export default class ToolheadCard extends Mixins(StateMixin, ToolheadMixin) {
})
}

if (this.printerSupportsAxisTwistCompensationCalibrate) {
tools.push({
name: 'AXIS_TWIST_COMPENSATION_CALIBRATE',
disabled: !this.allHomed || this.isManualProbeActive,
wait: this.$waits.onAxisTwistCompensationCalibrate
})
}

if (this.printerSupportsBeaconCalibrate) {
tools.push({
name: 'BEACON_AUTO_CALIBRATE',
Expand Down Expand Up @@ -376,6 +390,14 @@ export default class ToolheadCard extends Mixins(StateMixin, ToolheadMixin) {
})
}

if (this.printerSupportsCartographerAxisTwistCompensation) {
tools.push({
name: 'CARTOGRAPHER_AXIS_TWIST_COMPENSATION',
disabled: !this.allHomed || this.isManualProbeActive,
wait: this.$waits.onCartographerAxisTwistCompensation
})
}

if (this.printerSupportsDeltaCalibrate) {
tools.push({
name: 'DELTA_CALIBRATE',
Expand Down
2 changes: 2 additions & 0 deletions src/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,7 @@ export const Waits = Object.freeze({
onHomeZ: 'onHomeZ',
onQGL: 'onQGL',
onZTilt: 'onZTilt',
onAxisTwistCompensationCalibrate: 'onAxisTwistCompensationCalibrate',
onBedScrewsAdjust: 'onBedScrewAdjust',
onDatabaseList: 'onDatabaseList',
onDatabaseCompact: 'onDatabaseCompact',
Expand All @@ -585,6 +586,7 @@ export const Waits = Object.freeze({
onDatabaseDeleteBackup: 'onDatabaseDeleteBackup',
onBedScrewsCalculate: 'onBedScrewsCalculate',
onBedTiltCalibrate: 'onBedTiltCalibrate',
onCartographerAxisTwistCompensation: 'onCartographerAxisTwistCompensation',
onCartographerScanCalibrate: 'onCartographerScanCalibrate',
onCartographerTouchCalibrate: 'onCartographerTouchCalibrate',
onDeltaCalibrate: 'onDeltaCalibrate',
Expand Down
15 changes: 15 additions & 0 deletions src/typings/klipper.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,8 @@ declare namespace Klipper {

[key: `temperature_probe ${Lowercase<string>}`]: TemperatureProbeSettings;

axis_twist_compensation: AxisTwistCompensationSettings;

safe_z_home: SafeZHomeSettings;

z_tilt: ZTiltSettings;
Expand Down Expand Up @@ -1163,6 +1165,19 @@ declare namespace Klipper {
smooth_time: number;
}

export interface AxisTwistCompensationSettings {
horizontal_move_z: number;
speed: number;
z_compensations: number[];
zy_compensations: number[];
calibrate_start_x?: number;
calibrate_end_x?: number;
calibrate_y?: number;
calibrate_start_y?: number;
calibrate_end_y?: number;
calibrate_x?: number;
}

export interface SafeZHomeSettings {
home_xy_position: [number, number]
z_hop: number;
Expand Down