AgOpenGPS - adding rate control - Page 3 - The Combine Forum
 102Likes
Reply
 
LinkBack Thread Tools
post #21 of 211 (permalink) Old 11-02-2017, 11:12 AM
Senior Member
 
Join Date: Mar 2017
Location: Clatskanie, Oregon
Posts: 131
Mentioned: 0 Post(s)
Quoted: 47 Post(s)
CQuick, I haven't heard of the style you mentioned either! Our sprayers use the old 3way style that Torriem mentioned. Not much different than a regulating ball valve when it comes down to it.

Wedge is offline  
Sponsored Links
Advertisement
 
post #22 of 211 (permalink) Old 11-02-2017, 11:29 AM
Senior Member
 
Join Date: Aug 2012
Location: Vermilion Alberta Canada
Posts: 5,518
Mentioned: 6 Post(s)
Quoted: 2414 Post(s)
Quote:
Originally Posted by Wedge View Post
One for rate and one for the autosteer(and everything else that it is currently doing)!

Then it just becomes necessary to grab speeed and width information, either from the autosteer arduino or directly from AOG. If I move pins around I should be able to find enough space to run a comm line between arduinos.
Yes, i 100% agree. Sorry bout that!

I've started on the AgOpenGPS rate class and settings window

torriem and Wedge like this.
BrianTee is offline  
post #23 of 211 (permalink) Old 11-02-2017, 01:58 PM
Senior Member
 
Join Date: Aug 2012
Location: Vermilion Alberta Canada
Posts: 5,518
Mentioned: 6 Post(s)
Quoted: 2414 Post(s)
So i think by making my life hard, and yours a lot easier, i can save a lot of data to be sent and get potentially lost/confused.

Do you want AgOpenGPS to do all the calcs based on section width, speed, how many sections are on and the desired set rate, and just send flow rate required, and the section control byte that say which sections are on 5 times a second?

Then all you have to do is turn on off the sections with the section control byte, and PID the flow.
BrianTee is offline  
Sponsored Links
Advertisement
 
post #24 of 211 (permalink) Old 11-02-2017, 02:13 PM Thread Starter
Senior Member
 
Join Date: Sep 2009
Location: S. AB
Posts: 3,412
Mentioned: 5 Post(s)
Quoted: 840 Post(s)
Would AgOpenGPS handle calibration then, and then only give the rate controller arduino a desired ppm set point for flow? I think on my sprayer the calibration routine (I don't think I've ever done it since our existing calibration seems close) is something like hold the pressure at 40 psi with one segment on, and then measure the volume at a nozzle with a pitcher, and put that number into the computer, which calculates a conversion constant.

Also the arduino rate controller may want to send numbers back to AgOpenGPS, such as the current flow ppm, total pulse count (total gallonage), etc, for display. Also for calibration, the arduino is likely going to need to read pressure from a transducer.

As I see it, the rate controller will need to be changed into different modes (calibration, run, etc) on command from AOG.

Thinking on it, I believe favor the arduino doing more of the work instead of AOG. This work would include calibration of actual rate to ppm, holding a desired actual rate set point, etc. For example, instead of AOG calculating the desired ppm, maybe AOG should just send the actual desired rate to the arduino and let it figure it the ppm and so forth. This is pretty much how the ISOBUS architecture works, for example. Coverage mapping and variable rate control (which run in the monitor) are separate from the actual implement rate controller (which stays on the implement). In my opinion this separation keeps more modular and makes it easier to adapt AOG to run with other forms of rate control, including a drill.

I'm sure there are lots of ways of architecting it. Just rambling on a cold winter day.

Last edited by torriem; 11-02-2017 at 02:27 PM.
torriem is online now  
post #25 of 211 (permalink) Old 11-02-2017, 08:46 PM
Senior Member
 
Join Date: Mar 2017
Location: Clatskanie, Oregon
Posts: 131
Mentioned: 0 Post(s)
Quoted: 47 Post(s)
I think AOG should let the user set the desired rate, and display the actual rate(and maybe pressure?). Let the slave arduino take speeed and relay(And desired rate), compute the flow with flowmeter input, and get the pressure. This makes the whole setup more modular, as Torriem mentioned.

Right now, I have the autosteer arduino set as a master, and it passes the speeed and relay variables to the slave arduino through I2C. Slave reads flowmeter using Torriem's class(hope that is alright, if not let me know), (got to add in pressure), currently has a hard-coded target rate to compare against, does some magic formulating and sends back to the master the liters per hectare that is currently be applied. Slave also adjusts the valve using a proportional delay with the millis() function.

I think we need to decide on what format AOG sends the data in(I am currently assuming it will be appended onto the current string of data that the autosteer code gets) and what format it will take it back(same way?). Does that even make sense? haha

It rained all day so I put some work in to clean up and do some changes. Found out my other usb cable is bad so can't test at this time *facepalm*.

Hopefully this works, untested code:
https://github.com/warrenseely/Liqui...Control/tree/1
Wedge is offline  
post #26 of 211 (permalink) Old 11-02-2017, 09:39 PM
Senior Member
 
