Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

NIIGATA CODES


Recommended Posts

Hello everyone,
    I am trying to understand these codes but I have no luck, I only guess...:

/2 G5.1 P1 Q0 =====> HIGH SPEED ON MODE?
G5.1 Q1 =====> HIGH SPEED OFF MODE?

Then....

G5.1 P1 Q0 =====> CODE FOR ALL DRILL CYCLES?
G5.1 Q1 =====> CODE FOR ALL DRILL CYCLES?
M42 =====> DON'T KNOW


 

This machine is using "HALF COMP", thank you for your info.

 

Link to comment
Share on other sites

"M42" is typically a "Gear Code".

NOTE:

  1. DO NOT JUST HAND-EDIT A LITERAL STRING "M42"!!!!
  2. There is an existing "mechanism" inside MP to control Gear Code output.
  3. All you have to do is turn "use_gear" to "1". <--- That turns on Gear M-Code Output
  4. To change the Speeds for each Gear Range, you need to edit the Lookup Table for the Gear Spindle Ranges.

The Gear Selection Code "Lookup Table" looks like this:

# Define the gear selection code
flktbl  1       3       #Lookup table definition - table no. - no. entries
        40      0       #Low gear range
        41      400     #Med gear range
        42      2250    #Hi gear range

 

Note that this table is setup "by default" for 3 speed ranges, but you can edit it to make it "2" ranges, or add additional rows, to make it "4" or even "5" ranges, if needed.

So how does it work?

The special Function 'frange' is used to "look up" a value from the "left" column, based on the "variable" passed, and the value of the variable, compared to the values in the "right" column.

In this case, the "selector variable", is the variable 'speed'. (which is already calculated for you, by the Post logic!)

Take the "flktbl" values I listed above for this example.

  • Say your Spindle Speed is 386. When the call to the lookup table occurs, the value is greater than "0", but less than "400", so the 1st Row (0th item in the list), is returned. In this case, we return "40". Because of how the "gear" variable is formatted, we stick the Prefix String "M" in front of it, and MP outputs "M40", or gear range 1.
  • Say your Spindle Speed is 400. When the call is made to the lookup table, it is = to the value of the 2nd row, in the Right Column. This returns "row 2" (item "1" in the list, remember, we start counting at "0" as the 1st row). Row "2" returns the value '41', so the output is "M41" because of formatting.
  • Say your Spindle Speed is 1850. When we run the lookup table, the value is less than the 3rd row, right column value of 2250. So the function still returns "row 2", or a value of '41'. We get an output of M41.
  • Say your Spindle Speed is 2250, or GREATER, in this case, we will always return "42", and the output will be M42, or "high gear range".

 

So, what if you have 4 gear ranges, M41, M42, M43, M44?    No Problem. Just modify the ranges in the Lookup Table, and the # of Table Entries (Very important!)

Example:

# Define the gear selection code
flktbl  1       4       #Lookup table definition - table no. - no. entries
        41      0       #Low gear range 0-649 = M41
        42      650     #2nd gear range 650-1299 = M42
        43      1300    #3rd gear range 1300-1999 = M43
        44      2000    #4th gear range 2000-max rpm = M44

 

  • Like 1
Link to comment
Share on other sites

Ok, this is what I found out.

/2 G5.1 P1 Q0 =====> End Mills with allowing FEEDRATE override at the control ON
G5.1 Q1 =====> End Mills with allowing FEEDRATE override at the control OFF

Then....

G5.1 P1 Q0 =====>  All drill cycles allowing FEEDRATE override at the control ON
G5.1 Q1 =====> All drill cycles allowing FEEDRATE override at the control ON

Link to comment
Share on other sites
11 hours ago, Colin Gilchrist said:

"M42" is typically a "Gear Code".

NOTE:

  1. DO NOT JUST HAND-EDIT A LITERAL STRING "M42"!!!!
  2. There is an existing "mechanism" inside MP to control Gear Code output.
  3. All you have to do is turn "use_gear" to "1". <--- That turns on Gear M-Code Output
  4. To change the Speeds for each Gear Range, you need to edit the Lookup Table for the Gear Spindle Ranges.

The Gear Selection Code "Lookup Table" looks like this:


# Define the gear selection code
flktbl  1       3       #Lookup table definition - table no. - no. entries
        40      0       #Low gear range
        41      400     #Med gear range
        42      2250    #Hi gear range

 

Note that this table is setup "by default" for 3 speed ranges, but you can edit it to make it "2" ranges, or add additional rows, to make it "4" or even "5" ranges, if needed.

So how does it work?

