Setting WCS with probe



  • Hello,

    I'm using a DuetWifi to control a CNC router. I have a Z-probe mounted and would like to set Z-coordinate of a WCS by probing my work piece. I could not find the needed functionality and therefore implemented a G30 S-3 in the firmware. Would there have been another option to do this without modifying the software? If not and if there is interest for it I would be happy to share my extensions.
    Further I want to extend the probing to allow as well for X and Y probing. This however additionally involves compensation for the probe diameter dependent from which direction the probing happens. Therefore there has to be an option to define somewhere the diameter of the probe. Assuming that this is not available yet where would be a could place to implement this?
    Finally I would as well like to probe for rotations of my work piece around Z-axis i.e. being able to set a rotation angle for every WCS additionally to X, Y, Z offset. There is the option with the G10 L2 command to set X, Y, Z, U, V, W. From a logical standpoint assuming typical 5-axis set-ups W could represent that rotation. Would this make sense?

    Best regards,

    Marc



  • I have connected myself just a simple tool height probe (micro-switch with large button to be touched by the tool in the spindle) and I have written a small macro for the actual probing. The height of the probe is configured in config.g. If that would help you, I can reply with the actual macro and settings.



  • @catalin_ro: Yes I would be very interested to see how you did it because I did not get it done the way I wanted without modifying the firmware....



  • @mwinterm So... This is the tool probe that I use - https://www.sorotec.de/shop/Tool-Length-Sensor-Usovo-14mm.html. It is configured as normally closed switch (the probe can be easily dismantled and reconfigured).

    The config.g file contains the following lines:

    M558 P5 H5 F100 T2500 ; Set Z probe type to switch and the dive height + speeds
    G31 P600 X0 Y0 Z39.55 ; Set Z probe trigger value, offset and trigger height

    I have a tool probing macro that looks like:

    ; Probe the height without affecting Z axis coordinate
    G30 S-1
    ; Modify workplace coordinates so they reflect the new Z value, corresponding to the tool probe height
    G10 L20 P1 Z39.55
    ; Raise the Z axis to allow removing the tool probe
    G91
    G0 Z1
    G90

    The 39.55mm value I have determined by simply probing and then slowly lowering the Z axis until it touched the surface under the probe. While the probe is announced as 40mm tall, the contact is changing its state after the first 0.45mm, hence the 39.55mm probe height for the software.


  • administrators

    @mwinterm said in Setting WCS with probe:

    I'm using a DuetWifi to control a CNC router. I have a Z-probe mounted and would like to set Z-coordinate of a WCS by probing my work piece. I could not find the needed functionality and therefore implemented a G30 S-3 in the firmware. Would there have been another option to do this without modifying the software?

    Have you looked at the description of the M585 command, https://duet3d.dozuki.com/Wiki/GCode#Section_M585_Probe_Tool ?



  • @Catalin_RO : Thank you for the info... I'm actually probing with a probe more in the style of https://w ww.sorotec.de/shop/Usovo-3D-Measuring-sensor.html
    However that does not make a huge difference for the z-measurement and I actually started with a macro pretty similar to yours which worked and I'm actually not sure anymore if there was any other reason to do it in the firmware then allowing to probe in x and y direction with a stylus having a ball of a specific diameter that needs to be compensated depending on the probing direction.
    Therefore I agree that for Z-probing with no need for direction-dependent compensation the proposal of @Catalin_RO works and my initial question was kind of obsolete. However for probing in X and Y I can't see yet how it should be done with the current command set.
    @dc42 : any thoughts regarding the WCS rotation?



  • @dc42 Yes, I'm very familiar with M585 as I have already made a proposal for its modification. However in my understanding M585 is strictly for tool probing and I think it makes sense not to be mixed with general probing.



  • @mwinterm Similar probing macros can be written for all axis as long as you don't need more advanced functionality, like center of piece/hole detection. Those could be written as macros if/when local variables will be supported, or at least some way to access WCS and do simple math with it. Alternatively, those could be written as higher level functionality in DWC or something similar.

    Please, let's not forget that 10 months ago the Duet firmware was not supporting WCS and CNC support was quite minimal, not to mention more trivial features like G2/G3 support (added just a little bit before that). These days we have the first CNC mill/router that is delivered by default with the Duet controller - that is the latest update of the WorkBee from Ooznest. So things are evolving pretty quickly in the firmware!



  • @Catalin_RO: Please don't misunderstand me. I'm very happy and excited about the DuetFirmware. This is not critics at all.
    What I'm not so clear is how I would deduct the stylus ball radius from my probe result. To my knowledge I can not do any math in the macros and I can as well not handle it as a probe offset as its sign is dependent from which direction I'm probing (as for Z-probing I always know where I'm probing from...)
    In that context I would be happy to implement and share the according functionality. However of course I want to make sure that such a functionality is meaningful i.e. it can not be achieved on a macro basis in an easy way...


  • administrators

    @mwinterm said in Setting WCS with probe:

    @Catalin_RO: Please don't misunderstand me. I'm very happy and excited about the DuetFirmware. This is not critics at all.
    What I'm not so clear is how I would deduct the stylus ball radius from my probe result. To my knowledge I can not do any math in the macros and I can as well not handle it as a probe offset as its sign is dependent from which direction I'm probing (as for Z-probing I always know where I'm probing from...)
    In that context I would be happy to implement and share the according functionality. However of course I want to make sure that such a functionality is meaningful i.e. it can not be achieved on a macro basis in an easy way...

    Conditional GCode, variables and arithmetic are planned for firmware 2.03.



  • That is great news!


Log in to reply