Bandsaw Mill Automatic Height Program

Hello Folks, I am new here and have tried to figure out how I could automatically set the sawmill head to various heights based on a digital touch screen.

Here is an example of what I am trying to do:
I would like to have a touch screen that has options such as

  1. = 1/4 inch + 1/16 inch kerf
  2. = 1/2 inch + 1/16 inch kerf
  3. = 3/4 inch + 1/16 inch kerf
  4. = 1 inch + 1/16 inch kerf
  5. = 1 1/4 inch + 1/16 inch kerf
  6. = 1 1/2 inch + 1/16 inch kerf
  7. = 1 3/4 inch + 1/16 inch kerf
  8. = 2 inches + 1/16 inch kerf
  9. = 2 1/4 inches + 1/16 inch kerf
  10. = 2 1/2 inches + 1/16 inch kerf
    and so on to 16 inches...

I have found that some of the better bandsaw mills use an Analog Rotary Position Sensors with a .019-inch dia. nylon-coated stainless steel cable that turns some sort of POT within the module. The cable wants to auto rewind which is good.

Let's be clear that this process I am referencing to is no more dangerous that of any CNC type programs. In fact the sawyer is always behind the machine.

We simply want to select a cut of given size for example a 4/4 cut meaning 1 inch (4 X 1/4 inch) plus the 1/16 inch addition to offset the kerf of the saw blade. We want the height to adjust to that and the sawyer manually engages the forward motion of the head down the rails. Once the head reaches the end of the rails it pushes a limit switch telling the head to raise up about an inch to avoid hitting the log on the return back to the front. When the head reaches the front of the rail bed another limit switch signals that position and the Arduino takes the return height into consideration but remembers the last cuts height and positions the head again for the same 4/4 cut plus the 1/16 inch kerf and readies the head for the next pass. So, it lowers the head by the return height of 1 inch and also another 1 inch plus 1/16 inches for the blade kerf.

A good part number for the linear sensor is Mouser 824-SPD-50-3 Industrial Motion & Position Sensors COMPACT STRING POT 50" RANGE. The data sheet can be reviewed here: https://www.mouser.com/datasheet/2/418/5/NG_DS_SPD_A-1134691.pdf

The Arduino should be able to read information from the linear sensor through an analog to digital converter as it moves up and down and output one of two possible voltage tabs capable of actuating one of two relays that in turn is used to power one of two electric hydraulic switches that sends hydraulic fluid in or out of a hydraulic motor. The Arduino should be able to sense where the linear sensor is located through the (ADC) analog to digital conversion and turn off the relays. I'm not sure how control jitter but I could limit manually the flow of hydraulics so that the movement is slow.

I do not yet know how to program Arduino or Rasberry PI but I do know LINUX and fair amount of PERL script. Not that PERL has any bearing on this.

Any thoughts how this could be done?

You've got a good plan here. I own a mill, though I'll never automate it the way you're describing, for reasons that aren't relevant to your project.
Possible issues I see:

  • To achieve good resolution on the vertical movement, you'll want to go slow; to not impact operations, you'll want the vertical movement to be quick. Consider a gross-and-fine pair of valves, so you can get 95% of the way to the next position quickly, then ease into the final position.
  • Are you looking at dual hydraulics for the head lift - do you have dual feedback, or just how are you ensuring the head remains level? I'm having a hard time visualizing a head lift mechanism that operates off a single hydraulic. Mine is a hand crank that winds up two cables simultaneously. I had thought about actually automating that winding process.
  • Vibration is your enemy; the pot is spring tensioned, but will there be enough vibration in that line to mess with your positioning? I'm assuming your motor rides on the head, as mine does, and there's a LOT of vibration when the motor is running; you'll want to dampen that for the pot somehow, but filtering slows your feedback down.
    I'll be watching this thread, I think it'll be interesting. Good luck!
    C

Using the 4-to-20 mA output of the sensor and the 10-bit built-in ADC of the Arduino UNO/Nano/MEGA your measurement resolution over the 50" range will be a little under 1/16th of an inch. You may want to use an external 12-bit ADC.

Will 1024 possible values be enough for your project?

Absolutely, I think 0-255 would be enough. I just need 0-50 inches in increments of quarter inches.
Thanks for taking interest in this project.

I saw that Timber King uses this type of sensor. No, single hydraulic motor but it turns a shaft withe double roller chains on both sides to raise and lower the head. Thanks for your input into this project.

Hi, 1/16 is very fine tuned indeed. Not sure if I could adjust the blade kerf of 1/16 inch and let the circuit measure 1/4 inch movements.

