(Variable) Rate control

It has messed me up on several occasions. Looks like I would not use it. But it seams to work sometimes.

In this case, there is the contour list of rates, the local list of rates, and the section list of rates. The location determines what contour you are in, then it sets the local rates to that contour set of rates. These are used for display and assign them to the section set of rates.

Each list is simple five points. I have to set all five points individually or it keeps changing them when not supposed to. Just annoying.

Actually I was incorrect. When you have a list a and you do something like b = a, that just copies a reference to the list, so both b and a refer to the same list. If you want to copy the list (and this would be a shallow copy but most likely okay for your purposes), you would do:

List<T> newlist = new List<T>(oldlist);

Where T is the type. this makes newlist be a new list with the same elements in it as the old list. If you add or remove from new list, it won’t affect the old list.

2 Likes

Well we are not in ABDraw any more. Rate planner has its own form. It was getting really tight on the ABDraw form. So, I shrunk the screen a bit, you can scroll through the rate contours up and down. You can still draw the rate contours or load the rate contours. I don’t think that the rate points will make it to the release. Just not needed anymore.

Three screen shots taken after cycling through the different rate maps.



4 Likes

So how many products will this be able to control. 5?

Yes, currently 5.

Rearranged some things. And can select which rate color you want mapped. Starting to come together. Need to add a button to add boundary default values. And a button to delete a rate contour.

3 Likes

Here is a test(buggy!) version of the rate app for vr:

It works with this pgn:

PGN230

If AOG sends the pgn the target rate should vary with the rate map. Load the file “t3.rcs” to test. The variable rate setting (1-5) can be changed on the product page.

1 Like

This is getting exciting!

3 Likes

Ok, now I am back full circle to wanting to send the actual values. Let me explain. In the image below, the left values are read directly out of the kml. The right values are the percent of the max value found in the kml. Now what do I set the base rate to? Average, Weighted Average, Or some other number? This is set to the maximum value in the kml for each data set. Let’s assume that is what we use. Now, if I send these values to the rate app as a byte 66 works. But 66% of what. How will the rate app know what the max value is unless it reads the same kml file? Or if we send the max value each time, then we might as well send the actual value each time. Question, how fast do we send the data? Can we send an index 0,1,2,3,or4 in //5 and then a longer value in //6-8? In other words, can we send rate 0, read it, send rate 1, read it,…etc.? I simply do not know. Open for suggestions.

This is the current rate planner screen, It now has the weighed averages listed. Is it possible on this screen to send all the max rates with one click? Then the percentages would work.

1 Like

For settings imported from a kml file show the user the maximum value for each data set. The user can enter the maximum value as the base rate on the rate app. Then just send the percents.

1 Like

Ok, I see. LOOK WHAT WE GOT!!

7 Likes

If you set each product to a virtual nano (simulator) , turn auto sections on and drive across the field the rate should match the vr data sets. Might have to also load defaults for the control settings. The default file hasn’t been updated from a previous version.

2 Likes

Rounding on the bigger numbers is a problem. 30000 is 83.33333% of 36000.
Rounded to 83% 29880 is 83% of 36000.
But it does work.


Well, converted it all to a two byte system. That is much closer. I made a mess of your program and I’m sure you know far better how to fix it. But here is what I added.

 public double Rate(int whichOne)
        {
            double Result = 255;
            if (whichOne ==0) Result = (double)(cRate[1] << 8 | cRate[0]);
            if (whichOne == 1) Result = (double)(cRate[3] << 8 | cRate[2]);
            if (whichOne == 2) Result = (double)(cRate[5] << 8 | cRate[4]);
            if (whichOne == 3) Result = (double)(cRate[7] << 8 | cRate[6]);
            if (whichOne == 4) Result = (double)(cRate[9] << 8 | cRate[8]); 
            return Result;
        }

-------------------------------

 private byte[] cRate = { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }; // 255 means no data
        private int Length = 16;
____________________________

 public double TargetRate(int whichOne)
        {
            double Result = cRateSet;
            if (VRconversion[cVariableRate] < 5)
            {
                double Percent = mf.VRdata.Rate(whichOne);
                if (Percent != 255)
                {
                    Result = (double)Percent / 10000.0 * cRateSet;
                }
            }
            return Result;
        }

You get the idea.

And yes, as you drive the values do change about as fast as you can look from screen to screen.

3 Likes

I updated RC to use 2 bytes for percent. It is more accurate now. Although RC doesn’t work well with numbers like 34000 in the simulator.

1 Like

Yes, I had to modify some of the maximums on my hack.

1 Like

I think I can send the maximums to the Rate Controller. They would only get sent if something changes. My thoughts, send one string with ID and max, then send second with ID and max, etc. Then it could be a click, wait, finish. Just a thought. I now read and write the same kml features. It will save and read the already painted rates in the section file. I’m not loading the rate file by default. You must load it if you want it. You can toggle through the rates and delete the ones you want. Getting close to pushing this out for some testing. I still find a bug and crash from time to time.

You can set the tool too long. Thought this was neat. Useless, but neat.

3 Likes

This is not a hack, this is very cool.

1 Like

Thanks, but you’ve not been under the hood. Hack at best. Lots of code clean up to do.

1 Like

If you send the max values the rate app can store it for each of the 5 streams. If the %'s arrive with no stored max then the base rate will be used as a max value. The base rate will need to be entered anyway in case of missing vr data.

1 Like

Then it is probably not worth it. I’ll skip it for now.

I did add a boundary rate. It takes the boundary[0] which is the outside one and builds a rate from the points. Then, anything in the field that is not in one of the other rate areas, is given the default field rate.

Well if we can do boundary, can’t we do headland, yes we can. And move it in and do it again and again. This is getting interesting, Now if I could just crop all the rates inside to the selected headland???


Well, crop kinda works. It deletes points along the rate line if it is outside of the selected line. But needs to make the selected line its set of points until it crosses again. I’ve got some thinking to do.

Works pretty good on this type of rate map.

5 Likes

Here is one to play with. It has some bugs, but give it a try and see if it works. Needs to run through the rate controller above. Load rate controller first. Must set max values in rate controller. These values are given in the Rate Planner panel.

AgOpenGPS_Rate_Apply.zip

Deleted this link. The new link is below:

14 Likes