Hijacking position control with a laser or other sensor signal?

More
07 Apr 2020 10:50 - 07 Apr 2020 10:51 #163037 by ross_dev
Hi

This will be a pretty unusual request, so apologies if this seems strange.

Our application is not actually machining, we are using LCNC to drive a machine across a surface and our process is more akin to 3d printing.

I would like to use a single point laser to measure the distance from the "print head" to the surface, and then have the head move to preserve a set distance, by overriding the commanded position along our z axis by some small amount.

I am guessing this is unlikely to be something you would normally want in a CNC package, but can you suggest which LCNC software modules I might look into modifying to send an "on the fly" modifier to the commanded position, as well as if LCNC can accept sensor inputs? I know this is all a little vague, I am collecting ideas around how to do this at the moment so any suggestions are welcome!

Cheers

Ross
Last edit: 07 Apr 2020 10:51 by ross_dev.

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

More
07 Apr 2020 10:59 #163038 by BeagleBrainz
Something like feed back from an encoder, is that one way of descrbing it ?
The distance you have to move to preserve the distance could be considered an error ?
The following user(s) said Thank You: ross_dev

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

More
07 Apr 2020 14:53 #163065 by PCW
This is almost identical to Plasma THC (Torch Height Control)
This also "hijacks" the Z position to maintain the plasma torch at
a fixed distance above the work (that may be uneven or warp)

One way this is implemented is by using "External Offsets"
Which I believe is now integrated into LinuxCNC 2.8:

linuxcnc.org/docs/2.8/html/motion/external-offsets.html
The following user(s) said Thank You: ross_dev, BeagleBrainz

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

More
07 Apr 2020 16:03 #163075 by BeagleBrainz
I thought that would be a better description just before I looked at your answer.

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

More
07 Apr 2020 20:58 - 07 Apr 2020 20:58 #163099 by rodw
Note that a number of sims are provided to show how external offsets can be used.

So if your sensor outputs an analog voltage denoting distance, you could use a Mesa THCAD and an encoder input to accurately measure that voltage. then you can calculate the required offset to apply.
Last edit: 07 Apr 2020 20:58 by rodw.
The following user(s) said Thank You: ross_dev

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

More
08 Apr 2020 08:40 #163173 by ross_dev
Thanks guys, this sounds super promising! I will check it out today and revert back with any further questions.

Really appreciate the help!

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

More
08 Apr 2020 13:14 - 08 Apr 2020 13:52 #163197 by ross_dev
Right, I had a play with the examples and it looks really useful!

I note from the description and hal pins that the offsets are computed on a per-axis basis for e-offset. My application is a 5 axis mill setup, and the toolpaths we use run normal to a surface, but part of a 3d shape. Imagine say a pyramid shape - the tool will run the equivalent of a facing operation on each of the 4 pyramid faces and always be normal to the surface. I need the offset to be along that normal which means offsets in multiple axes at once.

With this in mind, is it possible (out of the box) to send it via our 5 axis kinematics, and then send the components to the axis specific offsets? All the offsets end up being in the X Y and Z axes as we have a B and C rotary axis.

If not out of the box, do you have any suggestions of targets for modification? Additionally, which module contains the code for the eoffset please?

Cheers!
Last edit: 08 Apr 2020 13:52 by ross_dev.

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

More
08 Apr 2020 21:24 #163242 by rodw
I did have an attempt at doing something similar by logging the past and current axis positions (current-pos) from a component to alter behaviour if an arc was being cut and calculating the radius in real time.

motion.motion-type will tell you if you are traversing an arc or a plane. You should then be able to use some trigonometric formulas to calculate where the plane is or what is the tangent to the arc. Then you could calculate the X,Y,Z coordinates of the required offsets to from the plane or tangent to apply to each axis.

Good luck, I did not get a result but got far enough to know it would work if my maths was up to the task.

eoffsets is buried pretty deep in the motion planner stuff. Somehwere in /src/emc.

It might be possible to create a new task module and install that in your ini file. I managed to create a copy of the relevant folders and compile them to a different task module in about 30 minutes but I did not do any mods to it. You can also do the same thing to the io module loaded in the ini. Llinuxcnc is designed to support multiple task modules that can be install d in the ini file but it currently only has one! That may give you an idea how easy the "task" might be!
The following user(s) said Thank You: ross_dev

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

More
22 Apr 2020 07:49 #165054 by ross_dev
Thank you so much for your input. Given your previous experience with the idea I thought I would go with the "if you want to know what the path ahead looks like, ask someone coming back" approach and shelve it for now!

Cheers

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

Time to create page: 0.107 seconds
Powered by Kunena Forum