Further input. You're looking for 1 in 200 readout of position, and you want it dynamic(i.e. you'll be trying to position using it). That means you'll not be able to use any smoothing or averaging to get rid of noise on that pot signal. So with the 10 bit convertor in the base line of Arduinos, you're looking at 5 counts per quarter inch. I think that's going to be at the limit of stable readings.
However, do you need 50 inches of travel? From your intro, I got the impression you're looking for 16 inches. That's going to be a lot more do-able, but you need to get a sensor that has that full range. Don't know if there's one available, but if you had an identical sensor, but with 20 or 24 inches of travel, for example, you'd have a better signal.
Also, I'm sure you're aware, but I'll mention it anyway - beware of backlash - always do your positioning by approaching the setpoint from the same direction. If I lower my head to below a cut, then rise back to the setpoint consistently, my thicknesses are a whole lot more consistent than if I approach setpoint from below for one cut, then from above for the next. It's just simple mechanics.
C

You can use pulley arrangements to get any sensor travel in relation to anything else.

What is your acceptable tolerance? If your board came out 1/32" too thick or thin, would that be OK? I would use an ADC of at least 12 bit (4096 counts), that could give 1/64" per count.

I doubt I could cut a board with as high a tolerance as 1/32. Keep in mind these are rough cut and after drying will be planed to dimensional lumber. Yes, to get that accurate would be fantastic.

I agree with you on always using the same mechanics to reach the set point. This is a huge saw capable of 42 inch widths and the gantry is very tall compared to most to accommodate large logs. The run is 32 feet. The beams are 4x6 box and 1/4 thick. It’s based on a Cook’s sawmill design where even the parts came from them. Very fortunate to have access to huge trees.

Hi, I see where the 16 inches was mentioned and What I meant by that is I don’t plan to cut lumber taller than a 16 inch piece and probably only do one offs at that height. It will for sure cut lumber as wide as 42 inches but those will be 2 to 4 inch thick slabs. Sorry about the confusion. If I’m cutting a large cant into 2 inch boards I’ll remove the upper boards well before I reach a depth of 16 inches to prevent blade binding.

I have a couple of very lengthy threads in which I was given tremendous help in coding and designing a system to do similar to what you want. I have a home built bandsaw mill (very rough and ugly, it started as a golf cart engine/frame and the band ran on the golf cart tires) that has been automated to do what it sounds like you are trying to do. It has been constantly modified over the last year and a half or so. I keep upgrading and adding more.

My mill is nowhere near the size of yours. I am jealous. I can cut about 22”-24” wide logs and the bunk will cut a board/beam 20’ long.

At the present time, I am using, a nano every arduino mounted to a pcb which I designed (I’m using “I” very loosely as I was basically walked through the process of designing the pcb on the forum with tremendous help from many forum members!) (shout out! @LarryD , @PerryBebbington and many others!)

The nano every reads a wheeled quadrature encoder that rides up and down the post of my mill head has it moves up and down. This is how I determine head height and how much to move. The quadrature encoder uses an algorithm that basically cancels out any vibration issues. This took some trial and error, but is well within the 1/32nd resolution you are looking for.

@cattledog, a forum member basically wrote all of the code for this project. Although, I will be careful saying that, as I knew absolutely nothing about coding prior to this project. He and some others spent a lot of time over the course of this project to not only code it for me, but teach me a little about coding (shoutout to @wildbill). I still just barely have a basic understanding, but I have taken the code and made several additions/modifications. I have consulted with @cattledog about these additions, and he has been tremendous help, but he would have done a MUCH better job if he had coded it all himself.

In addition to the wheeled encoder, i am using two cheap hall effect sensors. One reads a magnet mounted to the bad wheel to provide blade speed in feet per minute and the other reads four magnets on the wheel of the sawmill has it travels down the “track”. I am able to use these readings to control the speed it cuts through a log (this is still a work in progress) and the speed the head travels back after cutting through the log. I am also able to program the distance I want the head to go down the track before it stops based on this Hall effect sensor. I think you are trying to do this with limit switches?

I also have a servo motor connected to the throttle and control the engine speed based on a potentiometer that controls a cheap servo motor.

The mill now has an lcd screen mounted to it. Utilizing the buttons I use for moving the head height up and down, I am able to set distances of all of these motions. I can program the buttons to move up/down 1/4”, 3/4”, 1-1/2” etc.

I could go on and on, but I won’t. I don’t have any business offering help, as I am just learning myself, but I have learned tons because of the many mistakes I’ve made and the tremendous help of forum members! I’d be glad to send you any info/code/video I have if you are interested or think it’ll help. Just let me know!

Good luck! But, be careful it is addicting! If I can keep @cattledog hanging in there with me, I am probably not finished adding features to mine :blush: :grin: :pray:

1 Like

That sounds exactly like what I need!
Yes, please if you don’t mind send what you have to me.

Thank you in advance!

To be honest with you, I will give you anything I have, but I'm not sure what to start with. The code will be very difficult to understand because I have added so many things on top of others. In addition, it is constantly changing as i am still working on it. The main part is the wheeled encoder and whichever arduino you decide to use. Here is the wheeled encoder that I am using:

This wheel is mounted on the encoder and rides up and down the rail:

