Welcome! Log In Create A New Profile

Advanced

Measuring difference between IR probe and hotend

Posted by ezwul 
Measuring difference between IR probe and hotend
March 12, 2017 09:07AM
Hi all

I have a CoreXY D-bot derivative, I along with a Duet 0.6 (1.17e) and Dave Crocker's IR probe.

I would like to configure the offset between the probe trigger point and the hot end nozzle automatically (I can do it manually using this procedure duet3d.com).

The reason for my investigation into this procedure is I would like to make a magnetic mount on my X-carriage and be able to manually change the hot end by simply selecting 1 of 4 which are magnetically clipped to my frame and clipping them to the X-carriage. If the IR sensor is mounted on the carriage then the distance between the two would vary each time the tool was changed. I want to eventually automatically

To this end I have added a micro switch to the side of the bed and connected it to the Z end stop connector.
I have found I can switch between the IR sensor and the end stop dynamically using this command.
M574 Z1 S0   ; use Z end stop

M574 Z0 S0   ; Don't use Z end stop
So my first step to investigate the above was to use the following macro which I hoped I would be left with the Z offset in the Z height dialog box:
G91                       ; Relative
G1 Z15 F200               ; Move Bed Down and out of the way whilst moving to switch
G90                       ; Absolute
M574 Z1 S0                ; Define Z end stop micro switch active low
G1 X257 Y48 Z15 F600      ; Move IR pcb over switch
G1 Z-40 F600 S1           ; Move +40mm checking for end stop hit
G1 Z4 F500                ; Back off 4mm
G1 Z-4.5 F200 S1          ; Move more slowly to end stop for accuracy
G90                       ; Absolute
G1 Z15 F200               ; Move slowly up to z 15
G1 X237 Y38 Z115 F600     ; move hot end nozzle over switch
G30 S-1                   ; Dive until switch pressed
M574 Z0 S0                ; Define No Z end stop switch reverting back to use IR probe
G90                       ; Absolute

This will macro will:
1) move the pcb over the switch
2) dive until the switch is pressed setting this as Z=0
3) move the hot end nozzle over the switch
4) dive until the switch is pressed

The value left in Z height is the difference between the two, all I have to do now is subtract the trigger height of the IR probe (3.0mm) and I have the G31 Z value.

So my questions:
1) When I do the G30 S-1 the dive does not stop it crashes the hot end in to the switch and carries on going.
If I use this command with the IR probe it stops, Is this a bug or is my use case incorrect?
2) If this works is there a way to store Z in a variable to then add to the G31 command?
3) Is there a way to do maths in G commands like:
G30 P500 X0 Y0 Z(variable-3.0)
Regards

Lloyd
Re: Measuring difference between IR probe and hotend
March 12, 2017 01:19PM
Ok, so reviewing my own problem the
G30 S-1
looks to be a command to zprobe and not a dive until end stop switch is pressed.

Currently looking through the G-code wiki for that command.

Lloyd
Re: Measuring difference between IR probe and hotend
March 12, 2017 05:39PM
Yes, G30 is a Z probe command.

One option may be to wire your microswitch as another Z probe by connecting it to the E0 endstop connector. Then you can use M558 P4 to select it instead of the IR sensor. You will need to configure its trigger height separately, because the firmware stores different trigger heights for different Z probe types in most cases.

See [duet3d.com] for more info on configuring different types of Z probe.

Edited 1 time(s). Last edit at 03/12/2017 05:42PM by dc42.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Measuring difference between IR probe and hotend
March 12, 2017 06:28PM
Hi David

Thank you for confirming the G30 command, I will investigate your suggestion of using the switch as another probe. That sounds more likely to succeed.
Looking at the firmware code, obviously there is no maths capability or variables in gcode, so I might have to investigating adding my own command to allow the Z height to be subtracted from a number entered in the G30 gcode command.

Maybe the sequence will be home the new probe to the edge of the IR sensor PCB, which automatically zeros the Z height G30 S-3 T3.0 to dive the hot end nozzle to the probe.

The Z value will contain the difference from the pcb to the nozzle and this value needs the T value subtracted from it. The IR probe I have has 3.0mm written on it from where you calibrate it as part of the manufacturing.
So:
G30 S-3 T3.0
Thanks

Lloyd
Sorry, only registered users may post in this forum.

Click here to login