Kinematic offset

247 views
Skip to first unread message

Klemen Zhivko

unread,
Dec 16, 2015, 6:42:22 AM12/16/15
to Machinekit
Pardon me maybe I wont use the right terminology since I am just a starter in machinekit.
I was discussing with Daren, and he mentioned idea that maybe changing kinematic endstop offset for Z axis could do the job. I hope I named that correctly and it makes sense.

Maybe it would be possible to write a pru module that reads analogue voltage and writing that information back to hal could have effect of offseting toolhead or plasma torch in my case.
Ideally this should happen in RT with reading analog voltage in PRU and writing to kinematic pin.
Also it would be nice to enable this functionality (offseting of toolhead) with special gcode command. With that gcode could turn on/off functionality in certain sections of gcode.

Since I plan to use CRAMPS maybe somebody know how can I wire that pin and how that pin would be or is called in CRAMPS.hal?
I think I could test this while gcode is executing without actually having cramps on my BBB and using command line:
hal setp ...

Michael Haberler

unread,
Dec 16, 2015, 7:28:35 AM12/16/15
to Klemen Zhivko, Machinekit
I assume you have seen the thc (torch head control) component and configurations under configs/* ?


>
> --
> website: http://www.machinekit.io blog: http://blog.machinekit.io github: https://github.com/machinekit
> ---
> You received this message because you are subscribed to the Google Groups "Machinekit" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to machinekit+...@googlegroups.com.
> Visit this group at https://groups.google.com/group/machinekit.
> For more options, visit https://groups.google.com/d/optout.

Daren Schwenke

unread,
Dec 16, 2015, 7:44:11 AM12/16/15
to Machinekit, klemenz...@gmail.com
That is why I asked him to defer to the group knowledge.  :)
Essentially he wants to rotate a square pipe and be able to cut it on the long axis without programming Z.

Klemen Živkovič

unread,
Dec 16, 2015, 8:59:36 AM12/16/15
to Michael Haberler, Machinekit
The only plasma configuration I can find running machinekit is:
sim.gmoccapy.gmoccapy_plasma
I just tried to run it and I get out of memory error in dmesg of BBB.
Is this configuration too much to run on BBB?
dmesg.txt
sim.gmoccapy.gmoccapy_plasma.zip

schoo...@btinternet.com

unread,
Dec 16, 2015, 9:04:46 AM12/16/15
to machi...@googlegroups.com
....by_interface/mesa/plasma-5i20

...by_interface/parport/plasma-thc-sim

Klemen Zhivko

unread,
Dec 16, 2015, 9:13:08 AM12/16/15
to Machinekit
OK, tried by_interface/parport/plasma-thc-sim
with this output:
machinekit@beaglebone:~/machinekit$ machinekit ./configs/by_interface.parport.plasma-thc-sim/plasma_mm.ini &
[1] 2544
machinekit@beaglebone:~/machinekit$ MACHINEKIT - 0.1
Machine configuration directory is '/home/machinekit/machinekit/./configs/by_interface.parport.plasma-thc-sim'
Machine configuration file is 'plasma_mm.ini'
Starting Machinekit...
io started
halcmd loadusr io started
thc.hal:151: Pin 'estop-latch.0.fault-in' does not exist
Shutting down and cleaning up Machinekit...
Cleanup done
Machinekit terminated with an error.  You can find more information in the log:
    /home/machinekit/linuxcnc_debug.txt
and
    /home/machinekit/linuxcnc_print.txt
as well as in the output of the shell command 'dmesg' and in the terminal

Is this configuration supposed to be working?

Daren Schwenke

unread,
Dec 16, 2015, 9:18:04 AM12/16/15
to Klemen Zhivko, Machinekit
‎Of course... does a beaglebone have a parallel port? You will need to adapt it.
You received this message because you are subscribed to a topic in the Google Groups "Machinekit" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/machinekit/jTE2p9Jc6Fo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to machinekit+...@googlegroups.com.

Klemen Zhivko

unread,
Dec 16, 2015, 9:51:23 AM12/16/15
to Machinekit
OK, I commented following line in thc.hal
#net TriggerEStop logic.0.or => estop-latch.0.fault-in
in thc.hal, and I got it started but I got segmentation fault in linuxcnc

In command line I have:

machinekit@beaglebone:~/machinekit$ machinekit ./configs/by_interface.parport.plasma-thc-sim/plasma_mm.ini &
[2] 3034
[1]   Exit 255                machinekit ./configs/by_interface.parport.plasma-thc-sim/plasma_mm.ini

machinekit@beaglebone:~/machinekit$ MACHINEKIT - 0.1
Machine configuration directory is '/home/machinekit/machinekit/./configs/by_interface.parport.plasma-thc-sim'
Machine configuration file is 'plasma_mm.ini'
Starting Machinekit...
io started
halcmd loadusr io started
task pid=3169
USRMOT: ERROR: command timeout
USRMOT: ERROR: command timeout
USRMOT: ERROR: command timeout
USRMOT: ERROR: command timeout
USRMOT: ERROR: command timeout
waiting for s.axes
waiting for s.axes
waiting for s.axes
waiting for s.axes
waiting for s.axes
waiting for s.axes
waiting for s.axes
waiting for s.axes
USRMOT: ERROR: command timeout

linuxcnc.log

schoo...@btinternet.com

unread,
Dec 16, 2015, 9:52:22 AM12/16/15
to machi...@googlegroups.com


It does not matter if you have a parport, it is a sim

The problem is in thc.hal, there is a deprecated reference to estop-latch, which since the instantiated components
replaced the old ones, should be estop_latch (ie the same name as the component and the same name which is loaded with loadrt estop_latch)

I will do a PR later, in the interim it works fine and should give you some ideas
(see attached)
Selection_002.png

Klemen Zhivko

unread,
Dec 16, 2015, 9:56:26 AM12/16/15
to Machinekit, klemenz...@gmail.com
OK - for me as beginner is quite complicated configuration. Do you see torch height control in this by_interface.parport.plasma-thc-sim/plasma_mm.ini configuration?
Maybe it would be more straight forward to bring THC config from by_interface.parport.plasma-thc-sim/plasma_mm.ini to CRAMPS configuration?

What do you think?
by_interface.parport.plasma-thc-sim.zip

schoo...@btinternet.com

unread,
Dec 16, 2015, 10:04:18 AM12/16/15
to machi...@googlegroups.com
PR #831 now fixes this - chance to test the new system!

Michael Haberler

unread,
Dec 16, 2015, 12:31:20 PM12/16/15
to Klemen Zhivko, Machinekit

> Am 16.12.2015 um 15:51 schrieb Klemen Zhivko <klemenz...@gmail.com>:
>
> OK, I commented following line in thc.hal
> #net TriggerEStop logic.0.or => estop-latch.0.fault-in
> in thc.hal, and I got it started but I got segmentation fault in linuxcnc

please report an error by following https://github.com/machinekit/machinekit-docs/blob/master/machinekit-documentation/getting-help.asciidoc#reporting-an-error (all of it)



- Michael
> <linuxcnc.log>

Klemen Zhivko

unread,
Dec 16, 2015, 4:18:02 PM12/16/15
to Machinekit, klemenz...@gmail.com
Since @Schooner posted PR for this - @Michael do you want me still to report all this 8 points?
I will keep those 8 points in my mind before reporting an error.

automata

unread,
Dec 17, 2015, 7:28:32 AM12/17/15
to Machinekit, klemenz...@gmail.com
hi Klemen Zhivko,

You could think about writing a kinematics module for this (http://www.linuxcnc.org/docs/2.7/html/motion/kinematics.html).

First step should be to try to cut on the side of a square /rectangular pipe and not on the corner.

I assume you will have a rotation axis defined as A or B axis which will position the pipe. Call it joint 3 or 4 (base don if you choose A or B).

I started to write the kinematics but I need more information on the mechanical inputs: so you will require to tell if the rotation axis is mounted before or after the X and Y traverse axes.

In short, share the mechanical mounting and design and then we can assist with writing the kinematics module for the arrangement. 

I believe that a kinematics module for pipe cutting has been long overdue and has not received the attention it deserves and I am game to write it if someone with a machine volunteers to test it.

regards,

-automata

Klemen Živkovič

unread,
Dec 17, 2015, 8:11:26 AM12/17/15
to automata, Machinekit
Hi automata,

I will be very glad to test this.
As for the axis agreement wich axis is wich maybe we could stick to the gcode simulator I have built.
My goal would be to drive machinekit via machinetalk from java application that produces gcode.
You can see 4 axis marked with colors in attached picture:
X - blue
Y - green along pipe axis
Z - straight up
A - rotation axis around Y axis

You can check pictures of mechanical mounting with checking my album on folowing url:

I am looking forward for you reply so we can move this ahead, so if you miss some information dont hasitate to contact me.

regards 

You received this message because you are subscribed to a topic in the Google Groups "Machinekit" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/machinekit/jTE2p9Jc6Fo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to machinekit+...@googlegroups.com.
Screenshot from 2015-12-17 14:00:00.png
KinematicsMechanism.png

automata

unread,
Dec 18, 2015, 5:54:29 AM12/18/15
to Machinekit, am...@automatasystems.com
Hi Klemen Zhivko,

We need to first start with kinematics module. Can you elaborate on how you made the simulator? Did you use any kinematics for making that? If yes, you may already have built a kinematics for it and we wont have to start from scratch.

-automata

Klemen Zhivko

unread,
Dec 18, 2015, 6:34:33 AM12/18/15
to Machinekit, am...@automatasystems.com
Hi,

simulator has been made with 3d edge points exported from script of Autodesk Inventor.
Than Java program pick that 3d points, start from the edge, and while java program is hoping over one point to another it is building gcode.

The main constraint in this JAVA gcode processor is that plasma torch (or laser head) needs to be always vertically, so while moving through points rotation of pipe happens because of this fact.
All this movements are than recorded as gcode steps.

I attached picture of 3 translational axis and 1 rotational.

actually cutting head iz moving along x and z while pipe is pushed beneath this head in y axis.
Rotation A is consequence of verticality of cut head (or torch in plasma cutting).

regards
Screenshot from 2015-12-18 12:18:45.png

Klemen Zhivko

unread,
Dec 18, 2015, 6:39:06 AM12/18/15
to Machinekit, am...@automatasystems.com
You can see such machine in operation on following video:


On Friday, December 18, 2015 at 11:54:29 AM UTC+1, automata wrote:

Viesturs Lācis

unread,
Dec 18, 2015, 9:23:24 AM12/18/15
to Machinekit
First of all, I would like to ask you to stick to standard concept of coordinate axes - A rotates around X, B rotates around Y, C rotates around Z. That can save you a lot of frustration later, if you will need to get some external advice.

Second of all, I understand that you want basic THC functionality (not adding offset moves for X and Z to keep the torch tip at the same spot on tube's surface, when the rotary head is moved) and since you are using CRAMPS, I understand that you are using stepper motors. 

If that is so, it seems like an easy task to configure Machinekit. I see following workflow (I have actually built plasma machines and have some experience of setting up THC in LinuxCNC/Machinekit):
1) get the torch voltage signal to CRAMPS board and read by Machinekit - the board has some analog inputs, but I suspect that Charles is the person to explain, what kind of voltages can it read etc.
2) add thc component to your HAL file: http://linuxcnc.org/docs/html/man/man9/thc.9.html
That man page mentions encoder, because Mesa board works as voltage-to-frequency converter - it feeds pulses and those are counted with encoder module and the voltage is expressed as if it was encoder velocity; basically whatever value you get from analog input will do - it is simply compared with requested value and action is taken, based on the result of that comparison;
Connect all the HAL pins of axis.n.motor.pos-cmd and pos-fb as per that man page and you should be just fine, no need to fiddle with kinematics module.
3) If you want to control the THC from g-code, thc.enable pin can be set with M62-M65 commands, if connected to motion.digital-out-00 (etc, if 00 is already in use)

Viesturs

Klemen Živkovič

unread,
Dec 18, 2015, 10:40:41 AM12/18/15
to Viesturs Lācis, Machinekit
Viesturs,

On Fri, Dec 18, 2015 at 3:23 PM, Viesturs Lācis <viestur...@gmail.com> wrote:
First of all, I would like to ask you to stick to standard concept of coordinate axes - A rotates around X, B rotates around Y, C rotates around Z. That can save you a lot of frustration later, if you will need to get some external advice.
Ok I will then stick to B for rotation 

Second of all, I understand that you want basic THC functionality (not adding offset moves for X and Z to keep the torch tip at the same spot on tube's surface, when the rotary head is moved) and since you are using CRAMPS, I understand that you are using stepper motors. 
Ugh, as I understand if - if THC is operating, rotating pipe (moving B axis) should have effect on Z axis. Standoff of torch to pipe surface (acording to my sketch) is measured in Z direction.

If that is so, it seems like an easy task to configure Machinekit. I see following workflow (I have actually built plasma machines and have some experience of setting up THC in LinuxCNC/Machinekit):
1) get the torch voltage signal to CRAMPS board and read by Machinekit - the board has some analog inputs, but I suspect that Charles is the person to explain, what kind of voltages can it read etc.
@Charles can I measure analog voltage with craps - on what pin? 
2) add thc component to your HAL file: http://linuxcnc.org/docs/html/man/man9/thc.9.html
That man page mentions encoder, because Mesa board works as voltage-to-frequency converter - it feeds pulses and those are counted with encoder module and the voltage is expressed as if it was encoder velocity; basically whatever value you get from analog input will do - it is simply compared with requested value and action is taken, based on the result of that comparison;
Connect all the HAL pins of axis.n.motor.pos-cmd and pos-fb as per that man page and you should be just fine, no need to fiddle with kinematics module.
OK, CRAMPS board is on the way I should receive it next week. 
3) If you want to control the THC from g-code, thc.enable pin can be set with M62-M65 commands, if connected to motion.digital-out-00 (etc, if 00 is already in use)
Will check that... An I hope I could came out with reasonable and working hal file.

Viesturs Lācis

unread,
Dec 18, 2015, 12:08:05 PM12/18/15
to Machinekit, viestur...@gmail.com


On Friday, December 18, 2015 at 5:40:41 PM UTC+2, Klemen Zhivko wrote:

Second of all, I understand that you want basic THC functionality (not adding offset moves for X and Z to keep the torch tip at the same spot on tube's surface, when the rotary head is moved) and since you are using CRAMPS, I understand that you are using stepper motors. 
Ugh, as I understand if - if THC is operating, rotating pipe (moving B axis) should have effect on Z axis. Standoff of torch to pipe surface (acording to my sketch) is measured in Z direction.

THC description clearly says that it adjust torch height according to plasma tip voltage - either you did not read it or I do not understand, what exactly do you want. Which one of these 2 options?
1) adjust Z position, based on plasma tip voltage, aka standard THC;
2) adjust Z (and X as well) position to keep plasma torch tip on the same spot on the square (rectangle to be more precise) tube surface as rotary head is turning;

Klemen Živkovič

unread,
Dec 18, 2015, 2:27:26 PM12/18/15
to Viesturs Lācis, Machinekit
Viestrus,
maybe I was misunderstood - yes option 1 is the right one.


Viesturs Lācis

unread,
Dec 19, 2015, 2:18:09 PM12/19/15
to Machinekit
Then I do not understand, what is not clear to you. Yes, rotating the tube will require the torch to go up or down, but there are other reasons as well that can require to adjust torch height (material surface being curved, material not laying totally horizontal etc), that is why the plasma tip voltage is measured and the torch position is adjusted according to that (if the torch is too close, the voltage is lower, if it is too high, the voltage increases; it might be ~140-160V for 3-4 mm distance, but that will vary for particular plasma torch and plasma source). In this case it is _not important_, what are the causes. You do not need to tackle kinematics, simply implement standard THC functionality. One way to do that is the task sequence I provided.

Klemen Zhivko

unread,
Dec 23, 2015, 6:58:00 AM12/23/15
to Machinekit
OK I understand.
My first goal is to finish machine, than I will try CRAMPS setup for 5 axis with THC enabled.
I received CRAMPS board in the meantime. 
If @Charles author of CRAMPS can assign analog pin that can be used for THC it would be great.
If there is some shortcut to working INI and HAL files for CRAMPS that support THC control it would be great - I would appreciate for any example I can use so I don't need to begin from scratch..   

Klemen Zhivko

unread,
Jan 4, 2017, 4:53:57 AM1/4/17
to Machinekit
Just to follow up: machinekit with BBB and thc works on my setup - here is video of machine in action.


Dne sreda, 23. december 2015 12.58.00 UTC+1 je oseba Klemen Zhivko napisala:

Klemen Zhivko

unread,
Jan 20, 2017, 1:41:15 PM1/20/17
to Machinekit
And another youtube video cutting whole part.
https://www.youtube.com/watch?v=DdLqBqbmIEE&t=101s

Dne sreda, 04. januar 2017 10.53.57 UTC+1 je oseba Klemen Zhivko napisala:

Bas de Bruijn

unread,
Jan 20, 2017, 2:13:03 PM1/20/17
to Klemen Zhivko, Machinekit
Nice video! Well done
You received this message because you are subscribed to the Google Groups "Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to machinekit+...@googlegroups.com.

Daren Schwenke

unread,
Jan 20, 2017, 11:30:04 PM1/20/17
to Machinekit
Much better video.  :)
Looking good..
Reply all
Reply to author
Forward
0 new messages