What's new
What's new

Fusion 360 post processor modification

Harri89

Cast Iron
Joined
Nov 21, 2016
Hello!

I am a total newbie and been trying to look for some information to my problem with no success.

I have a deckel fp4a with grunding contour 3 control which is similar with Dialog 4.

I would need to add m07 code to the post. Its for way lubrication. The lubrication pulse is only released if it does a rapid move or a dwell with all axis stopped.

What and where i should add to the post to get this working?
The m07 needs to be before a rapid move.

Is it possible to get a m07 lube pulse and a dwell after that, example for every 50 axis moves?

I made a code line under "onrapid" "writeBlock(mformat.format(7));" and it made m07 to the code but its in unlogical places and tried to add to several places and it doesnt work how i want it.

Javascript is all new to me...

Thank you :)
 
If you ask over on the Autodesk post processor forums you can usually get help very quickly.
 
Are you sure you actually need to do this?

Lots of (usually older) controls have an m code for lube, but it's rarely required to use it - it's usually just an override for the normally timer driven lube cycle, like to force a lube pulse before a long surfacing operation etc.
 
There is a timer but it takes quite long to relube. In manual is mentioned to do a lube cycle every 50 moves (cant remember exact amount) and if they are short it should be moved certain amount to spread the oil to the ways.
 
It doesn't seem like there'd be a comprehensive way of getting this to work. Depending on what kind of work you do anyways. Sure, make it so that your post outputs M7 for every 50 moves. Then you output a program with 30 moves, one with 45 moves, one with 20 moves...all the sudden you're above 50 moves without an M7 because your post isn't keeping a rolling tally, it's only going to know what you have in one program.
 
The posts are in javascript, and can be edited in notepad++

I have done it mainly to rip out a bunch of extraneous stuff, so my knowledge is limited on how to add things in
 
There is a timer but it takes quite long to relube. In manual is mentioned to do a lube cycle every 50 moves (cant remember exact amount) and if they are short it should be moved certain amount to spread the oil to the ways.

Find out how to alter the lube cycle frequency/duration to your satisfaction on the control/machine. It could be a software parameter or it could be a timer built in to the pump, or even a mechanical timer that turns the pump on - there will be a way.

It's not a job for the post.
 
On the Dialog controls, the timing is coded in the firmware and totally inaccessible to be modified. The post could probably be edited to do what you want. On the other hand, you can just hit the manual lube button once in a while, and as soon as the code hits a G00, the lube will be applied. If you run donkey's years at G01 with no G00, then, hypothetically, you could starve the ways of lube. I have not run into that situation. Considering that my machine has no toolchanger besides by arm, I usually have to be near the machine anyway, and can hit the lube button.
 
On the Dialog controls, the timing is coded in the firmware and totally inaccessible to be modified. The post could probably be edited to do what you want. On the other hand, you can just hit the manual lube button once in a while, and as soon as the code hits a G00, the lube will be applied. If you run donkey's years at G01 with no G00, then, hypothetically, you could starve the ways of lube. I have not run into that situation. Considering that my machine has no toolchanger besides by arm, I usually have to be near the machine anyway, and can hit the lube button.

Does the control look for feedback from the lube system, besides oil level, like a pressure switch or such?

If not, I'd be very tempted to just bypass the control altogether and fit a timer relay (like a nice multifunction unit from Finder or the like) to control the lube pump, then you can configure it to run however you want.

Even if the control does look for feedback it should be simple enough to bypass that too...
 
Fusion does calculate total feed distance for an op, you can see it one of the info windows for an operation, but I did very quick search in the https://cam.autodesk.com/posts/posts/guides/Post Processor Training Guide.pdf , and there doesn't seem to a variable for it, but it might be possible to create your own variable in the post processor, something like "tempDistanceTraveled" and then a variable you set yourself, like "DistanceTraveledLubeInterval=1000", and when each block is processed by the post processor, extract the distance and add it to your tempDistanceTraveled, then compare it to DistanceTraveledLubeInterval, if tempDistance is bigger than the LubeInterval - post your custom lube code and reset the tempDistance=0

could even add correction values to each axis (when you add current block movement to your tempDistance variable), like Z axis might need more frequent lubrication, so when the Z move is added to the tempDistance, you could multiply it by 1.5 for instance before adding, and the opposite for X/Y moves for instance
 
