Switching between different kinematics on-the-fly

More
09 Jun 2019 22:06 - 09 Jun 2019 22:11 #136408 by jakap
Hello everyone,

my goal is to engrave the inner part of the ring by a V-carving using a drag-engraving method. I have a four axis milling machine: 3 axis XYZ + spindle rotation control (tangential knife). I made a holder to mount diamond engraving bit perpendicular to the spindle axis. The ring should be fixed to the table and the drag engraver should be moved around such that the dragging bit is always pointing perpendicular to the inner surface of the ring.

Normally, I would prefer to use Fusion360 CAM to do the job. Unfortunately, this is not possible for two reasons:
a) I am not able to convince it to engrave the inner part of the ring (wrapping the toolpaths in Fusion360 seem to work only for the outer surface).
b) it only supports 2D wrapped geometry (constant depth of engraving), not 4 axis simultaneous machining required for V-carving.

So for this engraving I set out to do a classical V-carving of flattened ring on the XY plane (y is equal to width of the ring and x equal to circumference of the ring) to export the 3 axis g-code and rather modify the kinematics of the machine to account for correct 4 axis motion. I would like to implement the following mapping:

alpha=x/(pi*D)*360;
x_new=sin(alpha)*(D/2-r-z);
y_new=cos(alpha)*(D/2-r-z)
z_new=y;

with D being the inner diameter of the ring and the r being the distance between the tip of the diamond bit and the rotation axis of the spindle.

I think implementation of the kinematics is pretty straightforward. However the problem is that I would like to switch the kinematics only when needed, while I would otherwise like to keep the old trivial kinematics (in order to home and set up the entire process).
I wonder if this is possible and how to implement this?

Alternative solution for that would be to modify the EMC2 post-processor, but I don't know how to do this.
Any ideas?
Last edit: 09 Jun 2019 22:11 by jakap.

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

More
09 Jun 2019 22:18 - 09 Jun 2019 22:20 #136409 by Grotius
@Jaka,

Did you ever tried the Sheetcam Tangential Option?
This works very nice. And you can modify the post processor to your needs if needed...

I used it for plasma bevel cutting. I could have made a patent with this, but l leave it so far.
There is no tangential plasma bevel head around.... I had one in my factory. I trowed it away a short time ago.
Last edit: 09 Jun 2019 22:20 by Grotius.

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

More
10 Jun 2019 07:59 #136446 by jakap
Unfortunately I do not have access to Sheetcam.

I just learned one can switch between "joint mode" and "world mode" in the GUI menu.
I wonder if I can then use "joint mode" for homing and jogging to position, and then switch to "world mode" to run a g-code with changed kinematics?

Maybe a bit out of my scope, but how does the homing work in complex parallel machines? Does homing setting apply to joint or world mode?

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

More
10 Jun 2019 08:19 #136448 by Hakan
There was a thread about switching between kinematics a(few?) months ago.
I think the issues they found were solved, at least the kinematics could be switched at zero,
not sure if at arbitrary position.
forum.linuxcnc.org/10-advanced-configura...s-kinematics?start=0

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

More
12 Jun 2019 12:34 #136716 by andypugh

Alternative solution for that would be to modify the EMC2 post-processor, but I don't know how to do this.
Any ideas?


You could use XYZ for cartesian and UVW for rotary (or vice-versa)
Or maybe XYZ and XVW.

A lot of "magic" can be achieved by the use of input filters that pre-process G-code files dependant on file extension.

Better, though, might be a simple kinematis with a HAL input switch, so once you are ready to "go rotary" you can set the switch and have the kinematics automatically make Y-delta distances into A-rotations.

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

More
15 Jun 2019 23:06 #137008 by jakap
Thank you all for your input.

Andy, can you elaborate on input filters for G-code preprocessing a bit more? What are they, where can I find and set them? I was thinking of doing this automatically using some simple Python scripts, however mapping some in-plane arc movements (G02/G03) to a more complex kinematics does not seem to be so straightforward.

In any case, I am more interested in changing kinematics, as this seems to be more universal solution to problems I may encounter in the future. Can you please explain a bit how to implement such HAL switch to change kinematics?

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

More
16 Jun 2019 08:25 - 16 Jun 2019 08:48 #137031 by Hakan
Here is how to switch between kinematics

+ You need to combine the kinematics you will use into one (new) c-file. Basically a copy and paste exercise.
+ The code for the two kinematics are separated by a switch
if (TCPmode) {
  xyzac kinematics code
} else {
  trivkins kinematics code
}
+ The variable TCPmode (arbitrary name) has to be added to
struct haldata
variables in the new kinematics file. It is then accessed by
int TCPmode = *(haldata->TCPmode);
It also need to be prepared in rtapi_app_main, there should already be some offset parameters. Just copy how it is done for them.
+ To set the value of TCPmode, make two macros say M100 and M101 with the lines
halcmd setp newkinematics.TCPmode 1  # (or 0)
if the new kinematics is called "newkinematics".
+ Put "newkinematics in the KINEMATICS line in the ini file.

To switch between kinematics you need to go to a position where the coordinates are the same for both kinematics, typically (0,0,0,0). Then run the M100/M101 macro and you are now using the other kinematics. If not at (0,0,0,0) there will immeditaly be a following error, and that is what they where dealing with in the last few pages of the link above.

I'll attach such a kinematics file. It is called trivkins, because there are some functions that require the name "trivkins" such as mpg jogging. It was some months ago I used this. It worked, but I wasn't happy with jogging and positioning movements and eventually went back to trivkins. Use at own risk; I will not come and repair your machine if using this.


File Attachment:

File Name: trivkins.c
File Size:7 KB
Attachments:
Last edit: 16 Jun 2019 08:48 by Hakan.

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

More
16 Jun 2019 12:08 #137041 by jmr
My simple 4 axis kinematics (it is really 5 axis with C at 0) can be switched on the fly in any position. It is for tilting platform. I believe it could be used to prioritize movements (by altering the velocity) to avoid the collision, by grouping the movements, that would be required in more complex scenarios. It basically switches the max velocity and allowed max f-error so it does not throw an error during the transition, nor does it "jump" at any crazy speed. When the transition is over (this is decided on actual f-error by the state-machine), the machine goes back to normal operation. This is done with hal components. If anyone is interested I can possibly explain this more with an example from my machine.
You can use it with the M100/M101 macro or by connecting it to any free digital input and output with M64/M65 thing, and the thing to wait for transition-done input

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

More
16 Jun 2019 14:11 #137043 by pl7i92
for knives cuts i use the HEEKSCAD CNC CAM
this gives me a real good in and out as it can overrun and move in out at any point

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

More
16 Jun 2019 14:58 #137046 by Hakan
jmr, at least I am interested. Sounds like an elegant solution.

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

Time to create page: 0.096 seconds
Powered by Kunena Forum