I’ve spent some time trying to get the existing on-off pulse style steering valves on our tractor working with AgOpenGPS. Currently these valves are not suitable for use with the software because AOG uses a PWM output to drive steering motors and proportional hydraulic valves. The pulse style valves will somewhat work with high PWM signals, but once the signal becomes smaller, the valve will not open at all. This causes the tractor to oscillate across the line as the valve only opens when the error is large and the PWM signal becomes larger.
In order to get the valves working, I changed how the Arduino outputs the drive signal to the valves. When the PWM signal becomes small enough that the valve will not open anymore, the Arduino instead sends out very short pulses of max PWM drive at a certain interval. By adjusting the delay between pulses, the valves can be make the very small corrections needed to follow a straight line. I also use a steering angle error threshold that uses the pulses to control the valves when the steering error is very small and only small corrections are needed. When the error is large and above the threshold, the original PWM drive system is used in order to steer fast enough to make a u-turn or get onto the line quickly.
By making these changes I’ve been able to get AOG to drive a very straight line which outperforms our Trimble autosteer unit and is still able to make the u-turns or follow a curve.
In the modified AOG software I have added a new tab to the autosteer settings window. This tab contains sliders for the pulse on-time, high and low error pulse delays, and the error threshold.
The pulse on-time is the amount of time that the valve is open during each pulse which determines how far each pulse will steer the wheels. This setting should be set as low as possible so it is open just long enough to make the wheels turn by a very small amount. This allows the steering to make the small corrections required for following the line.
The high and low error pulse delays set the amount of time that the valve is off between each pulse. The high error delay determines the delay when the error is close to the set threshold and the low error delay determines the delay when the error is close to zero. The high error delay will be shorter than the low error delay because when the error is high, you want the pulses to be more rapid in order to steer to the line faster. However, when the error is small, you want the pulses to be less rapid so that it steers more slowly and does not overshoot the line. The length of the delay will vary between the high error delay and low error delay depending on the steering angle error.
The error threshold slider allows you to adjust at what point the system will stop steering with the PWM system and start using the pulse drive system. When the steering angle error is above the set error threshold, AOG will operate exactly as it would without any modifications and steer using a PWM output. When the steering angle error is less than the set error threshold, AOG will steer using pulses based on the above settings. Setting the error threshold to zero will disable the pulse drive system and AOG will operate just like it would with no modifications.
The settings in the screenshot are the values that we are using. However, they will vary widely between machines due to the type of valve, hydraulic pressure, etc. The best way I’ve found to get it all set up is to first set the error threshold to its maximum so that the tractor will only be steering with the pulse system. Then, adjust the pulse on-time so that it is set as low as possible while still making the wheels turn slightly. Once the pulse on-time is set as low as possible, get the machine very close to the line and adjust the high and low error delays so that the actual steering angle matches the desired angle in the steer chart as best as possible. After it is set up to drive a straight line, reduce the error threshold so that it is low enough to make the u-turns well but not so low that the steering angle error exceeds the threshold while driving a straight line.
It takes some fine tuning and fiddling but I was able to get our tractor steering very straight and the steering angle error is usually below 0.5 degrees and is rarely larger than 1 degree.
I’ve posted the modified AOG program and support files containing the modified Arduino code here: https://github.com/canadaboy25/AgOpenGPS/tree/AgOpenGPSwithPulseControl
Right now it only works with a usb connection to the Arduino as I do not have a system using a UDP connection that I could try it on.