Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 08:37 28 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Airseeder height control

     Page 1 of 2    
Author Message
SteveIzett
Newbie

Joined: 04/05/2023
Location: Australia
Posts: 24
Posted: 09:45am 17 Jun 2023
Copy link to clipboard 
Print this post

Hi there friends.

My son-in-law is a farmer and has a problem with his airseeder and has asked that we provide height/depth control, replacing a faulty hydraulic flow divider.
Imagine 4 quadrants of the seeder with a hydraulic ram controlling the height of each. A flow divider is supposed to sync the rams so they are always at the same height.

He wants control in the cab to provide 3 different heights. 1. Putting down seed and fertiliser. 2. Just clearing the ground for turning at the end of a run. and 3. Fully Up for maintenance etc.

I told him that this is WAY above my pay grade and he is overestimating my ability but he is adamant that he is not interested in replacing the hydraulic flow divider and wants to give it a go together. To this end prior to to this seasons seeding we have fitted linear pots to each of the four rams and so now have micromite plus (explorer100) enabled position (height/depth) information in the cabin of his quad track. He also fitted a new electro-hydraulic valve manifold which is wired to the micromite.

Now that seeding is finished for this season he will connect the hydraulics to the new valves and we can attempt to  write the code to control the height (straight forward) but in sync (scary). I have deep concerns over writing the code necessary to keep them in sync.

My question is around an algorithm or some kind of external electronic governor with the now available position feedback to keep the rams in sync.
The hydraulic circuits having varying resistance will be I expect all over the shop without it. Therefore the existing failing hydraulic flow divider.

At this point the hydraulic valves are ON/OFF only. Another option I imagine would be to PWM drive the valves.

Any help would be very much appreciated.
What we do for our kids!
Cheers

Steve

 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 651
Posted: 10:43am 17 Jun 2023
Copy link to clipboard 
Print this post

G'Day Steve.

This is getting a bit close to home. I have had some experience with airseeders etc in the past but WOW! that is BIG.
You have a method of moving each corner up and down, so far so good but don't you need to measure the height of each corner?

It does sound like fun so good luck.

Peter
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6798
Posted: 11:20am 17 Jun 2023
Copy link to clipboard 
Print this post

I'm not sure about using PWM on the solenoid valves. It will depend on the design of the valves. On some the solonoid only controls a "bleeder" passage that allows oil through to operate the main valve. On that type PWM won't do anything apart from change what the delay is before the valve flips from one state to the other.

A true proportional valve is usually motor driven and is far more complex.

You may need some kind of Integral/Differential control, where the valve is controlled in pulses that either get shorter or have a longer time between them (or both) as the target position is approached. Possibly some sort of very low speed PWM with feedback? I'd expect each control loop to run independently but using a common reference voltage that represents the required height.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
oh3gdo
Regular Member

Joined: 18/11/2021
Location: Finland
Posts: 47
Posted: 12:30pm 17 Jun 2023
Copy link to clipboard 
Print this post

Hey, Steve.

I had have a similar problem with agricultural fellow.
I have done to him about 20 years different devices.
Last year he saw my level meter to a road machine and he got idea what he needed.

He wanted to know how his seeder devices are under the tractors back.
We designed two level meters to under tractor.
From there came levels with degrees and mm to his driving cabin.
The level meters where very accurately SCL3300, more than 0.1 degrees.
I have coveted the SPI protocol to serial uart mode and then send both sensors with the same wire to LCD into driver part.
The device worked well although the guy was about 500 km away.

What I am explaining to you that the most important thing is the measuring the position.
When you know where one level is.
It is easy to control the hydraulic level with a smart pulses to up or down.

I recommend that you do four different controllers.
Then it is easy, but if you want to control all the devices together you are in the trouble.

There are some pictures of my agricultural devices
(in Finnish)
http://remotesmart.wikidot.com/maatalous

Pekka Ritamaki
oh3gdo@gmail.com

 
SimpleSafeName

Guru

