iDRY Vacuum Kilns

Sponsors:

Laptop Controlled Setworks

Started by cxsmith, June 28, 2023, 09:22:13 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

cxsmith

Hi Foresters,

I'm a software guy, so I'm curious if any of you know where I could go about finding out how to control a sawmill through a laptop. I'm assuming there'll be a PLC involved somewhere? What does the technology stack look like? My hypothetical use case is that I'd want to control a band or carriage saw to saw flitches from a debarked log whose heights above ground on the log are defined by a list of numbers that I have on my laptop.

A secondary case would be to cut two slabs of defined lengths off opposite ends and then also saw the cant.

As a bonus I'd like to be able to rotate the log based on feedback from a webcam.

Does anyone know what the best approach to this problem is? Could an Arduino stand in for a PLC?

Thanks.

Den-Den

My experience is with PLCs, my gut says they are more robust than an Arduino, but that may depend on brand to a great extent.
At any rate, you should sort out the motion equipment, control sensors and safety limit devices before getting too involved with the controller.
You may think that you can or may think you can't; either way, you are right.

NaySawyer

Such programs are already in use by commercial mills. They use cameras to maximize lumber output.

Ianab

This thread talks about building a basic "setworks" to control a bandsaw head.
https://forestryforum.com/board/index.php?topic=69216.0

From that it's a "simple"*** matter of having your laptop send the required cut pattern to the arduino / Pi / PLC etc and having it do it's thing. The "PLC" (whatever style you use) is what takes the cut list from either the user or a computer program, and converts that to stepper motor movements, sent to a dumb motor driver board. And monitors limit switches / rotary encoders / hall effect switches etc. If something jams the mechanicals you want it to stop and turn on an error light, or something. 

I'd also suggest that a laptop isn't the ideal tech for a sawmill. No matter how clean you try and keep things, there's dust and crud in the air. The wood processing unit's I've worked with use something like a passively cooled Intel Nuc hooked to a touchscreen, and mounted in a nice sealed box. If it needs cooling, then a fan / filter can be fitted to the box, but with modern electronics you can probably get away with passive cooling. 

***" "simple", as compared to rocket surgery. 
Weekend warrior, Peterson JP test pilot, Dolmar 7900 and Stihl MS310 saws and  the usual collection of power tools :)

beenthere

Welcome to the Forestry Forum. 

What does your lumber software do? Input, output, take verbal commands or monitor lumber quality and characteristics to make a decision be it cutting or grading? or something else?

Interesting about your control of setworks, and assume a bandmill? 
south central Wisconsin
It may be that my sole purpose in life is simply to serve as a warning to others

cxsmith

Quote from: Ianab on June 28, 2023, 11:55:25 PM
This thread talks about building a basic "setworks" to control a bandsaw head.
https://forestryforum.com/board/index.php?topic=69216.0

From that it's a "simple"*** matter of having your laptop send the required cut pattern to the arduino / Pi / PLC etc and having it do it's thing. The "PLC" (whatever style you use) is what takes the cut list from either the user or a computer program, and converts that to stepper motor movements, sent to a dumb motor driver board. And monitors limit switches / rotary encoders / hall effect switches etc. If something jams the mechanicals you want it to stop and turn on an error light, or something.

I'd also suggest that a laptop isn't the ideal tech for a sawmill. No matter how clean you try and keep things, there's dust and crud in the air. The wood processing unit's I've worked with use something like a passively cooled Intel Nuc hooked to a touchscreen, and mounted in a nice sealed box. If it needs cooling, then a fan / filter can be fitted to the box, but with modern electronics you can probably get away with passive cooling.

***" "simple", as compared to rocket surgery.
Right, so for each type of bandsaw I'd integrate with I would need custom circuitry to operate its hydraulic controls? But I know that Wood Mizer sells setworks with their mills so surely that means that their hydraulics already have some sort of electronic interface?

Also, I agree that a sawmill would be a pretty hostile environment for a laptop. Ideally it could work with a Pi that would remotely connect to the laptop.

Quote from: beenthere on June 29, 2023, 12:16:52 AM
Welcome to the Forestry Forum.

What does your lumber software do? Input, output, take verbal commands or monitor lumber quality and characteristics to make a decision be it cutting or grading? or something else?

Interesting about your control of setworks, and assume a bandmill?
My software uses computer vision and brute force to calculate the optimal way to cut a log, given a photo of its cross-section. I'd like to eventually get it to recognize checks and optimize around that as well. It can find the solution but now I'm curious about the approach to take to automate it.

