Closed Loop Computer Vision Enabled CNC

More
01 Aug 2024 19:48 #306661 by Hauligali22
Hello everyone!

I am very inexperienced in this field and I am attempting to develop a project. The basic premise is that I want to deposit material from a cnc machine fitted with an extruder on its end effector onto a free standing object. As the object is free standing, it may occasionally inadvertently move causing the predetermined toolpath (original g-code) to deposit material in the incorrect position. As a remedy, I am working to add cameras which can track the object being operated on and any movement will be tracked and it will automatically adjust the toolpath so that it does correctly print regardless of toolpath. I currently use mach4 to operate the machine and as such, I am struggling to determine how I can in real time, adjust the inputted g-code. I came across linuxcnc and QtPyVCP which from my own understanding, enables custom applications. Can anyone give me a sense of direction as to whether something like this can be implemented on this application? Thanks!

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

More
01 Aug 2024 19:58 - 01 Aug 2024 20:00 #306664 by Aciera
May be the 'external offsets' feature could be of interest. This will let you superimpose offsets to any axis through hal pins (ie outside of GCode) while the program is executed. LinuxCNC plasma applications use this to regulate the torch height on the sheet metal.
For a short demonstration:
Last edit: 01 Aug 2024 20:00 by Aciera.
The following user(s) said Thank You: Lcvette

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

More
02 Aug 2024 15:08 #306748 by Hauligali22
This is very interesting. Would I need additional controllers or components to enable this external offset feature or could I run this directly from LinuxCNC? Has this type of feature been explored on multiple axes simultaneously? Thanks for the response!

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

More
02 Aug 2024 15:29 #306751 by skunkworks
I would look at opencv.. (I think it is still a thing) I goofed around with it a few years ago with linuxcnc.. I can see if I can find the python code...

The following user(s) said Thank You: Aciera, onceloved

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

More
02 Aug 2024 15:30 #306752 by Aciera
No need for additional controllers but you would likely need to write a custom hal component to get your machine vision results into hal.

There is a simulation configuration 'configs/sim/axis/external_offsets/eoffsets' with external offsets for X,Y,Z axes (this will also run on a non-real time installation):

 
Attachments:

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

More
02 Aug 2024 15:40 - 02 Aug 2024 15:41 #306753 by Aciera
Regarding OpenCV there is also Dmitry's Pick and Place machine, uses OpenCV (python) for parts positioning and angular alignment.


his config files can be found here:
github.com/yur7aev/linuxpnp/tree/master/configs/pnp
Last edit: 02 Aug 2024 15:41 by Aciera.

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

More
08 Aug 2024 20:52 #307280 by Hauligali22
Hello, I have been using opencv to perform just regular tracking but I have no idea how to implement the opencv tracking algorithms in a cnc machine. Aciera has given some awesome ideas for doing the closed-loop part, how does your implementation work?

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

More
08 Aug 2024 22:00 #307282 by Hauligali22
Hello again, what is the difference between using hal and using Dmitry's pick and place machine? I have been briefly reviewing Dmitry's honestly incredible machine and it is frankly very complicated for me given my inexperience although I am hoping to obtain the necessary experience for my own project.

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

More
09 Aug 2024 11:01 #307338 by blazini36
Might be something here worth looking at

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

More
21 Aug 2024 17:12 #308321 by Hauligali22
Hello,

Thank you so much for all the help. I just wanted to confirm that applying external offsets through a custom HAL with the data obtained from a visual tracking algorithm doesn't require any additional hardware, i.e., external controllers. The only reasons I want to be 100% sure is that I currently run my cnc using mach4 and it has been made clear to me that mach4 would require an additional controller to perform what I am looking to achieve. I reached out to a motion controller company and the cost for customizing their motion controllers was very expensive. So, before I transition to LinuxCNC and overcoming the learning curve, I wanted to confirm with you if my project could all be achieved purely with software on linux? Thanks

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

Moderators: KCJLcvette
Time to create page: 0.118 seconds
Powered by Kunena Forum