Joined: 28/07/2019
Location: United States
Posts: 319
Posted: 05:08pm 17 Jun 2023
Copy link to clipboard 
Print this post

Hi Steve,

Yeah, don't use PWN on the valve, the coils in the valve probably wouldn't last long. It wouldn't achieve what you were after either.

So is the planting position fully down with the hydraulics "deadheading" against the stop? Is it the same with the up position? Does he need to make adjustments to the planting depth during a run?

As Pekka said, one controller per section is the way to go. I'd like to see some more detail on the inclinometer that he's using.

And could we get a short video of a section going up and down? The last Case tractor that I worked on didn't have a battery, it didn't need it. :)

Kinda looked like the tractor here: https://www.youtube.com/watch?v=WYLuKOvXdQs

@Pekka, we had a Pekka here in Nashville. :) Heck of a great guy, and not a bad goalie! :)
 
SteveIzett
Newbie

Joined: 04/05/2023
Location: Australia
Posts: 24
Posted: 10:49pm 17 Jun 2023
Copy link to clipboard 
Print this post

Thanks for the input guys

Height is measured by linear pots on the 4 rams. The rams when bottomed out are a calibrated know position.

My initial logic was:
If one ram gets ahead of the average position shut it off for x time until the others catchup.
But as valves shut off a ram, the others now receive move fluid and accelerate.
So I envisage I've created a very large and heavy low frequency oscillator that needs some kind of damping.

So some kind of PID feedback control is required. Like way above my knowledge/skill.
I only have very basic coding skills and a little more in the hardware side.

Some one with a mechatronics background please rescue me with some simple blocks of code I can understand!!
Wishful thinking/dreaming!

Cheers

Steve
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 651
Posted: 01:37am 18 Jun 2023
Copy link to clipboard 
Print this post

G'Day Steve et al

It's just not my day. I just explained how to solve your problem and it disappeared.
Also, I assumed you wanted to do some sort of dynamic depth contol. I always over complicate things.

Since proportional control is out, you can only control to the minimum distance that a single ram moves when pulsed on for the minimum time.
So, with 3 valves off, hit the single valve with the shortest on pulse and measur how far it moves.
Then set your code to accept an error of that minimum distance plus a bit.

It will probably be too sloppy or too tight so further adjustments will be required.

Good luck

Peter
 
Quazee137

Guru

Joined: 07/08/2016
Location: United States
Posts: 571
Posted: 04:55am 18 Jun 2023
Copy link to clipboard 
Print this post

If each ram has its own valve what about adding a pressure sensors between
  each valve and ram. Then you'll have more information for PID.

 As a kid on now days would tiny farm there was four of us kids doing the seeding.
 Walking behind Dad and the lucky kid on the international harvester tractor.
 1960's Utah.

 
 I do miss being on a farm. Life seemed fuller and feeling the days work was good.
 

 Quazee137
Edited 2023-06-18 14:57 by Quazee137
 
SteveIzett
Newbie

Joined: 04/05/2023
Location: Australia
Posts: 24
Posted: 11:16pm 18 Jun 2023
Copy link to clipboard 
Print this post

Fortunately, I dont need to do any real depth control.
The rig is setup so that when the rams are bottomed out it's set for the correct seeding depth.

I'm 'simply' being asked to get the four sections from bottomed out 'seeding depth' to just clearing the ground, and to full ram extension.

The tricky bit is he needs it to be balanced positionally otherwise he says it doesn't pull well and as I understand it, rocks.

When I took on the challenge I didn't realise he needed them all in sync. That changes everything in my mind.

Does anyone have some example blocks of code for PID.
I can get my head around a simple PID for positioning such as a servo - position feedback information with proportional output control.
But syncing 4 PID's, what does that look like? And I'm not sure these values can do 'proportional' even if I could write the code to provide PWM - proportional drive.

Thoughts?

Steve
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2137
Posted: 01:28am 19 Jun 2023
Copy link to clipboard 
Print this post

How fast do the rams move?
1)  If it is fast enough start raising them all at the same time and stop each one as it reaches the desired height. As each one stops the rest will speed up so they won't be uneven for very long.

