Touch Plate with G38. codes

New Home Forum Software / Firmware Development Touch Plate with G38. codes

This topic contains 12 replies, has 3 voices, and was last updated by  Revolto7 1 year, 4 months ago.

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
  • #29782


    Has anyone tried implementing this?

    I’m using Home’Z'(G28 I think) with a touch plate but I want to touch off the sides of a corner touch plate as well to set all 3 axis of my workpiece origin.

    What do I need to do ?


    Martin DB

    It’s on my todo list…. You have to go with RC8 Marlin…. But currently there are some problems with this version….



    Do you have a working RC8 that I could try out ?

    Do you know what pins you have to use to make it work ? I know ESTLCAM uses pins that the LCD is connected to (last I read) so I don’t think that will work for me. I also read the configuration.h where it tells you pretty much what to do in regards to assigning pins,etc.

    I’m in the process of redoing some cuts whose mortices are slightly too small, so I need to position the origin precisely, which is why this is top priority for me. So I’m trying to get the info I need and will try and get it working. Any help I can get before I dive in is appreciated.


    Martin DB

    No, I don’t have tested it yet. My RC8 is the original one but with z feedrate max to 7mm/seg.



    I’ve transposed the MPCNC settings to the RCBugFix(RC8) firmware. Some settings are specific to my machine (x and y are reversed, and end stops) but the rest are stock MPCNC. Just search for p3dCnC to see what was changed. The stock settings are left in there as well so you can see what they were originally.

    I’ll start looking into the 38.2 gcodes and touch plate stuff as soon as I have some time.



    So I’m able to upload the firmware but… When I connect with Repetier, it connects, finished with “1 command waiting” and never gets past that. Any ideas ?

    I also don’t use my LCD knob much but was going to test that out, however, it’s way too sensitive to select anything properly. Any idea how to make 1 click of a turn of the button be 1 row of the menu ?



    Here’s how to fix the knob issue(Configuration.h):

    // This option overrides the default number of encoder pulses needed to
    // produce one step. Should be increased for high-resolution encoders.
    #define ENCODER_PULSES_PER_STEP 4 // p3dCnC

    // Use this option to override the number of step signals required to
    // move between next/prev menu items.
    #define ENCODER_STEPS_PER_MENU_ITEM 1 // p3dCnC



    Reversed the direction of the knob as well:

    // This option reverses the encoder direction for navigating LCD menus.
    // If CLOCKWISE normally moves DOWN this makes it go UP.
    // If CLOCKWISE normally moves UP this makes it go DOWN.
    #define REVERSE_MENU_DIRECTION // p3dCnC



    Hangs on this M111 command..

    <Update> Never mind, typo in the Baudrate. Connecting well now.



    Almost have it working :)!

    Here are some posts that describe how to do it:

    Note that it looks like it only just recently (within weeks) has been fixed. I’ll post as soon as I have it working reliably. Was able to probe Z and X last night with G38.2 but it stopped working for some reason. Need to figure out why.


    Martin DB

    Good job! Please share your findings when ready! Also a youtube video should be great.



    ***WARNING*** I haven’t actually cut anything with this firmware yet. I only was trying to get the zProbe working. Let us know of anything that’s off if you are going to use it.

    ZProbe using RC8 (RCBugFix) is now functional (see video) yeah !:
    MPCNC doing a XYZ Probe to touch plate

    Everything I changed is marked p3dCnC. Mostly Configuration.h, a little in Configuration_adv.h and replaced the endstops.cpp (see previous links in this thread).

    My X and Y are reversed, so you’ll have to set those to true.

    Use G38.2 X(somedistance) F(somespeed) to move toward the touch plate. Similar for Y and Z. 38.3 should also work, same but does not return an error if it doesn’t find the touch plate in the distance you specify as “somedistance”.

    Here is the code I saved to a script. I place the bit above the touch plate approx 10mmx10mmx10mm from the corner:

    ; ZTouch script p3dCnC
    ; place bit approx 10mmx10mmx10mm over corner
    G92 X0 ; set current position as 0,0,0
    G92 Y0
    G92 Z0
    G21 ; use millimeters
    ; Touch off Z
    G38.2 Z-20 F300 ; move in -z direction a max of 25.4mm, stop when Z_MIN activates
    G92 Z10.4 ; Set Z to thickness of touch plate 10.4 in my case
    G0 Z15 F300 ; raise 5mm

    ; Touch off X
    G0 X-20 F3600 ; move over
    G0 Z8 F300 ; move 5mm below touch plate surface
    G38.2 X30 F300 ; move in -x direction a max of 50mm, stop when Z_MIN activates
    G92 X-10.85 ; set current postion to touch plate X offset
    G0 X-15 F3600 ; back off from the touch plate
    G0 Z15 F300 ; move up Z origin+10
    G0 X0 F3600 ; move X origin

    ; Touch off Y
    G0 Y-20 F3600
    G0 Z5 F300
    G38.2 Y30 F300 ; move in -y direction a max of 20mm, stop when Z_MIN activates
    G92 Y-10.3 ; set current postion to touch plate Y offset
    G0 Y-15 F3600 ; back away from the plate
    G0 Z15 F300 ; move to Z origin+5
    G0 X0 Y0 F3600 ; move to XY origin



    Awsome work !

    It very helpfull ! i hope you figure out some similar for tool height change. – so we can measure only offset of tool change


    or more interesting, it is possible to do something like this ?


    i know this is in estlcam, but it’s not support ramps… maybe in marlin it is possible to ?


    or marlin use mesh touch sensor for 3d printing heatbad, maybe we can use it for :


Viewing 13 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic.