Tailoring LinuxCNC for mechatronic painting table

More
30 Apr 2012 19:00 #19667 by jebruns
Hey all; I'm working on my senior design project (mechanical engineering), and am in much need of some aid.

Let me preface this with the fact that I'm new to Linux and LinuxCNC, most of the programming I've done is geared toward calculation (with some experience linking microprocessors to mechanical systems, i.e. arduino boards), and in general I'm in way over my head. My project involves creating a table to read g-code that's been rendered from a dxf file; it needs to pick up brushes and dip in multiple colors of ink depending on the layers in the original dxf, controlled by linuxcnc. Because the environment and the implementation is very new to me, I'm basically swimming in information and I don't really know where to start. The basic problems (that I see with my limited understanding) come from using the "tool change" function in g-code to change brushes, but also having a separate function that will dip the brush in ink after it picks it up (and between layers/colors), then can interrupt a line its painting (based on a time or distance delay) to go redip in more ink (if necessary the brush is running low), and resume painting. First of all, does this sound plausible to you guys? If this sort of functionality were to be inserted, is it something that needs to be put in at a source code level, or are there options/configuration settings that have this sort of thing? Like I said, I'm way over my head here, so my apologies for any stupid questions - and while specific help is obviously very much welcome, even someone helping narrow down the material I should look at would be awesome.

Thanks in advance all.

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

More
30 Apr 2012 23:49 #19680 by andypugh
jebruns wrote:

The basic problems (that I see with my limited understanding) come from using the "tool change" function in g-code to change brushes, but also having a separate function that will dip the brush in ink after it picks it up (and between layers/colors), then can interrupt a line its painting (based on a time or distance delay) to go redip in more ink


I think that you might find it easier to call a subroutine to grab a brush, and a similar but different one to re-dip the same brush.

Tool change does nothing if the new tool is the current tool, so would be no good for dipping.

You don't say if you want to re-dip automatically, or as part of the program.

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

More
03 May 2012 06:05 #19750 by jebruns
That sounds like the right idea, but I'm having trouble with where/how to implement these subroutines. To answer your question, it would theoretically all be done automatically - that is, at the start, the g-code is uploaded; the tool moves to the first brush, grabs it (action is controlled by an output pinned out from our breakout board), moves to the first ink color and dips, then proceeds with the line it needs to draw; while it's drawing, every 10 inches/4 seconds of movement require a redip, so it would automatically move to the correct ink pot and dip, and continue drawing. At the end of all the lines that particular brush needs to draw with that particular ink, it moves to the next color ink and draws all of those lines, etc. It then moves to drop off the first brush, picks up the second brush, and goes through the inking/drawing process, through 6 different brushes and 4 different inks. Each ink/brush combo (Brush 1, ink 1; Brush 2, ink 3, etc.) is separated into a different layer when drawing, as I've seen some machines (mainly lasercams) use this as a way to separate different "cuts." So it should all be done automatically when the g-code is uploaded; is this type of interrupt/subroutine feasible (and would it take place at the source code level)? Or is it something we'll need to program into our g-code manually?

JB

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

More
03 May 2012 10:22 #19751 by andypugh
jebruns wrote:

is this type of interrupt/subroutine feasible (and would it take place at the source code level)? Or is it something we'll need to program into our g-code manually?


The re-dipping would have to be programmed in to the G-code. It should be possible to write a pre-processor to add the re-dip code.

G-code runs from start to finish, with no provision for anything to automatically interrupt it.

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

More
04 May 2012 23:59 #19823 by jebruns
Thanks andy; that still leaves the tool change function (to switch brushes), is this able to be configured in the program after the installation? And do you think I can tack on the initial dipping in this routine?

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

More
05 May 2012 16:25 #19840 by andypugh
jebruns wrote:

Thanks andy; that still leaves the tool change function (to switch brushes), is this able to be configured in the program after the installation? And do you think I can tack on the initial dipping in this routine?


It should be possible to write a routine to perform a brush-change like a tool-change, using M6. However to make M6 run a G-code subroutine you have to re-define M6.
The sample here is close, but relies on features not in the 2.5 release (so you would have to use the development branch)
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...fab5a3b4ce26a1d1954f

It is probably easier to call an O-word subroutine to change tools and to dip.

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

Time to create page: 0.132 seconds
Powered by Kunena Forum