How Counts Per Degree work

The A/D converter puts out -4000 to +4000 (8000 in total) levels as the Wheel Angle Sensor puts out 0 to 5v. To convert that into steer angle degrees - because we don’t visualize counts very well, we now divide those levels by counts per degree. if CPD is 100, then the resulting counts becomes -40 to + 40. 4000/100 = 40. Using 200 the new “range” is + - 20. Or 4000/20. They are still counts but it is easier to visualize as degrees of angle of the actual front wheels.

So when the CPD is increased, the wheels turn farther for each degree needed. When lowered, the wheels don’t turn as far.

Now when doing settings, if the thing is oversteering, the cpd is too high because the wheels turn too far for each degree required. If it isn’t getting to the line, cpd is too low.

Degrees required are sent to the arduino, but the CPD tells the arduino how far to turn them (counts) to get to those degrees. So to tweak oversteer and understeer to get to the line, adjustment of the counts per degree is fairly critical.

Wheelbase affects the final turn calculation as well, if the wheelbase is too long, it will turn too slow, and vice versa. Now, this may be an advantage on uturn - it may get to the line nicely, but not follow uturn so you can tweak the wheelbase to perform well following the line and follow uturns. Some tractors slip more when turning, so none of these settings are 100% based on a tape measure.

8 Likes

Hello,

How did you obtain the value of -4000 to +4000 ? ADS1115 is a 16bits ADC, with data in binary two’s complement format, so count is between +32767 and -32768 ?

I also surprised with the need of tweaking CPD:

For me, I always interpreted CPD like this: CPD shall be adjusted so that the wheel angle measured by AOG correspond to the real wheel angle.
So If my tractor has a wheel angle of +/-40°, when I turn full left or right the wheel angle, I adjust CPD so that angle measured by AOG is +/-40°. And then never adjust them, it’s fixed.
If we “tweak” the CPD, the angle measured by AOG will not correspond to the real tractor wheel angle.

And for me, I was also thinking that the WAS mounting shall maximize the range of use of the sensor, so that the CPD is maximized. With a CPD maximazed, we can detect a smallest wheel angle variation, so that having a more accurate steering.
CPD of 100: 1 count correspond to 0,01°.
CPD of 200: 1 count correspond to 0,005°.

Math

1 Like

That is how I always did it in previous versions, but apparently having the angles match, rarely gives best performance? Although mine seemed to work just great like that, but seems most find they have to adjust to from there for best performance… Kind of a pain as then your wheel angle isnt “true” which would seem to be wrong really…

It seems like my setups always require the CPD to be lower than the actual steer angle. if I leave it correct, it overshoots the line back and forth. I wondered if it is the amount of correction the code calls for is too much. I thought I could move PP out farther to call for less correction, but it still didn’t drive as well as with CPD backed down a little.
No matter, v5 is unbelievably accurate through the field, so I can live with it.

1 Like

I always have to go down CPD. I tried the new v5 tool (turn cercle to know steering angle) but I still have oversteering, need lower CPD to be good.

I have often thought the steer angle calculated is too high, but some have it too high, some right on, some too low even. No idea why this is, but once again want to say the settings can be calculated and set but will often not be “perfect” as there are many other dynamics affecting the real world vehicle.

This can be demonstrated in the sim - mathematically perfect, does everything it is supposed to do exactly as it should.

I get the feeling there is some real non linearity in steering action with the actual angle of the steer wheels and the distance the WAS has actually moved. Also throw in Ackermann error. Also throw in Caster,Camber, and toe in. Everything contributes to that final error of the resultant actual steer angle and the measured angle from the WAS.

Has anyone tried using the steer angle tool in steer forms and measured steer angle at 5 degrees, 10 20 30 etc to see if the result is linear? If you do one say at 45 degrees, set the cpd so it is correct, now try it at low to high angles to see if the result of the tool matches the angle.

1 Like

No doubt. On top of that, throw in 60 in width that is really 60-3/4, and 110in wheel base that is really 109, and antenna height that’s off a little too, along with 1/2 degree roll, and accurate left a long time ago. I like fiddling with it until it drives right. The numbers dont have to match perfect

2 Likes

it will only read ± 32k counts if doing a full swing from positive to negative. Since we only use 0 to +5 half the bits are already gone. The ads will burn up if voltage in is > then supply voltage so the input is attenuated as well so now down again.

There is no point measuring 0.000001 degrees as it is all noise so the reading is divided down for a nice stable reading. so now we are 8k from 0 to 5v.

