Probe in Mach3 Gives me Wrong Setting


Results 1 to 9 of 9

Thread: Probe in Mach3 Gives me Wrong Setting

  1. #1
    Member kolias's Avatar
    Join Date
    May 2009
    Location
    Canada
    Posts
    1326
    Downloads
    0
    Uploads
    0

    Default Probe in Mach3 Gives me Wrong Setting

    In my new cnc I use the following script to set the spindle height and instead of getting 1.0000 I get 1.3750. The probe works good as per Mach3 diagnostic screen and I have used the same script in other machines before and she works good.

    Message( "Auto Zeroing..." )
    If IsSuchSignal (22) Then
    code "G31 Z-3 F20"
    While IsMoving()
    Wend
    Call SetDRO( 2, .375 )
    code "G1 Z1"
    End If

    Can you tell me where I should look to solve this problem?

    Thanks

    Similar Threads:
    Attached Thumbnails Attached Thumbnails Probe in Mach3 Gives me Wrong Setting-autozero-jpg  
    Nicolas


  2. #2
    Member CitizenOfDreams's Avatar
    Join Date
    Nov 2012
    Location
    USA
    Posts
    1267
    Downloads
    4
    Uploads
    0

    Default Re: Probe in Mach3 Gives me Wrong Setting

    Sounds like your Mach3 is in absolute (G91) mode at the time the script is running. Try changing line #7 to:

    Code:
    code "G90 G1 Z1"
    Also keep in mind that "G31 Z-3" may not do what you expect it to do.

    If the current mode is G90, it means "probe towards position Z=-3".

    If the current mode is G91, it means "probe 3 units down from the current position".

    It seems most sample Mach3 scripts found on the Interwebs simply assume the current mode is G90 and don't bother setting the desired mode.



  3. #3
    Member kolias's Avatar
    Join Date
    May 2009
    Location
    Canada
    Posts
    1326
    Downloads
    0
    Uploads
    0

    Default Re: Probe in Mach3 Gives me Wrong Setting

    Thanks for your time CitizenOfDreams, I have been using this script for years in my previous machines and never had a problem with it however I don’t know if its related all my previous machines were with Mach3 using the printer port and now for the first time I use Mach3 with ESS.

    I will do what you suggest today however I noticed that my script which I copied from the Web years ago may not be among the best in all circumstances. Would you like to suggest another script?

    If you do, please keep in mind that I have no knowledge to understand scripts and so I will just copy what you suggest and run it,

    Nicolas

    Nicolas


  4. #4
    Member kolias's Avatar
    Join Date
    May 2009
    Location
    Canada
    Posts
    1326
    Downloads
    0
    Uploads
    0

    Default Re: Probe in Mach3 Gives me Wrong Setting

    Looks like your solution CitizenOfDreams is in the right direction. After changing line #7 to what you said:

    First try when the spindle was descending I manually touched the touchplate(I always do that first) to the bit and then the spindle went down and stopped.

    Second try it was perfect and the Z DRO reads +1.0000

    Third try was like the first try but now the spindle went down in 2 steps, about 1/2" each step and then went up and the Z DRO again reads +1.0000.

    So I suspect if I can change my script to the “desired mode” as you explained I will work!

    Can you please tell me how to do that”

    Thanks

    Nicolas


  5. #5
    Member CitizenOfDreams's Avatar
    Join Date
    Nov 2012
    Location
    USA
    Posts
    1267
    Downloads
    4
    Uploads
    0

    Default Re: Probe in Mach3 Gives me Wrong Setting

    Quote Originally Posted by kolias View Post
    So I suspect if I can change my script to the “desired mode” as you explained I will work!

    Can you please tell me how to do that”
    I personally simply use one of those "assuming" scripts that expect the machine to always be in G90 (absolute) mode. All my CAM programs output absolute code, so my Mach3 never changes to G91.

    To tell the truth, I am not sure how exactly G90/G91 commands work in Mach3. Are they always modal? Are they nonmodal if you put them in the same line with G1? If they are always modal, how do you write a script that does not mess it up for other scripts/programs?

    In other words, I need to do some research and testing. Maybe someone else could chime in and share some info with us?



  6. #6
    Member CitizenOfDreams's Avatar
    Join Date
    Nov 2012
    Location
    USA
    Posts
    1267
    Downloads
    4
    Uploads
    0

    Default Re: Probe in Mach3 Gives me Wrong Setting

    OK, here is what I found.

    G90/G91 commands are always modal, no matter where or how they are used.

    So, if you ever use G90/G91 anywhere in your programs/scripts/macros/MDI, then:

    - Any script must set the appropriate G90/G91 mode for itself.
    - Any script must remember and restore the original G90/G91 mode.

    Here is what such a script could look like:

    Code:
    CurrentAbsMode = GetOemLED(48) 'Remember current G90/G91 mode
    Code "G90" 'Set mode to G90
    '--------------------------------------------
    'The main script routine goes here
    '--------------------------------------------
    If CurrentAbsMode = 0 Then
    Code "G91" 'Restore G91 mode if it was active originally
    End If




  7. #7
    Member kolias's Avatar
    Join Date
    May 2009
    Location
    Canada
    Posts
    1326
    Downloads
    0
    Uploads
    0

    Default Re: Probe in Mach3 Gives me Wrong Setting

    That’s fine CitizenOfDreams, I can wait and hopefully someone will chime in and help. In the mean time I will search to see if I find something I will understand.

    But I want to mention that a CAM program comes after I use the script to set the height of the spindle for a cut and after the height is set the script is gone. Then I load the CAM program for the cut.

    Nicolas


  8. #8
    Member CitizenOfDreams's Avatar
    Join Date
    Nov 2012
    Location
    USA
    Posts
    1267
    Downloads
    4
    Uploads
    0

    Default Re: Probe in Mach3 Gives me Wrong Setting

    Quote Originally Posted by kolias View Post
    But I want to mention that a CAM program comes after I use the script to set the height of the spindle for a cut and after the height is set the script is gone. Then I load the CAM program for the cut.
    There are situations where a script is executed in the middle of a program (for example, during a tool change). That can turn ugly if the script changes or ignores G90/G91 mode.

    Same problems can happen with other modal commands, such as G20/G21 (inches/millimeters). So, ideally, a script should preserve (and be aware of) all modal settings.



  9. #9
    Member kolias's Avatar
    Join Date
    May 2009
    Location
    Canada
    Posts
    1326
    Downloads
    0
    Uploads
    0

    Default Re: Probe in Mach3 Gives me Wrong Setting

    I understand what you are saying CitizenOfDreams and with my limited experience I agree.

    Nicolas


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Probe in Mach3 Gives me Wrong Setting

Probe in Mach3 Gives me Wrong Setting