The special Function 'frange' is used to "look up" a value from the "left" column, based on the "variable" passed, and the value of the variable, compared to the values in the "right" column.

In this case, the "selector variable", is the variable 'speed'. (which is already calculated for you, by the Post logic!)

Take the "flktbl" values I listed above for this example.

  • Say your Spindle Speed is 386. When the call to the lookup table occurs, the value is greater than "0", but less than "400", so the 1st Row (0th item in the list), is returned. In this case, we return "40". Because of how the "gear" variable is formatted, we stick the Prefix String "M" in front of it, and MP outputs "M40", or gear range 1.
  • Say your Spindle Speed is 400. When the call is made to the lookup table, it is = to the value of the 2nd row, in the Right Column. This returns "row 2" (item "1" in the list, remember, we start counting at "0" as the 1st row). Row "2" returns the value '41', so the output is "M41" because of formatting.
  • Say your Spindle Speed is 1850. When we run the lookup table, the value is less than the 3rd row, right column value of 2250. So the function still returns "row 2", or a value of '41'. We get an output of M41.
  • Say your Spindle Speed is 2250, or GREATER, in this case, we will always return "42", and the output will be M42, or "high gear range".

 

So, what if you have 4 gear ranges, M41, M42, M43, M44?    No Problem. Just modify the ranges in the Lookup Table, and the # of Table Entries (Very important!)

Example:


# Define the gear selection code
flktbl  1       4       #Lookup table definition - table no. - no. entries
        41      0       #Low gear range 0-649 = M41
        42      650     #2nd gear range 650-1299 = M42
        43      1300    #3rd gear range 1300-1999 = M43
        44      2000    #4th gear range 2000-max rpm = M44

 

Is this for Niigata, Colin?

Link to comment
Share on other sites
23 minutes ago, PcRobotic said:

Is this for Niigata, Colin?

The instructions I'm giving you are for all Milling Machines that have "M-Code activated gear selection".

So no, my response was not "Niigata specific". I have no idea what the RPM Range is for each gear, nor how many gears there actually are. You would need to get that information from the Machine Tool Builder. All MTB's will provide you with that information, as long as you have the Model and Serial number of the machine.

What I was trying to explain is the mechanism that already exists inside most MP Post Processors. The important thing is to understand that there is this Structure that is already in-place, inside the Post. By understanding how the mechanism functions, you can make the Post read the RPM value of the Spindle, and automatically select the correct M-Code for that RPM.

Once you understand how the Gear functionality works, you can edit the Post for each machine, to make the Post automatically output the correct gear code.

By the way, the same mechanism  (gear code selection, based on RPM) exists inside Lathe Posts as well.

Link to comment
Share on other sites
On 5/2/2018 at 6:49 AM, Colin Gilchrist said:

The instructions I'm giving you are for all Milling Machines that have "M-Code activated gear selection".

So no, my response was not "Niigata specific". I have no idea what the RPM Range is for each gear, nor how many gears there actually are. You would need to get that information from the Machine Tool Builder. All MTB's will provide you with that information, as long as you have the Model and Serial number of the machine.

What I was trying to explain is the mechanism that already exists inside most MP Post Processors. The important thing is to understand that there is this Structure that is already in-place, inside the Post. By understanding how the mechanism functions, you can make the Post read the RPM value of the Spindle, and automatically select the correct M-Code for that RPM.

Once you understand how the Gear functionality works, you can edit the Post for each machine, to make the Post automatically output the correct gear code.

By the way, the same mechanism  (gear code selection, based on RPM) exists inside Lathe Posts as well.

 

Thank you for your big help, Colin.  I went out and tested the "G42", it is for TOOL CHANGE DOOR. Once again, thank you for you valuable information.

Link to comment
Share on other sites
On 5/4/2018 at 6:30 AM, PcRobotic said:

 

Thank you for your big help, Colin.  I went out and tested the "G42", it is for TOOL CHANGE DOOR. Once again, thank you for you valuable information.

There you go that is what we do we go out to machine and test things and see what they do. Once we understand what they do we then develop a process to support them. Cannot have the cart before the horse. The horse has to pull the cart and in our life of work the cart is doing all this post work when you have not gone out and done the work on the machine to see what needs to happen to make it really work. Part of this is talking to people who do the work and have a rapport with them to have good support for things as well. Communication works both ways and part of good communication is humbling ourselves and listening to what others are telling us or asking question to those that know what we don't. People on the machine know a lot more than most people give them credit for and I have been made to look a lot better than I am many times by stopping and taking that time to go talk and have a conversation with the guys running the machine.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...