NativeCAM - using metric on imperial machine

More
26 Jul 2019 09:22 #140638 by verticalperformance
Config: Sherline Mill and Lathe with imperial leadscrews, Axis GUI interface

Mostly do programming in metric in NCAM.

Issue: Interface seems to take its formatting (eg number of decimal points, defaults etc) from the machine config, so the interface is optimsed for imperial inputs.

Desire: Have the ability to override the machine unit config. Some issues I noted when looking under the hood - things like the tool table are in machine units, so for things like tool compensation and other things that read the tool table and use the tool diameter, would need to know machine units, then programming units and if different convert as required.

This sub can return the tool diameter in the units of the G-Code (G20 or G21) for an imperial machine, but I don't know how to generalise it to return the tool diameter in the G-Code units, regardless of the machine being imperial or metric. At least not natively. I suppose you could read the LINEAR_UNITS = variable in the [TRAJ] section of the config file to figure out whether to multiply or divide by 25.4?
; tooldiameter:  Get the diameter of currently loaded tool in current units

o<tooldiameter> sub
(not_a_subfile)
#<tooldiam>=0

o<l0>      if [#<_current_tool> LE 0]
             (debug, tooldiameter: 0)
             (AXIS,notify, tooldiameter: 0)
o<l0> else
    o<unit> if [#<_imperial> EQ 1]
	    #<tooldiam>   =  [#5410]
    o<unit> else
	    #<tooldiam>   =  [#5410*25.4]
    o<unit> endif
o<l0>      endif

o<tooldiameter> endsub [#<tooldiam>]

Typically whenever I try to program in metric on the inch config, I tend to get errors for anything that uses tool compensation, i suspect because the lead-in radii and compensation values are a function of the tool diameter, which it thinks is 0.3937mm rather than 0.3937in (10mm) or visa versa.

As a work around, I made a "psuedo metric" machine configuration on a virtual sim machine, did my metric NCAM programming in that (which worked great) then ran the resulting code on the real inch machine, which also worked fine. But I would like to be able to the programming on the actual machine too - especially for the "uh oh, found error need to fix..."

Thanks,

Keith

Please Log in or Create an account to join the conversation.

More
26 Jul 2019 10:42 #140640 by pl7i92
ncam settings can read both imperial or metric
its in the settings set it then reread the file and you are up
no need to change things on generating

Please Log in or Create an account to join the conversation.

More
26 Jul 2019 11:39 #140644 by verticalperformance
It always seems to start in the machine units in any case.


Clicking Change Units to Metric will convert all the values however the generated G code is still in imperial units. As it has a G20 it should all cut fine though.

Using a metric machine configuration generates the code natively in mm with a G21, so again should cut fine, but a LOT more human readable if the desired programming units were mm.
Attachments:

Please Log in or Create an account to join the conversation.

Time to create page: 0.148 seconds
Powered by Kunena Forum