longtime lurker

Neah it doesn't work that way you are simplifying it too much.

Every one of the basic programs that look at the end of the log and come up with a cut list is a fail. The reason why is that logs are never perfectly round or perfectly straight, and mostly have faults in them.

So for a start a commercial level optimiser begins with whole of log scanning to allow for flair, taper, bends, knots, hollows etc. The optimiser then positions the log for best theoretical recovery and away you go.

Except that no optimiser yet can out recover an experienced sawyer. That's because an experienced sawyer is also scanning the log during sawing using the Mark I eyeball system, and an experienced sawyer should have a feel for when to turn a log or throw the pattern out the window because the log is doing what it wants not what the order book would like.

That's because logs are living things subject to natural variation rather than an inert, consistently structured material 

On average - and this is based on a FWPA research project about 10 years back - smaller mills in Australia report about 8% higher recovery than big mills running scanners and optimising systems. 

So big mills with big chequebooks paying a fortune for state of the art equipment do less well than a guy plugging away by the seat of his pants. The advantage for the big mill and the upside of the optimising programs is that the big mill can get a mediocre result cheap without the need for skilled staff. It's about lowering the cost of producing a just acceptable product, not getting a better result.

Small mills can't afford to be just average or they go broke.

AE Gibson & Sons Optimising Twin Saw Log Edger Sawmilling Equipment & Machinery - YouTube

I'll back my eyeballs to give better recovery than that any day. But no way can I get the 80% result anywhere near as cheap. And that's a long way ahead of an end of log picture with a computer drawing pretty lines on it which won't come close to the strength of either assessment system.
The quickest way to make a million dollars with a sawmill is to start with two million.

Don P

I've been playing with an arduino for the past week or so hoping to make a simple lcd readout from a rotary encoder for each end of the Lucas. We zero to the bunks often enough and then work from there, until someone moves a scale out of sync and we lose home. And then there are 2 of us making each set, one man cranking each end of the mill, and those miscommunications. If I can look up, see the lcd at the other end and confirm we are both reading the same rather than walking over or just missing it when in doubt it would save on miscuts as well. Just knowing reliably at all times where I am in relation to home would be a big help.

I am not an electronics person so I'm stealing code for measuring wheels and modifying it, or attempting to. Bounce has been the biggest problem, some of that code is just producing junk for output.

YellowHammer

A agree, a Sawyer visually "scans" a log as a 3D entity and adjusts the cut pattern continuously as the visual cues are analyzed mentally as the cant changes and boards come off.

A 2D visualization camera based algorithm based on an initial analysis of only the ends of the logs will not meet the yield or quality requirements.

If you a doing this as a fun project, it's one thing.  If you are doing this as a "for profit" project, unless a 3D optimization scanning mechanism is incorporated and used continuously during sawing, the system will not meet the yield or lumber quality of any competent sawyer.

YellowHammerisms:

Take steps to save steps.

If it won't roll, its not a log; it's still a tree.  Sawmills cut logs, not trees.

Kiln drying wood: When the cookies are burned, they're burned, and you can't fix them.

Sawing is fun for the first couple million boards.

Be smarter than the sawdust

SawyerTed

I'm curious about the end goal here?  The original post isn't specific.

Virtually any NEW small mill at a certain price point will have a computer/PLC setworks included or as an option.  It would seem that price point is in the $30,000 +/- range.  

Most larger mills have a setworks included.  

Is the goal to retrofit "A" mill that doesn't  have a setworks?  A hobby type challenge?

Is the goal to design something for the market?  Is there a market in the small sawmill market?  I'm skeptical to be honest.

There are already a number of commercial mill setworks/optimization companies who work closely with (if not owned by) headsaw and other sawmill machine manufacturers.  
Woodmizer LT50, WM BMS 250, WM BMT 250, Kubota MX5100, IH McCormick Farmall 140, Husqvarna 372XP, Husqvarna 455 Rancher

SawyerTed

The commercial mills use optimization for two reasons - speed and lack of experienced sawyers.  

The big mills using optimization can't  out recover what an experienced sawyer can on a log by log basis. But on a day to day, week to week basis what they lack in recovery of material they make up for in production.  It's a quality versus quantity compromise. 

In a single log the commercial mill might not get what the small mill might recover but the commercial mill will cut many more logs in the same amount of time.   To do that optimization is key.  
Woodmizer LT50, WM BMS 250, WM BMT 250, Kubota MX5100, IH McCormick Farmall 140, Husqvarna 372XP, Husqvarna 455 Rancher

