[solved] Bridgeport PostProcessor

Discussions around the CAM Add-On of QCAD.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Indicate the post processor used.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
KA8MID
Newbie Member
Posts: 4
Joined: Sun Dec 18, 2022 9:55 pm
Location: Pike county Ohio

[solved] Bridgeport PostProcessor

Post by KA8MID » Fri Dec 30, 2022 3:47 pm

I have been using Qcad/cam for several years on a Masso Controller on a vertical mill. When it done a tool change it would return to the last X,Y position before the Tool change. I recently Got an old Bridgeport R2E4 it has a Boss 9 controller. It works fine until I do a tool change. It does not return back to the X,Y position. Is there a way to read the X,Y postition before the tool change and return there after the toll change?
I have attached the drawing, postprocessor and the output from the post processor. I am not a machinist or a programmer. Just a retirement hobby.

windows 10
Qcad/cam Version: 3.27.8.0 (3.27.8)
Boss9.js postprocessor
Attachments
MassoXYnoZ.js
(2.13 KiB) Downloaded 238 times
MFB1-1 V8 Boss.dxf
(137.82 KiB) Downloaded 240 times
MFB1-1 V8.nc
(661 Bytes) Downloaded 239 times
Boss9.js
(1.97 KiB) Downloaded 228 times
Last edited by KA8MID on Mon Jan 02, 2023 4:27 pm, edited 2 times in total.

CVH
Premier Member
Posts: 3470
Joined: Wed Sep 27, 2017 4:17 pm

Re: Bridgeport PostProcessor

Post by CVH » Fri Dec 30, 2022 8:03 pm

Hi,

I think it is just a question of comparing the postprocessors scripts.

I know there is a MassoIN.js on the forum but just to be certain ...
... please provide your Masso postprocessors that works as intended.

Regards,
CVH

KA8MID
Newbie Member
Posts: 4
Joined: Sun Dec 18, 2022 9:55 pm
Location: Pike county Ohio

Re: Bridgeport PostProcessor

Post by KA8MID » Fri Dec 30, 2022 9:37 pm

I added the massoXYnoZ.js to the original post. I think the masso controller kept track of where it was when it got the M6. This controller M6 stays in the same place. If you set the Clear Reference point you use a M26 for a tool change. It moves off the part so you can change the tool. Neither one will return to the part.

CVH
Premier Member
Posts: 3470
Joined: Wed Sep 27, 2017 4:17 pm

Re: Bridgeport PostProcessor

Post by CVH » Sat Dec 31, 2022 9:42 am

KA8MID wrote:
Fri Dec 30, 2022 9:37 pm
I think the masso controller kept track of where it was when it got the M6.
Sorry, but there is no tool header/footer or M6 in the MassoXYnoZ.js postprocessor script.
It then relies on header/footer before/after tool change: in the GCodeBase.js file.
The header issues an M6 with the tool number and then starts the spindle CW with speed S.
The footer is empty.

The Boss9.js postprocessor script include a header and a footer definition that overwrites those of the GCodeBase.js file.
Already better is that the tool footer turns of coolant by M9 and the header turns it on after the toolchange. :wink:

The M26 is odd ... This is what I could find on that:
  • M26 resets machine zero on an axis wherever that axis happens to sit.
    Since part zero is recorded internally as a distance relative to machine zero, moving machine zero will move part zero as well.
    As a rule, part programs should not contain M26.
    The machine's homing macro will use M26, usually after the appropriate M91 or M92 home-to-switch operation, to set a machine zero position on power up.
    Thereafter you should leave machine zero alone.

    An exception is for rotary axes on a mill control.
    If you run jobs with continuous rotation (e.g. a rotisserie-style prosthetic carver) then you need a way to "reset" the axis back to zero turns in between parts, so the control won't want to unwind all those turns to get from the end point of one job back to the start point of the next.
    In that case it is reasonable to put M26, possibly combined with G92, at the end or start of the rotary job.
So, I would expect a simple M6 instead of an M26 here otherwise you reset your machine coordinates and have to redo a homing sequence and re-zero the work coordinates back regarding the workpiece.