Join Date: Aug 2012
Location: Vermilion Alberta Canada
Posts: 5,518
Mentioned: 6 Post(s)
Quoted: 2414 Post(s)
The only problem with that setup is, you then need an autosteer module to do rate control.
BrianTee is offline  
post #27 of 211 (permalink) Old 11-02-2017, 10:07 PM
Senior Member
 
Join Date: Mar 2017
Location: Clatskanie, Oregon
Posts: 131
Mentioned: 0 Post(s)
Quoted: 47 Post(s)
Quote:
Originally Posted by BrianTee View Post
The only problem with that setup is, you then need an autosteer module to do rate control.

Well if that is the only problem I must be doing ok haha

I am not quite following what you are saying though......

I intended to pass the data to/from AOG through the autosteer arduino to a slave arduino via I2C. Then all AOG would need to do would be to display the rate and maybe let the user enter a target rate. The autosteer arduino would only pass a couple variables from AOG to the slave, and from the slave back to AOG. Also only one USB hookup to tablet required.

I put all the files I am working with in the git link, including an older(last month) version of the AOG arduino code with a couple statements to send/receive the data to/from the slave arduino.

Last edited by Wedge; 11-02-2017 at 10:10 PM. Reason: clarification
Wedge is offline  
post #28 of 211 (permalink) Old 11-02-2017, 11:15 PM
Senior Member
 
Join Date: Aug 2012
Location: Vermilion Alberta Canada
Posts: 5,518
Mentioned: 6 Post(s)
Quoted: 2414 Post(s)
We'll figure out the communication part, no prob. Once a stable version of the flow control works, its very easy to slip it into any code jacket. But, as this program grows every stream needs to be identified with header, and ideally should be a footer too. USB will certainly be replaced by ethernet, so even more important then.

AgOpenGPS outputs on the relayRate port the following: 2 id header bytes equal to 32760, then the relay on off byte, then the speed in km/h * 4 byte, then the hi and low byte of the setRate * 10.

Decoded like so:
Code:
   //Data Header has been found, so the next 4 bytes are the data
    if (Serial.available()> 3 && isDataFound)
    {  
      isDataFound = false;    
      relay = Serial.read();   // read relay control from AgOpenGPS     
      groundSpeed = Serial.read()>>2;  //actual speed times 4, single byte
  
      // sent as 10 times value in liters per minute, LPM * 0.264172 to get US GPM
      rateSetPoint = ((float)(Serial.read() << 8 | Serial.read()))* 0.1;   //high,low bytes

      //reset watchdog as we just heard from AgOpenGPS
      watchdogTimer = 0;
    }
I've uploaded all the new autosteer and rate Arduino codes, along with the AgOpenGPS solution. It will be important for the code to be able to differentiate between data and settings. Everything runs at 38,400 baud now too

Its tough to integrate into an existing interface, but a first shot at it anyways.

Code is on the nightly build. Bit more triple checking and it will be promoted to a new version and on the real AgOpenGPS git
https://github.com/farmerbriantee/AgOpenGPS_Dev/

torriem likes this.

Last edited by BrianTee; 11-02-2017 at 11:17 PM.
BrianTee is offline  
post #29 of 211 (permalink) Old 11-03-2017, 12:33 AM
Senior Member
 
Join Date: Mar 2017
Location: Clatskanie, Oregon
Posts: 131
Mentioned: 0 Post(s)
Quoted: 47 Post(s)
NOW I am getting to be on the same page as you are Brian. Excellent video.

My problem was that I was viewing it through the lense of using the autosteer AND the rate control concurrently since that is my end goal. However, as you pointed out that is not necessarily what will actually suit other users. Apologies! I am getting there, slowly..... Now what you were saying makes MUCH more sense in terms of integration.


So then suppose we want to run both autosteer AND rate control concurrently. What are your thoughts on the hookup to AOG? Two USBs?
Wedge is offline  
post #30 of 211 (permalink) Old 11-03-2017, 12:39 AM
Senior Member
 
Join Date: Mar 2017
Location: Clatskanie, Oregon
Posts: 131
Mentioned: 0 Post(s)
Quoted: 47 Post(s)
On another note, most of the emphasis here on rate control has been through the use of a flowmeter. Turns out that pressure sensor-based flow control is just about as accurate (probably moreso considering nozzle flow rates are subject to pressure). Any preferences? Just food for thought.

Beerwiser likes this.

Last edited by Wedge; 11-03-2017 at 12:43 AM.
Wedge is offline  
Sponsored Links
Advertisement
 
Reply

Quick Reply
Message:
Options

Register Now



In order to be able to post messages on the The Combine Forum forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.

User Name:
Password
Please enter a password for your user account. Note that passwords are case-sensitive.

Password:


Confirm Password:
Email Address
Please enter a valid email address for yourself.

Email Address:
OR

Log-in










Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page



Posting Rules  
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

 
For the best viewing experience please update your browser to Google Chrome