Blockquote
For me, I always interpreted CPD like this: CPD shall be adjusted so that the wheel angle measured by AOG correspond to the real wheel angle.

Well, that is exactly what “counts” per degree is. Converting the counts - into degrees of steer angle. So now all you have to do is accept none of this is perfect and tweak that steer angle a bit. You will never know if your wheels are pointing at 32 degrees and aog says they are at 29 or 35 - as long as it steers well.

In terms of what you are trying to set, a 0.1 heading error after 1 km is 1.74m off track. So as you can see, trying to measure steer angle to a very high accuracy - AND - putting wobbly, ground affected, slope affect, draft affected… steer angle to that setting becomes quite pointless at 10 times per second to go anywhere beyond even 0.1 degrees accuracy.

1 Like

Yes I did many cercles, set CPD and ackerman at 40 degrés perfecly, make another cercle at 20 degrés, one degrés wrong… After a lot’s of cercles I used the average. I think my sensor linkage is not perfect.

Wouldn’t it be an option to have a cpd and another gain. So we can have the right angle displayed, but optimize the algorithm input a little bit.
I know, it is one more parameter, but it also have some advantages.

but here is the thing, when is the steer angle “right” ? Sitting in the garage? going 5 kmh? 20 kmh? on the road? In dirt? in soft dirt? pulling a hard load?

All will be different. Especially when there is nothing behind the tractor vs rated load.

2 Likes

I still cant fully get my head around why the CPD is a setting that needs tuning / tweeking, and why it cant be set so that real wheel angle, is the angle calculated in software…surely that should always be the case? If it doesn’t drive right when its correct, and has to be wrong to work better, there must be a way to improve the steering code so it does?

To be fair, Mine was always set to be “correct” and worked great…but then maybe it could be even greater if i had tried changing it!?!

Well that makes sense. Under a heavy load like a chisel plow, it requires a lot greater steering angle to correct, than when there is nothing back there, and a little move of the wheel brings it back.
Well said, wise teacher

4 Likes

But isnt that what integral is for? Keep adding steering until it does find the line…Surely CPD should just be “correct” and steering code should get it on the line no matter what angle is needed?

2 Likes

Integral will continue to add amount until target is reached, but counts per degree is how much the wheel will actually turn with a demand from aog.
Demand is for 3 degrees of correction from AOG, but CPD is set to 65, so actual steer amount may only be 1-1/2 degrees. So never gets what is called for. On the other hand, if CPD is set to 190, it may turn 5 degrees and overshoot the line.
edit
Please correct if wrong

In simplified, the integral is the small amound of correction you add over time to be exactly on the line.

1 Like

Yes, but for example the maximum steer angle is a fixed value which is dependent of the degree the wheels turn. I don’t want to adjust the maximum wheel angle everytime I change the cpd.

And wouldn’t it be possible to calculate the turn radius from maximum steer angle and wheelbase? One setting less :wink:

I think in the algorithm it should then roughly be (steer angle * steer gain)…

I think of the steer angle of a fixed geometric value which I can measure. And I set the cpd, so it is correct.

I don’t have the code in front of me. But I thought lower the cpd is the same like a higher lookahead gain for the steer algorithm.

1 Like

Exactly…so if AOG demands 3 degrees of angle… IF your CPD is set correctly so things match up, it will get 3 degrees… That is my point, why would we ever want this to NOT be the case? As its if you adjust CPD to anything other than what matches, that the steering angle you end up with ISNT what AOG demands…

In theory, with a certain implement, on certain type of ground, etc. I’m convinced that if I would do the, calculate steer angle, on v5, with a bare tractor, on hard ground, then hook on to a pull type drawbar implement, it will drive well. The wheels will be turning the asked amount, correctly. But, the tractor will be lagging in response, due to the load. If we were to calculate steer angle in the field with the plow in the ground, we would get a different number, and It probably wouldn’t drive the same with no implement.
I just don’t think it is possible to have that number exact on every tractor. A single narrow wheel tractor is going to turn differently than a dual wheel tractor, just due to resistance. Without the steering demand in AOG being able to change for all situations, we have to adjust CPD to overcome those forces. I’m rambling

1 Like

Hey
You can discuss it for hours. The point is that the calculated angle of AOG will almost never be the same as the angle of the steering turn in the field. CPD remains for me an excellent means of refining the precision of the tractor. For example on my self-propelled sprayer, the direction is a little “fuzzy”, well playing with the CPD allows it to be always less than 3cm from the line. On my tractors with very precise steering, add or remove 10 or 20% to CPD and you won’t see any difference, until you try a 70 ° line grip.