moodnacreek

The double L conclusion; always the best. And L.L., thanks for that scrag / scanner video. Now I know what to build next. Since I built the top saw I have bent 3 saws with heavy slabs bouncing and hitting the saw. In that video I see 2 swinging cylinder rolls besides the saws, I must have one of those.

longtime lurker

Here y'are Mister Doug, a better look at the back end of an Australian style headsaw. If you look close behind the nearest of the spiral rolls you'll get a glimpse of the air wedge underneath that kicks the flitch away from the saw as it slides down.

The Grey - 6' Breaking Down Saw with Off Bearer Roller and Air Wedge - YouTube

Eucalypts are dense and everything is geared down and rigged for a controlled slide or the weights involved break things.
The quickest way to make a million dollars with a sawmill is to start with two million.

cxsmith

Quote from: YellowHammer on June 29, 2023, 07:23:52 AM
A agree, a Sawyer visually "scans" a log as a 3D entity and adjusts the cut pattern continuously as the visual cues are analyzed mentally as the cant changes and boards come off.

A 2D visualization camera based algorithm based on an initial analysis of only the ends of the logs will not meet the yield or quality requirements.

If you a doing this as a fun project, it's one thing.  If you are doing this as a "for profit" project, unless a 3D optimization scanning mechanism is incorporated and used continuously during sawing, the system will not meet the yield or lumber quality of any competent sawyer.


Yes, after I learned about taper and sweep I've come to realize that 2D is of limited use, so I'm working on 3D. But in the meantime I want to make sure it can integrate with the head saw since otherwise it would be much less useful at scale.

Quote from: Don P on June 29, 2023, 07:20:13 AM
...I am not an electronics person so I'm stealing code for measuring wheels and modifying it, or attempting to. Bounce has been the biggest problem, some of that code is just producing junk for output.
Are you trying hardware or software debounce?

Quote from: SawyerTed on June 29, 2023, 08:16:56 AM
I'm curious about the end goal here?  The original post isn't specific.

Virtually any NEW small mill at a certain price point will have a computer/PLC setworks included or as an option.  It would seem that price point is in the $30,000 +/- range.  

Most larger mills have a setworks included.  

Is the goal to retrofit "A" mill that doesn't  have a setworks?  A hobby type challenge?

Is the goal to design something for the market?  Is there a market in the small sawmill market?  I'm skeptical to be honest.

There are already a number of commercial mill setworks/optimization companies who work closely with (if not owned by) headsaw and other sawmill machine manufacturers.  

Yes, the end goal is commercial. I assumed that price was the reason small sawmills don't use optimization, but it seems like the real answer is that sawyers are more efficient, but slower. Large mills don't want to be slow so they take the efficiency hit. I'm assuming hiring enough sawyers to keep up with the wood inflow would move the market price for sawyers enough to make it uneconomical. I'd still like to try to see if a full 3D picture could outperform - different dimensions have different values, so a computer may be able to optimize better for value.

Regardless, if I can do better than the state of the art then now large mills seem like a much better market since they'll be extremely price and quality sensitive. I know how unhumble this sounds, but I've got lots of ideas for how to optimize better and faster.

But how small is "small" and how large is "large"? Does having a rotary crane rule out being "small"? A carriage saw instead of a bandsaw? A separate debarker?

So it sounds like the first thing I should do is contact the headsaw manufacturers and see if they'd be willing to support a new setworks designer, then design my setworks to integrate with my optimizer.

SawyerTed

If you plan to try a commercial setworks and optimization venture, I strongly recommend you study the major players in the industry before making those calls.  Most are big world-wide companies associated with the major machinery companies.  

There are trade publications, trade shows and universities where you can also begin your research.

Modern optimization and setworks are doing 3D laser scanning of the entire log, ends and sides, identifying defects and adjusting sawing accordingly.  Think 3D modeling based on the multiple laser scan of the log as the log is rotated on the deck.  It can only do what it is programmed to do, but modern optimization is very sophisticated.  It can't do what a human can do in adjusting sawing but what it does is impressive 

The other thing optimization does is inform downstream processing on what is coming.  In other words, the gang knows what kind of cant is coming from the headsaw. 

While a notebook computer has plenty of processing power depending upon the device, most commercial mills implement enterprise solutions with redundancy and environmentally controlled enclosures for the optimization and setworks. 
Woodmizer LT50, WM BMS 250, WM BMT 250, Kubota MX5100, IH McCormick Farmall 140, Husqvarna 372XP, Husqvarna 455 Rancher

