Hello Guest it is March 27, 2023, 10:34:57 AM

Author Topic: Kinematics plugin development  (Read 4036 times)

0 Members and 1 Guest are viewing this topic.

Kinematics plugin development
« on: November 30, 2015, 10:04:09 AM »
I'm trying to develop a kinematics plugin (RTCP) for a XYZCA (head/head) type of CNC router for Mach3. I've got the equations figured out, but to get started I'd need to know some basics.

Where to find and how to get and set the points in x, y, and z axes? I looked at the blank plugin project and I see Engine->trajectories in the watch window. Is this where the upcoming points are stored? Are the numbers in TrajPoints numbers of steps/pulses in each axis? Is it safe to set them directly? I have the equations to map the points so that the tool tip is at the point where the g code tells it to be. I was planning to just read the trajectory points and set them to different value according to the mapping equations. Then I'd let Mach3 take care of sending the pulses to the motors. Do you see any problem with this?

To map the pulses to x, y and z units (mm, inch or degree), I'd need to know the number of pulses per unit? Where do I find this? I've searched the promising looking variables, but I don't find any...

Also, where do I find the tool length?
Re: Kinematics plugin development
« Reply #1 on: December 03, 2015, 09:40:46 AM »
To comment myself: I got the pulses per unit from the xml-file now (it's not perfect though, the user has to save the changes if motor tuning is changed). I haven't found the tool length yet.

I tested the idea of simply changing the pulse values in Engine->Trajectories, but this results in very abrupt changes is DROs when I hit the start cycle button and sometimes in the middle of the G code, too. I think the right way to approach the problem would be either to interface MainPlanner or change the pulses in Engine slower (so that they would approach the values given by the equations gradually). I haven't found anything to grasp on in MainPlanner, though.

The easiest way to tackle the problem would be to write the equations to Formulas window in Mach3 (Functon cfg's -> Formulas). But that doesn't work for me for some reason. If I do that my example G code stalls after a few lines.

I'm going to look at Linux CNC, too (or EMC2 which ever they call it). I don't like Linux, but in this case they seem to provide kinematics so it'll be worth the trouble if it works.