In your first post you mention:
KA8MID wrote:
Fri Dec 30, 2022 3:47 pm
When it (= Masso) done a tool change it would return to the last X,Y position before the Tool change.
But now you say:
KA8MID wrote:
Fri Dec 30, 2022 9:37 pm
Neither one will return to the part.
Question: Did the Masso Controller return to the piece after a toolchange or did it not?
And then I don't mean that for every toolpath QCAD/CAM will position the tool at the start of the action.

How your machine handles a toolchange is usually handled by a tool change Macro in your machine driver.
That can be manually or at a certain spot in XYZ, with or without an automatic toolchanger.
Tools can sit in a tool changer magazine or at predefined positions on your machine area.
The toolchange area may even be guarded for normal operation.
To drop and pick a different tool is all handled outside QCAD/CAM, the end position of a toolchange is usually above the toolchange position.
And yes, a toolchange Macro may store the original position and return to that afterwards.
KA8MID wrote:
Fri Dec 30, 2022 3:47 pm
Is there a way to read the X,Y postition before the tool change and return there after the toll change?
Yes, variables X, Y and Z are the final positions of the last move/action by QCAD/CAM.
Simply including "[N] G0 [X] [Y]" in the tool footer would return to that last position I suppose.
I would not include [Z] but you might consider to move to Z save first.
Not sure what happens with the initial tool setting at the beginning of a job. :?

About the Boss9.js postprocessor script.
Boss9.prototype.writeHeader is enhanced to include a tool list in the G-code file header.
But at line 66 it doesn't write any of the tool info to the G-code file because the line is remarked out.
If not required then you could delete that section from your postprocessor, the part that is required is handle by CamExporterV2.js itself.

Regards,
CVH

KA8MID
Newbie Member
Posts: 4
Joined: Sun Dec 18, 2022 9:55 pm
Location: Pike county Ohio

Re: Bridgeport PostProcessor

Post by KA8MID » Sat Dec 31, 2022 2:15 pm

I guess that I confused this by mentioning how my Bridgeport Jhead with a masso controller works. I was comparing how it works to how my recently acquired machine the Bridgeport R2E4 works.
When I said
KA8MID wrote: This controller M6 stays in the same place. If you set the Clear Reference point you use a M26 for a tool change. It moves off the part so you can change the tool. Neither one will return to the part.
I was referring to the Bridgeport R2E4 with the Boss 9 controller

I am attaching Chapter 9 of the programming manual. It tells what the m codes do in this controller. It does not say anything about moving back to any prior xy positions, or resetting any of the part zero commands. On the monitor of the machine you set the clear position and the part home position. The M26 makes the machine move to the "CLR PT". The M6 the machine does not move X,Y It retracts the z axis, stops the spindle and says Tool change.
CVH wrote:Yes, variables X, Y and Z are the final positions of the last move/action by QCAD/CAM.
Simply including "[N] G0 [X] [Y]" in the tool footer would return to that last position I suppose.
I would not include [Z] but you might consider to move to Z save first.
Not sure what happens with the initial tool setting at the beginning of a job
I will try including "[N] G0 [X] [Y]"
CVH wrote:About the Boss9.js postprocessor script.
Boss9.prototype.writeHeader is enhanced to include a tool list in the G-code file header.
But at line 66 it doesn't write any of the tool info to the G-code file because the line is remarked out.
If not required then you could delete that section from your postprocessor, the part that is required is handle by CamExporterV2.js itself.
I need to clean that up. When I tried that it uploaded the tool list and the Boss 9 did not like it and would error out.
Attachments
Chapter-9.pdf
(139.33 KiB) Downloaded 242 times

CVH
Premier Member
Posts: 3470
Joined: Wed Sep 27, 2017 4:17 pm

Re: Bridgeport PostProcessor

Post by CVH » Sun Jan 01, 2023 4:28 pm

Hi,
Reading the attached Chapter 9 of the programming manual I agree that M26 doesn't clears the machine coordinates system in the Boss 9 controller.