Southside

Another aspect is that all optimizers must be tuned by a human, for the desired output parameters given the input stock logs.  So an optimizer that is programmed to saw 16" average plantation SYP logs will have a very different set of options to choose from than one at hardwood grade mill since many of the rules for sawing pine don't apply when it comes to oak.  It's definitely not a one size fits all, or even a few, type of solution.  
Franklin buncher and skidder
JD Processor
Woodmizer LT Super 70 and LT35 sawmill, KD250 kiln, BMS 250 sharpener and setter
Riehl Edger
Woodmaster 725 and 4000 planner and moulder
Enough cows to ensure there is no spare time.
White Oak Meadows

SawyerTed

This is not a headsaw, it is a gang saw that saws cants into boards by sawing  parallel to the sweep (curve sawing) It's an example of the sophistication of both the machinery being controlled and the controlling software.  

https://youtu.be/B2-BEk2t9aE
Woodmizer LT50, WM BMS 250, WM BMT 250, Kubota MX5100, IH McCormick Farmall 140, Husqvarna 372XP, Husqvarna 455 Rancher

Southside

That's almost as impressive as the edger @YellowHammer  has. 
Franklin buncher and skidder
JD Processor
Woodmizer LT Super 70 and LT35 sawmill, KD250 kiln, BMS 250 sharpener and setter
Riehl Edger
Woodmaster 725 and 4000 planner and moulder
Enough cows to ensure there is no spare time.
White Oak Meadows

Crusarius

I think the current vision systems are top notch. I doubt you will have any chance of getting better than those. What I feel is lacking is the software algorithm to process the images to get the yield you would get from an experienced sawyer. 

I hate to say it but I think you are looking into programming more than hardware to get the best results. Good luck.

Ianab

Quote from: cxsmith on June 29, 2023, 01:34:59 AMRight, so for each type of bandsaw I'd integrate with I would need custom circuitry to operate its hydraulic controls? But I know that Wood Mizer sells setworks with their mills so surely that means that their hydraulics already have some sort of electronic interface?


The basic setworks tend to just set the "drop" of the sawhead for each board that's cut. So for example, once a "12x12 cant has been produced, the saw is programmed to slice it into 11 x 1" boards. Operator doesn't have to manually drop the saw-head 1.1" for each board. So it's faster and less error prone. 

Around a mill some functions are hydraulic, some electric, with either stepper or DC motors, or even air powered for some functions. Stepper motors have the advantage of a known movement for each "pulse" or step, So you can figure something like 100 pulses for an inch of movement. But you still need something like limit switches to zero them in. A regular motor used to control a position needs feedback as to how much it's actually moved, like a rotary encoder, and limit switches. 

On the smaller portable mills the hydraulics are generally manual, for loading / turning the log. The "heavy lifting" side of things. But if you are adding in log scanning and loading / turning functions, then you will want electric / hydraulic control, a whole other level of electro-mechanical rocket surgery. 
Weekend warrior, Peterson JP test pilot, Dolmar 7900 and Stihl MS310 saws and  the usual collection of power tools :)

cxsmith

Quote from: SawyerTed on June 29, 2023, 02:18:48 PM
This is not a headsaw, it is a gang saw that saws cants into boards by sawing  parallel to the sweep (curve sawing) It's an example of the sophistication of both the machinery being controlled and the controlling software.  

https://youtu.be/B2-BEk2t9aE
So is the idea there that sawing along the curve would yield more, but lower quality, boards and eating the price deduction from lower quality would be preferable to making fewer full-priced boards?
Quote from: Southside on June 29, 2023, 02:06:22 PM
Another aspect is that all optimizers must be tuned by a human, for the desired output parameters given the input stock logs.  So an optimizer that is programmed to saw 16" average plantation SYP logs will have a very different set of options to choose from than one at hardwood grade mill since many of the rules for sawing pine don't apply when it comes to oak.  It's definitely not a one size fits all, or even a few, type of solution.  
My algorithm already takes varying kerf into account (and could be trivially tweaked for different headsaw vs gangsaw kerf). If, aside from the influence of the kerf, the major differences are in sawing technique rather than geometry then that seems like a much more tractable problem. Can you elaborate?
Quote from: SawyerTed on June 29, 2023, 11:54:18 AM
If you plan to try a commercial setworks and optimization venture, I strongly recommend you study the major players in the industry before making those calls.  Most are big world-wide companies associated with the major machinery companies.  