I have a few videos, but none that really show everything. The LCD screen will display the location of the head above the bunk and blade speed during a cut. I have two buttons that primarily function to move the head up/down manually as long as the button is held down. Two buttons are programed to move a set distance. I normally have these buttons programed for a 3/4" move, but it can be changed in the "menu" with the LCD.

Here is a video of the display, but it has been updated to show the distances on the screen as the move is in progress:

My head is lifted with a dc winch and the head is pulled down the track with a scooter motor. Both of these are dc motors and I have a motor Controller that supplies the speed control based on a signal it receives from the arduino. If I am understanding, you will not need this as yours is driven with hydraulics? I think you would need to control a relay? I am not sure how you control the speed or how your head moves down the track?

I also have what I call "autoSlab" which I think is what you are describing above in it this happens:

Throttle increases
blade starts spinning
head moves forward slowly in to cut
the head maintains a speed you set it at (18' per minute is what I am currently running at)
Head moves down the track a set number of feet you have set it to in the menu
Once it reaches the number of feet you have set it stops
The throttle is decreased back to an IDLE
It then raises the head up (whatever you set it to)
The head then returns back the same distance as it went forward (moving faster)
Once it has returned, The head drops down double you set to prepare for the next cut. This repeats automatically over and over until you press a button to stop it.
Here is an old video I took of this process. This was quite a while ago and a lot has changed since then, but you will get the idea. The throttle was not connected at the time of this video and the speed was controlled differently. As you can tell from the videos, the mill is very ugly and the wiring was really bad at the time, but I did improve the wiring some (still not great) thanks to forum members.

Auto Slab Video:

If you have questions, just ask I'll do my best to answer, but I am sure someone on here will be able to!

There is a ton of information here helping me eliminate noise I experienced and the design of the pcb:

This was my original build thread: It is long and has lots of trial and error:

Good Luck!

Wow! exactly what I need. I never thought about an automatic solution for cutting boards. Very nice!
Correct, my head travels using a hydraulic motor connected to a flow control valve and electric hydraulic valves. The motor, engine and plumbing are all on the gantry. I use wire from the gantry to the fixed controls on the back of the bed.That way I don't have long hydraulic lines that have to be managed for the length of the saw bed. I think I could actually control the speed using a pulsed signal to the electric valves or even just on off and control the speed with the flow control valve as it is now. Love the idea of a servo controlled throttle too. Very nice idea.

Thank you so much for all of the information and the part lists. I will surely take advantage of it. I have no idea how to code this project but will try to learn like you what I can.
You may think that your mill is ugly but what you have is a sawmill that works and is automated with great accuracy. People around here would love to have it! :slight_smile:
I hope I can get close to that precision. Amazing!

Given that, I suggest that you build a test rig to simulate the mill. For some functions, an LED will be enough to indicate that, for example, the saw should be running. Limit switches should be easy too. You may need to build a frame to allow head movement to activate the encoder.

However elaborate it is, since you will be changing the code many many times, it'll be much nicer if you don't have to walk out to the the real mill carrying your Arduino after each fix.

That PCB looks very nice too. Did you roll your own ? How did you overcome the noise to get it working like you want it too?
I didn't see the conclusion in your thread.

Very nice work you have done there.

Do you have pictures of your mill? I think that would help. I'd like to see how your hydraulics are done. I want to add hydraulics to mine for moving the log around.

I am FAR from a coder, but I'll be glad to help. When you get started, I can probably give you the portions of code I use for the function that you are trying to complete. I know that all of the form members will be much better help than I.

I designed the layout (with MUCH help on here as stated earlier) I have a cnc router, and I attempted to do a simple pcb board for trial. It worked, but I wanted something better. So, I sent the design file (I use fusion 360 That was a huge learning curve!) to JLPCB for them to create the PCB and ship it back. This was well worth the $20-25 Spent! I have the file for that too. I will probably eventually redesign it and have another set made, as I am constantly making changes and have had to physically modify my pcb some.

I am not totally convinced I have eliminated all noise, but it is definitely better! One thing that gave me fits was the gear tooth sensor that I no longer use. I am not sure that I didn't damage it some how or get a defective one. It always seemed to be pronged to noise. Another big cause(I think), which could cause you grief, is I originally used cheap motor drivers that I physically hacked to control the dc motors. They had very large automotive type relays on them. I believe these relays wreaked havoc on the electronic system being immune to noise. I have since gone to a different motor driver that uses solid state relays. It has seemed to be much better. I can find a link for it too, but I am not sure you will need it.

I am still not sure how you are planning to control speed. If you are sending pulsed signals to the electric valves? How are you going to do this? with relays? Are you going to be able to control those valves directly from the arduino? I wouldn't think so, but I'm not sure. If you plan to use relays I would go with SSR's from the beginning!

Thanks! I could have never done it without all the people on this forum.
Again, take my advice with a grain of salt. I am learning on the fly, and have made more mistakes than triumphs!