I guess that has already been tried and isn't good enough so:-

2)  If the rams are slow set a smaller target height, say up 10 mm, stopping each as it gets there. When all have reached that height leave the last ram solenoid on and set a new target, up another 10 mm. Repeat till the final target is reached.

For raising from that height to full extension just turn all solenoids on. As they are clear of the ground at that point they no longer need to be synchronized.


Edit
This may be one way to do it - untested.

'Seeder Height Control
'Raising from bottom to clearance height.

For n= bottom.height to clearance.height step interval.height
 If pin(pot1) < n then  'read pot height, compare with interval target
   Solenoid1 = 1  'switch solenoid on
  Else
   Solenoid1 = 0  'switch solenoid off
 EndIf
 If pin(pot2) < n then
   Solenoid2 = 1
  Else
   Solenoid2 = 0
 EndIf
 If pin(pot3) < n then
   Solenoid3 = 1
  Else
   Solenoid3 = 0
 EndIf
 If pin(pot4) < n then
   Solenoid4= 1
  Else
   Solenoid4 = 0
 EndIf
 Pause 100  'set this to allow time for rams to start moving,
            ' and prevent solenoids switching too fast

  ' wait for all rams to reach interval target
 Do While ((Solenoid1 Or Solenoid2) Or (Solenoid3 Or Solenoid4))
 Loop  ' not sure if all brackets above are needed
Next

Edited 2023-06-19 12:30 by phil99
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 651
Posted: 06:30am 19 Jun 2023
Copy link to clipboard 
Print this post

G'Day again

Since it is not possible to modulate the hydraulics I think PID is out of the question.
I also think that Phil is correct.
Start by defining the maximum error permissable between fastest and slowest.
Draw up a flow chart to define each step.

START

Is RAM A at target? YES/NO
IF YES turn off, IF NO turn on
Repeat for RAMs B,C,D

Determine which 2 rams have the greatest difference
Is this greater than permissable error? YES/NO
IF YES turn off fastest and PAUSE for ?
GOTO START

Peter
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6798
Posted: 07:14am 19 Jun 2023
Copy link to clipboard 
Print this post

The hydraulics won't do proportional, but integral & differential are still possible. May not be all that easy to tune on a system like this though.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 651
Posted: 07:41am 19 Jun 2023
Copy link to clipboard 
Print this post

Mick

I agree. It should be possible to control the system by using a tolerance that allows a range of values greater than the smallest distance a ram can move.
I avoided control systems for 30 years but was forced into them late in life. The first discovery was throw out all the Greek alphabet stuff and rely on experience.
That is not to claim I am an expert, far from it.

Peter
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2137
Posted: 01:31pm 19 Jun 2023
Copy link to clipboard 
Print this post

My previous code attempt is wrong, this may be better.

'Seeder Height Control
'Raising from bottom to clearance height.

For n= bottom.height to clearance.height step interval.height '10mm steps perhaps?

 Solenoid1 = 1  'switch solenoids on
 Solenoid2 = 1
 Solenoid3 = 1
 Solenoid4 = 1

 Pause 100  'adjust this to allow time for rams to start moving,
            ' and prevent solenoids switching too frequently

 Do While (Solenoid1 Or Solenoid2 Or Solenoid3 Or Solenoid4)

  If pin(pot1) > n then Solenoid1 = 0  'switch solenoids off at interval target
  If pin(pot2) > n then Solenoid2 = 0
  If pin(pot3) > n then Solenoid3 = 0
  If pin(pot4) > n then Solenoid4 = 0

 Loop  ' repeat until all rams to reach interval target

Next

Edited 2023-06-19 23:34 by phil99
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4247
Posted: 02:08pm 19 Jun 2023
Copy link to clipboard 
Print this post

Hi Phil,

To avoid fast oscillation you may need to add a "pause x" in the loop.
The "n" value may be different for each ram.

Regards,