Does the control look for feedback from the lube system, besides oil level, like a pressure switch or such?

If not, I'd be very tempted to just bypass the control altogether and fit a timer relay (like a nice multifunction unit from Finder or the like) to control the lube pump, then you can configure it to run however you want.

Even if the control does look for feedback it should be simple enough to bypass that too...

That approach might affect accuracy, because the machine has box ways that will float when the lube pressure comes on. That is why the Dialog control waits for a rapid move before applying a lube pulse, and pauses until the lube pulse is finished.
 
That approach might affect accuracy, because the machine has box ways that will float when the lube pressure comes on. That is why the Dialog control waits for a rapid move before applying a lube pulse, and pauses until the lube pulse is finished.

I used to have an old Hurco with big box ways, and this was specifically mentioned in the manual, although I forget what logic was used to determine when to pulse the lube pump. That machine always put plenty of oil on the ways in any case, but what I do remember very clearly was testing it out one day, and finding that table lift when the lube pump activated was barely measurable using a 2μm indicator...
 
as an exercise, I gave this modification a try, used Dialog 4 post available from Autodesk as a base,

what it does:
calculates G0 and G1,2,3 moves for X, Y and Z axis and keeps adding them up in a variable, if variable exceeds the set value (defined as user parameter - distance trigger), it triggers the manual pulse function

it also counts the number of linear moves done, if that exceeds the number set in user parameters dialog - triggers a lube pulse function again

you can also set dwell time after pulse, and you can switch on and off a comment in the .nc file which contains the condition that was triggered and the value it triggered at

what it doesn't do:
calculate arc lengths during circular motion, so that is not currently included in the distance traveled calculation, can be added later if it will turn out to be necessary

I'm not 100% sure if the syntax is correct for the pulse/dwell command, and if the machine control will actually execute this, since there are no G0 moves there, so might need some adjustments at there at the very end of the post, where the pulse function is defined

link to a post and a picture showing user parameters:
Capture.jpg
deckel dialog 4 with extra lube cycles.cps
 
as an exercise, I gave this modification a try, used Dialog 4 post available from Autodesk as a base,

what it does:
calculates G0 and G1,2,3 moves for X, Y and Z axis and keeps adding them up in a variable, if variable exceeds the set value (defined as user parameter - distance trigger), it triggers the manual pulse function

it also counts the number of linear moves done, if that exceeds the number set in user parameters dialog - triggers a lube pulse function again

you can also set dwell time after pulse, and you can switch on and off a comment in the .nc file which contains the condition that was triggered and the value it triggered at

what it doesn't do:
calculate arc lengths during circular motion, so that is not currently included in the distance traveled calculation, can be added later if it will turn out to be necessary

I'm not 100% sure if the syntax is correct for the pulse/dwell command, and if the machine control will actually execute this, since there are no G0 moves there, so might need some adjustments at there at the very end of the post, where the pulse function is defined

link to a post and a picture showing user parameters:
View attachment 275056
deckel dialog 4 with extra lube cycles.cps


Big thanks for doing this!!

That looked really complicated!
This is a really good example of javascript coding, how it looks in post and how it works.

I need to give this a try and load a program made with this post to my deckel and see what it says.

Cant thank you enough for your effort! :)

Did any deckel pro give this a look, if its all how it should be?
 
Fusion does calculate total feed distance for an op, you can see it one of the info windows for an operation, but I did very quick search in the https://cam.autodesk.com/posts/posts/guides/Post Processor Training Guide.pdf , and there doesn't seem to a variable for it, but it might be possible to create your own variable in the post processor, something like "tempDistanceTraveled" and then a variable you set yourself, like "DistanceTraveledLubeInterval=1000", and when each block is processed by the post processor, extract the distance and add it to your tempDistanceTraveled, then compare it to DistanceTraveledLubeInterval, if tempDistance is bigger than the LubeInterval - post your custom lube code and reset the tempDistance=0

could even add correction values to each axis (when you add current block movement to your tempDistance variable), like Z axis might need more frequent lubrication, so when the Z move is added to the tempDistance, you could multiply it by 1.5 for instance before adding, and the opposite for X/Y moves for instance

This just makes me want to go take a nap.;-)
 








 
Back
Top