There are trade publications, trade shows and universities where you can also begin your research.

Modern optimization and setworks are doing 3D laser scanning of the entire log, end and sides, identifying defects and adjusting sawing accordingly.  Think 3D modeling based on the multiple laser scan of the log as the log is rotated on the deck.  It can only do what it is programmed to do, but modern optimization is very sophisticated.  It can't do what a human can do in adjusting sawing but what it does is impressive

The other thing optimization does is inform downstream processing on what is coming.  In other words, the gang knows what kind of cant is coming from the headsaw.

While a notebook computer has plenty of processing power depending upon the device, most commercial mills implement enterprise solutions with redundancy and environmentally controlled enclosures for the optimization and setworks.
Thank you, that is helpful. The laptop was just an example of the flexibility I'd need. I think the final version should have a GPU.

Southside

I am not being flippant here but do you have experience as a sawyer? I ask based on your response. One treats the heart / juvenile / pith portions of pine vs oak very differently. A hardwood grade mill would get the most value by centering out the pith, then splitting the board along it's length and disposing of the actual pith, producing quarter sawn, ray fleck wood. If a pine mill did the same they would make two bananas, instead they will center the pith and juvenile wood into a post, 4x4, 6x6, etc and send it to be treated. 

This is but one tiny, miniscule, example that again won't apply to every scenario as that same hardwood mill might see a drop on quarter sawn grade and instead grab the side lumber and put the rest into ties since the price has jumped. 

To me your approach is akin to deciding to build a truck, one model, that would serve the daily grocery getter to the 18 wheeler market. It's just too many applications. 

Is there a demand for a specific subset of the industry that is underserved and wants automation? I don't know, but I think the entry price to this game is quite high. 
Franklin buncher and skidder
JD Processor
Woodmizer LT Super 70 and LT35 sawmill, KD250 kiln, BMS 250 sharpener and setter
Riehl Edger
Woodmaster 725 and 4000 planner and moulder
Enough cows to ensure there is no spare time.
White Oak Meadows

moodnacreek

Good edger video. On that one the whole 'saw box' moves. Somebody made one where the saws would angle [not shift] to make straight cuts on a board not being fed straight. That one in the video is appears to be a gang sawing cants.

Don P

Kind of spooky watching this conversation and thinking about what AI will do with that in the near future. Scanners can see what we cannot and the decision making ability is about to overtake our pea.


cxsmith

Quote from: Southside on June 29, 2023, 07:49:50 PM
I am not being flippant here but do you have experience as a sawyer? I ask based on your response. One treats the heart / juvenile / pith portions of pine vs oak very differently. A hardwood grade mill would get the most value by centering out the pith, then splitting the board along it's length and disposing of the actual pith, producing quarter sawn, ray fleck wood. If a pine mill did the same they would make two bananas, instead they will center the pith and juvenile wood into a post, 4x4, 6x6, etc and send it to be treated.

This is but one tiny, miniscule, example that again won't apply to every scenario as that same hardwood mill might see a drop on quarter sawn grade and instead grab the side lumber and put the rest into ties since the price has jumped.

To me your approach is akin to deciding to build a truck, one model, that would serve the daily grocery getter to the 18 wheeler market. It's just too many applications.

Is there a demand for a specific subset of the industry that is underserved and wants automation? I don't know, but I think the entry price to this game is quite high.

No, I don't have sawyer experience. But if the quartersawn lumber has to be dimensional then I could imagine that choosing the exact dimensions, offset from the center, and optimal rotation given the different values of the different dimensions would be non-trivial to do in your head For example, I'm imagining the right most column of this:




but given the shape of the log the board that's pointing due SE is a fraction of an inch longer than a standard dimensional width while the two boards to its side are slightly shorter, so moving the cut to the right would make the board pointing due SE shorter but not so short that it falls below the threshold while lengthening the one below it to surpass the threshold. Now, this is unlikely to be more valuable because shifting the center board away from the center will decrease the sum of the lengths of all boards in that quadrant, but it's possible because what matters is the dimensions that the boards can hit. Or maybe there's a way to make the cuts where each cut is perpendicular to the grain but if the axes separating the four quarters were rotated a bit it would knock a few of the boards to higher widths. Both of those optimizations I see as very unlikely for a sawyer to be able to do in his head. Now, you might respond and say, "well, what if during cutting a hidden defect is exposed?", but there's nothing stopping the algorithm from running multiple times per log - once after each cut to determine if the optimum has changed.

Does that make sense or seem like a potential usage?

Thank You Sponsors!