Volhout
PicomiteVGA PETSCII ROBOTS
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2137
Posted: 10:58pm 19 Jun 2023
Copy link to clipboard 
Print this post

In the code above I failed to make clear 'increment' refers to height increments, not time intervals.

Having the same value of 'n' for all rams is what provides the synchronization. Each solenoid is switched off as it's ram reaches the height increment (as measured by it's linear pot). When all rams have reached the same height increment the cycle repeats till the final target is reached.
As it waits till all rams are synchronized at each step oscillation seems unlikely.

If the four linear pots that sense ram height differ in value by too much, or can't be  adjusted for the same output at the clearance height, then correction factors may need to be applied to the analogue inputs. Eg if a ram is consistently 5mm high then a corresponding amount should be added to its pot reading to bring it in line with the rest.
Edited 2023-06-20 09:00 by phil99
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 651
Posted: 12:25am 20 Jun 2023
Copy link to clipboard 
Print this post

Phil et al

All that stopping and starting seems a bit unnecessary. Why not let them go until an error occurs and then stop the offending ram for time t.

Peter
 
SteveIzett
Newbie

Joined: 04/05/2023
Location: Australia
Posts: 24
Posted: 09:13am 24 Jun 2023
Copy link to clipboard 
Print this post

Hi Guys.

I've been busy at work so just catching up. Thanks for your ideas. I'll have a good read.
The system is only reading the ram height/postion at present.

Im going to write my first code for actuating the valves this week and trial it next Saturday. The farm is 2.5 hours away and I'm busy at work so this is going to be frustrating.

Thanks heaps. I'll get back with my results. Hopefully all the hardware will function and I can focus on the soft stuff.

Cheers

Steve
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2137
Posted: 12:33pm 24 Jun 2023
Copy link to clipboard 
Print this post

To facilitate writing and testing your code at home perhaps first write a seeder simulator on another MM.
It would need 8 DINs for the 4 up and 4 down solenoids, plus 4 PWM outs with RC filters to simulate the linear pots.
When an UP signal is present the associated PWM % slowly rises, holds steady with no signal and slowly falls while a DOWN signal is present.

To test synchronization make the PWM signals change at slightly different rates. It could be done by putting a short, adjustable pause after each PWM increment.
 
mozzie
Regular Member

Joined: 15/06/2020
Location: Australia
Posts: 68
Posted: 06:21am 01 Jul 2023
Copy link to clipboard 
Print this post

G'day Steve,
I hope the initial testing is going well.

If you can provide a bit more info on the system I may be able to help, but if I'm honest, this is normally the sort of thing we fit a motor (geared) flow divider into to solve problems. Considering they are quite cheap and readily available, is there a reason to not replace the existing divider? Most hydraulic wholesalers are able to assemble them from stock parts. I would advise to stay clear of aluminium case units, they are prone to failure, cast iron is the only option for longevity.

The usual setup for this kind of thing is to fit a counterbalance valve to each ram to stop it drifting (motor dividers leak internally), fit a relief valve in each section so as that section bottoms / tops out it bypasses to correct any variation. A solenoid valve fitted cross-line also allows a section to be shut off without affecting the others. (this assumes a single feed from tractor for up / down)

As for PWM drive of solenoid valves, this will depend on the type of valve chosen, some direct acting spool valves will work fine with PWM as long as the frequency and dither are set correctly, although they can be very non-linear. Pilot operated valves are normally non-proportional unless designed that way. We normally use current feedback to control solenoids as the coil current changes as the temperature varies, with some valves this causes large variations in controlled flow with PWM only.

The type of solenoid valve will play a big part in the system but also the configuration of the valve block / manifold is equally important, open / closed centre and series / parallel / tandem will change the interaction between valves, this can make it a headache to automate.

Just to clarify, I'm no hydraulics engineer but designing and repairing mobile control systems for 30 years has shown a need to understand the whole system to be successful (electrical / pneumatic / hydraulic / mechanical).

Regards, Lyle.
 
     Page 1 of 2    
Print this page
© JAQ Software 2024