Measure

Results 1 to 14 of 14

Thread: Measure

  1. #1
    Member
    Join Date
    Apr 2013
    Location
    Italia
    Posts
    110
    Downloads
    0
    Uploads
    0

    Default Measure

    Hi,
    these days I have had the time to try out the new measurement features with the probe and I must say that you did an amazing job both as a script and as a graphic; all clear and functional. For the moment, for my needs, I have only added two G92 in the angles, hole, axis and ledge scripts to zero the axes at the end of the measurements; I would also like to add the probe thickness management (the usual pcb clipping) as unfortunately I don't have a 3D probe. I have already performed the first part of the script modification where in the dialog box I added a field where to insert this parameter which I then linked to the variable # <sonda> but I can't understand where and how to insert this variable in the line that calculates the value # <_ measure>. If it were possible to have an example script you would make me happy :-)
    Measure-probe-jpg

    #<_measure> = [#<_probe_axis|#<axis>> + #<dir> * #<_probe_size_axis|#<axis>>]

    Similar Threads:


  2. #2
    Member PlanetCNC's Avatar
    Join Date
    Mar 2017
    Location
    Slovenia
    Posts
    1312
    Downloads
    0
    Uploads
    0

    Default Re: Measure

    This is already taken care of with "_probe_size_axis" parameter which takes its value from "Settings/Probe Size Z" and "Settings/Probe Size XY".

    If you want to always enter value then you can change this value:
    #<_probe_size_axis|#<axis>> = #<sonda>
    Make sure you do this after #<axis> parameter is set.

    You can also set #<sonda> before dialog. For example:
    #<sonda> = #<
    _probe_sizeZ>






  3. #3
    Member
    Join Date
    Apr 2013
    Location
    Italia
    Posts
    110
    Downloads
    0
    Uploads
    0

    Default Re: Measure

    OK thanks. This evening I try.



  4. #4
    Member PlanetCNC's Avatar
    Join Date
    Mar 2017
    Location
    Slovenia
    Posts
    1312
    Downloads
    0
    Uploads
    0

    Default Re: Measure

    I will probably be online if you'll need help.



  5. #5
    Member
    Join Date
    Apr 2013
    Location
    Italia
    Posts
    110
    Downloads
    0
    Uploads
    0

    Default Re: Measure

    I tried but I didn't succeed, probably because I didn't explain well what I would like to do.
    I usually work wood, plastics and aluminum; for aluminum there are no problems the value entered in "Settings / Probe Size XY" is equal to the radius of the tool used for the measurement (I always use a rectified 3mm plug) then to the electrical contact between the tool and aluminum (conductive material ) the script already calculates the right size and moves the axis to zero (probe = 0). In cases of wood and plastics (non-conductive materials) instead I have to place the pcb plate between the tool and the workpiece whose thickness must be inserted from time to time in the dialogue window (previous post image); the value of the pcb thickness (which could also be something different from the pcb with different thickness) must be added to the value of the tool radius (Probe Size XY). Then the script should add (or deduct depending on the direction of the measurement) from the reading value to the electrical contact the sum between "Probe Size XY" and "probe" and then move the axis to zero.

    Your example goes to replace the value of "_probe_size_axis" with the value of "probe" (and it also writes it in "Settings / Probe Size XY") while that parameter must remain as inserted in the settings: I don't even want to change the value of " Probe Size Z "because the measurements on Z are always performed with the pcb plate.
    I hope I haven't bored you ... :-) Measure-spindle-jpg



  6. #6
    Member PlanetCNC's Avatar
    Join Date
    Mar 2017
    Location
    Slovenia
    Posts
    1312
    Downloads
    0
    Uploads
    0

    Default Re: Measure

    Ok, what if you do this:
    Code:
    #<_measure> = [#<_probe_axis|#<axis>> + #<dir> * #<_probe_size_axis|#<axis>> + #<dir> * #<sonda>]




  7. #7
    Member
    Join Date
    Apr 2013
    Location
    Italia
    Posts
    110
    Downloads
    0
    Uploads
    0

    Default Re: Measure

    this happens:

    GCode Error:
    Line:104 #<_measure> = [#<_probe_axis|#<axis>> + #<dir> * #<_probe_size_axis|#<axis>> + #<dir> * #<sonda>]
    Invalid number 'NAN'

    Last edited by mar_cone; 12-04-2019 at 12:56 PM.


  8. #8
    Member PlanetCNC's Avatar
    Join Date
    Mar 2017
    Location
    Slovenia
    Posts
    1312
    Downloads
    0
    Uploads
    0

    Default Re: Measure

    Please post your complete script.



  9. #9
    Member
    Join Date
    Apr 2013
    Location
    Italia
    Posts
    110
    Downloads
    0
    Uploads
    0

    Default Re: Measure

    I do not see where I can attach files ... public as if it were text?



  10. #10
    Member
    Join Date
    Apr 2013
    Location
    Italia
    Posts
    110
    Downloads
    0
    Uploads
    0

    Default Re: Measure

    Found ... attached script

    Attached Files Attached Files


  11. #11
    Member PlanetCNC's Avatar
    Join Date
    Mar 2017
    Location
    Slovenia
    Posts
    1312
    Downloads
    0
    Uploads
    0

    Default Re: Measure

    There is no "Spessore sonda a contatto" dialog item in this script?
    I thought you added it and set parameter #<sonda> with it? Like in screenshot above?



  12. #12
    Member
    Join Date
    Apr 2013
    Location
    Italia
    Posts
    110
    Downloads
    0
    Uploads
    0

    Default Re: Measure

    I apologize, it was the backup file
    this is the right one

    Attached Files Attached Files


  13. #13
    Member PlanetCNC's Avatar
    Join Date
    Mar 2017
    Location
    Slovenia
    Posts
    1312
    Downloads
    0
    Uploads
    0

    Default Re: Measure

    #<sonda> is local parameter. It is not visible in subprocedure <probe>.
    In code below it is send to subprocedure as third argument. See what I did. It should work now.

    Code:
    (name,Misura Assi)
    
    
    O<PlanetCNC> if[[#<_probe_pin_1> EQ 0] AND [#<_probe_pin_2> EQ 0]]
      (msg,Sensore non configurato)
      M2
    O<PlanetCNC> endif
    
    
    (dlgname,Misura Assi)
    (dlg,Selezionare posizione di partenza, typ=label, x=20, w=455, color=0xffa500)
    (dlg,data::MeasureAxis, typ=image, x=0)
    (dlg,|X+|X-|Y+|Y-, typ=checkbox, x=50, w=425, def=1, param=strt)
    (dlg,Spessore Sonda a contatto, typ=label, x=40, w=455, color=0xffa500)
    (dlg,mm, x=0, dec=2, def=1.5, min=0.1, max=200, param=sonda)
    (dlgshow)
    
    
    M73 ;store state, auto restore
    G17 G90 G91.1 G90.2 G08 G15 G94
    M50P0 ;disable speed override
    M55P0 ;disable trans
    M56P0 ;disable warp
    M57P0 ;disable swap
    M10P1 ;motor enable
    M11P1 ;probe enable
    
    
    #<startx> = #<_machine_x>
    #<starty> = #<_machine_y>
    #<startz> = #<_machine_z>
    
    
    
    
    o<st> if [#<strt> EQ 1]
      #<axis> = 0
      #<dir> = +1
    o<st> elseif [#<strt> EQ 2]
      #<axis> = 0
      #<dir> = -1
    o<st> elseif [#<strt> EQ 3]
      #<axis> = 1
      #<dir> = +1
    o<st> elseif [#<strt> EQ 4]
      #<axis> = 1
      #<dir> = -1
    o<st> else
      (msg,Error)
      M2
    o<st> endif
    
    
    #<pos> = #<_machine_axis|#<axis>>
    O<probe> call [#<axis>] [#<dir>] [#<sonda>]
    #<_measure> = #<_return>
    G53 G00 H#<axis> E#<pos>
    
    
    G53 G00 Z#<_probe_safeheigh>
    
    
    G53 G00 H#<axis> E#<_measure>
    
    
    o<st> if [#<strt> EQ 1]
      (print,Coordinata Assoluta X)
      (print,|!#<_measure>)
      (print,Spessore Sonda)
      (print,|!mm #<sonda>)
      (print,Raggio Utensile)
      (print,|!mm #<_probe_sizeXY>)
      G92 X0.0000
      (print,Coordinata di lavoro X impostata a 0)
      (print,|!------------------------------------)
    o<st> elseif [#<strt> EQ 2]
      (print,Coordinata Assoluta X)
      (print,|!#<_measure>)
      (print,Spessore Sonda)
      (print,|!mm #<sonda>)
      (print,Raggio Utensile)
      (print,|!mm #<_probe_sizeXY>)
      G92 X0.0000
      (print,Coordinata di lavoro X impostata a 0)
      (print,|!------------------------------------)
    o<st> elseif [#<strt> EQ 3]
      (print,Coordinata Assoluta Y)
      (print,|!#<_measure>)
      (print,Spessore Sonda)
      (print,|!mm #<sonda>)
      (print,Raggio Utensile)
      (print,|!mm #<_probe_sizeXY>)
      G92 Y0.0000
      (print,Coordinata di lavoro Y impostata a 0)
      (print,|!------------------------------------)
    o<st> elseif [#<strt> EQ 4]
      (print,Coordinata Assoluta Y)
      (print,|!#<_measure>)
      (print,Spessore Sonda)
      (print,|!mm #<sonda>)
      (print,Raggio Utensile)
      (print,|!mm #<_probe_sizeXY>)
      G92 Y0.0000
      (print,Coordinata di lavoro Y impostata a 0)
      (print,|!------------------------------------)
    o<st> else
      (msg,Error)
      M2
    o<st> endif
    
    
    M2
    
    
    
    
    O<probe> sub
      M73
      #<axis> = #1
      #<dir> = #2
      #<sonda> = #3
      
      M11P0 G38.2 H#<axis> E[#<dir> * 100000] F#<_probe_speed>
      G91 G01 H#<axis> E[-#<dir> * #<_probe_swdist>]
      o<low> if [#<_probe_speed_low> GT 0]
        G90 G38.2 H#<axis> E[#<dir> * 100000] F#<_probe_speed_low>
        G91 G01 H#<axis> E[-#<dir> * #<_probe_swdist>] F#<_probe_speed>
      o<low> endif
      M11P1 G90
    
    
    ;  #<_measure> = [#<_probe_axis|#<axis>> + #<dir> * #<_probe_size_axis|#<axis>>]
      #<_measure> = [#<_probe_axis|#<axis>> + #<dir> * #<_probe_size_axis|#<axis>> + #<dir> * #<sonda>]
    
    
    O<probe> endsub [#<_measure>]




  14. #14
    Member
    Join Date
    Apr 2013
    Location
    Italia
    Posts
    110
    Downloads
    0
    Uploads
    0

    Default Re: Measure

    It works perfectly; I saw my mistakes and understood them ... very useful exercise for the next scripts.
    Thanks so much



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

Measure

Measure