need help with Planet CNC scripting


Results 1 to 2 of 2

Thread: need help with Planet CNC scripting

  1. #1
    Member
    Join Date
    Feb 2016
    Location
    Lithuania
    Posts
    28
    Downloads
    0
    Uploads
    0

    Default need help with Planet CNC scripting

    Hi,

    recently i got Planet CNC controller Mk3/4. Everything is working good for me and i like it. But i need few custom cycles.I contacted Planet CNC support and i got answer that it is easy to do,all i have to do is to write new script using Gcode,create new M code and every time when i use this M code this script will be activated. I checked all scripts and all manuals which are included with Planet CNC software but i cant understand logic and syntax of these scripts. I dont know any programming language (like C, python, ...) and i dont realy understand logic of any of these programing languages. I know gcode good enought. But i still cant figure out how to make these scripts. For example i need that my cnc plasma before every cut make automatic height measure.
    I found this script:
    (name,Measure Surface Height)

    O<PlanetCNC> if[[#<_probe_pin_1> EQ 0] AND [#<_probe_pin_2> EQ 0]]
    (msg,Sensor is not configured)
    M2
    O<PlanetCNC> endif

    (dlgname,Measure Surface Height,w=340)
    (dlg,data::MeasureSurfaceHeight, typ=image, x=100)
    (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 ;limits/probe enable

    #<axis> = 2
    #<dir> = -1
    #<pos> = #<_machine_axis|#<axis>>
    O<probe> call [#<axis>] [#<dir>]
    #<_measure> = #<_return>
    G53 G00 H#<axis> E#<pos>

    (print,|!Measure Surface Height)
    (print,Result: Z=#<_measure>)
    #<off> = #<_measure>
    o<chk> if[#<_tooloff> NE 0]
    #<off> = [#<off> - #<_tooloff_axis|#<axis>>]
    o<chk> endif

    #<offw> = [#<off> - #<_coordsys_axis|#<axis>>]
    #<offc> = [#<off> - #<_workoff_axis|#<axis>>]

    (print,|!Set work position
    (print,G92.1 Z#<offw>)
    (print,|!Set coordinate system #<_coordsys,0>
    (print,G10 L2 P#<_coordsys,0> Z#<offc>)
    (print,|!------------------------------)

    M2


    O<probe> sub
    M73
    #<axis> = #1
    #<dir> = #2

    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>>]
    O<probe> endsub [#<_measure>]

    maybe there is somebody who have enough experience and time to help me explaining this script. Thank you.

    Similar Threads:


  2. #2
    Member lucaswalker's Avatar
    Join Date
    Sep 2018
    Posts
    27
    Downloads
    0
    Uploads
    0

    Default Re: need help with Planet CNC scripting

    Hi, This is not the usual Gcode programming language (which is BMACRO)

    !!! I am not familiar with this language, so I am not 100% sure of the following (but maybe it can help)

    From what I can understand is does a probbing in Z then store the result measure in the variable #<_measure>

    Then it calculate a work offsets in the form of variables #<offw> & #<offc> (they seems to have different applications)

    So you can call G92.1 Z#<offw> (which is commented in your pgm) to shift the coordinate system accordingly

    In alternative, you can store the value as an offset table G10 L2 P#<_coordsys,0> Z#<offc> (which is also commented in your pgm), and use it when you need by calling G54 in this case because its P2. But since you dont understand the details of GCode programming just try the G92 its simpler i guess



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

need help with Planet CNC scripting

need help with Planet CNC scripting