On M6 >> 9.3.4.2 >> X and Y motion will occur, if programmed, after the Z axis retract to the "Home" position.
This is the behaviour you explained here:
KA8MID wrote:
Sat Dec 31, 2022 2:15 pm
The M6 the machine does not move X,Y It retracts the z axis, stops the spindle and says Tool change.
AKA a manual tool change.
But as explained one could include a move in X and Y.
M6 must be in G0 mode. Step 1 is stopping the spindle and the coolant so an M9 can be omitted.
Not sure but I think it can be Nxx G0 Xxxx Yyyy M6 or Nxx G0 M6 Xxxx Yyyy

M26 does exactly the same as M6 but then Z and XY are stored parameters.
KA8MID wrote:
Sat Dec 31, 2022 2:15 pm
When I tried that it uploaded the tool list and the Boss 9 did not like it and would error out.
In 9.2.1 is explained how this should be formatted.
I think that this.writeBlockFromString("[N] T[T#]//[TR#]"); should be accepted.
The second parameter is empty, QCAD/CAM doesn't handle tool length compensations.

Regards,
CVH

KA8MID
Newbie Member
Posts: 4
Joined: Sun Dec 18, 2022 9:55 pm
Location: Pike county Ohio

Re: Bridgeport PostProcessor

Post by KA8MID » Mon Jan 02, 2023 3:22 pm

Hello CVH,
CVH wrote:AKA a manual tool change.
But as explained one could include a move in X and Y.
M6 must be in G0 mode. Step 1 is stopping the spindle and the coolant so an M9 can be omitted.
Not sure but I think it can be Nxx G0 Xxxx Yyyy M6 or Nxx G0 M6 Xxxx Yyyy

M26 does exactly the same as M6 but then Z and XY are stored parameters.
I included "[N] G0 [X] [Y]" It did not act correctly until I added this to the file
this.registerVariable("xPosition", "X", true, "X", 4, { factor: 1, sign: true });
this.registerVariable("yPosition", "Y", true, "Y", 4, { factor: 1, sign: true });
I actually removed the "[N] G0 [X] [Y]" and it now puts the X and Y coordinates where they belong. If I comment them out it goes back to not working.
CVH wrote:In 9.2.1 is explained how this should be formatted.
I think that this.writeBlockFromString("[N] T[T#]//[TR#]"); should be accepted.
The second parameter is empty, QCAD/CAM doesn't handle tool length compensations.
That helped. But the tool table was in Diameter. I added the following and now it puts the diameter in the correct tool #.
this.registerVariable("toolDiameter","TD",true, "", "DEFAULT", "DEFAULT");
this.writeBlockFromString("[N] T[T#]//[TD#]");

that saves keystrokes on the front panel. It also helps to make sure when I set the Tool Zero I have the correct Diameter tool.

Thanks for the help . I can make chips now....

CVH
Premier Member
Posts: 3470
Joined: Wed Sep 27, 2017 4:17 pm

Re: [solved] Bridgeport PostProcessor

Post by CVH » Mon Jan 02, 2023 6:39 pm

KA8MID wrote:
Mon Jan 02, 2023 3:22 pm
I included "[N] G0 [X] [Y]" It did not act correctly until I added this to the file
this.registerVariable("xPosition", "X", true, "X", 4, { factor: 1, sign: true });
this.registerVariable("yPosition", "Y", true, "Y", 4, { factor: 1, sign: true });
What you are doing here is overwriting the registration of the X & Y variables as they are declared in the GCodeBase.js script.
With true in the third position you force QCAD/CAM to always export Xxxx & Yyyy.
The factor =1 is of no use and you want signed numbers.

Be aware that this doesn't cover the Z variable and that is still handled as registered in GCodeBase.js.

For the tool table it should not be necessary to register toolDiameter because it is exactly the same as already declared in GCodeBase.js :wink:

The idea is to keep GCodeBase.js as it is and overrule what is necessary in your custom PostProcessor Boss9.js

Glad to be of any assistance.
Regards,
CVH

Post Reply

Return to “QCAD/CAM”