Straight line with tractor

I'm going to be honest, I'm very green when it comes to arduino and electronics.
I'm wondering if you guys think a heading sensor would work or have a better idea for this project.

The project is to steer a very slow moving tractor in a straight line for up to 500ft. It's hooked up to a grain bagger and we want the bags to automatically stay straight.

If I used a heading sensor that turned with the wheels so if the wheels began to turn left or right it would send a comand to a 12v dc motor that turns the steering wheel until the value is back to center.
I just don't know if they're sensitive enough or would they get interference from moving equipment?

Thanks

You know what a "heading sensor" is, but no one else seems to know. Please provide a link to the technical documents describing what you are writing about.

I suspect equipment has been available for years that can follow a laser beam from one end of a field to another.

PAul

What you suggest is a very common approach. Most people use a magnetometer (electronic compass) as the heading sensor.

It works well if you take suitable precautions with the sensor (and conversely, not at all if you don't). First, carefully calibrate the magnetometer, following this tutorial: Tutorial: How to calibrate a compass (and accelerometer) with Arduino | Underwater Arduino Data Loggers. This is to correct for the inevitable manufacturing defects.

This is best done in the final mounting place, which is unfortunately almost impossible in a large machine. So, after the first stage of calibration, mount the compass in the tractor, on a pole away from magnetic materials, if you can.

Then, you can remove any additional offsets (or bias) by adding a second correction to account for the offsets from nearby iron or magnetic materials.

Drive the tractor is one or more circles and note the magnetometer X and Y outputs as in the previous calibration step. Apply a second correction.

Finally, check your work by driving the tractor in various directions, and comparing the reported heading with that from a good pocket compass. If all that is correct, use a "PID loop" to keep the tractor driving along a line of constant heading.

All in all, a challenging but satisfying project!

Note: GPS works too, but the GPS unit will give you a heading or direction of travel ONLY when you are actually moving.

Spotter78:
If I used a heading sensor that turned with the wheels so if the wheels began to turn left or right it would send a comand to a 12v dc motor that turns the steering wheel until the value is back to center

The sensor must be attached to the tractor body, not the wheels. The steering of the wheels to correct an error must not directly affect the sensor. A vehicle can drift off course, especially on rough ground, even if the steering is not turned.

I wonder would a gyro-accelerometer such as an MPU6050 detect changes in angle without the complications of magnetic interference? It would not give an absolute direction, but if the driver pointed the tractor in the correct direction at the start maybe it would be sufficient to keep it on a straight line? Hopefully other Forum users with experience of gyros will comment.

...R

A general problem with all such heading sensors: once the tractor drove a little bit in a different direction and then is brougt back into the desired direction, its course will be parallel to the initial one. Over time all such errors can compensate or can sum up to any parallel shift. On a road the tractor can jitter over all tracks and finally fall off the road, in the worst case.

Gyroscopes suffer from the same problem and in addition can sum up (integrate) offsets into unlimited angle deviation.

That's why AFAIK professional tractors are; or have been; steered by GPS, with a fixed station for compensation of the artificial GPS jitter, and another GPS module on the tractor.

Ok guys maybe it would be best to go with our original plan which was to use a laser.

Our plan was to make something similar to a grade laser receiver. We were thinking about making the reciever move left or right with the steering. That way you wouldn't need wheel position sensors to know what they were doing.
That way if the tractor was even stationary and the wheel turned right or left it would leave the center sensor and trip the sensors left or right and say turn back until center sensor is tripped again.
Does anyone know what sensors I should look for as this laser rotates probably 500rpm so it has to be fast?
It's a green laser with a wavelength of 522-542nm
Thank you guys

Something like a traffic light only more directional will do and no laser eventually blinding anyone is needed.

Go with red leds and make the detectors using red leds (leds can detect light, colored bulb filters the light) to not respond to other colors.

I'm a little confused by what you mean by traffic lights? Also this needs to travel about 500 feet so will the setup you're suggesting work for that?

The main problem is the focus of the light source. The beam has to be wide enough to cover the sensor while the tractor is moving, and it must be narrow enough for not dissipating too much energy. Laser beams have a very (too) narrow focus, while LEDs have a very wide focus. It also may be required to cover the entire front of the tractor with sensors, so that at least one receives the beam.

Boats are steered down a narrow channel by keeping two onshore marks in a line. In some cases one of the marks is in front of the boat and the other behind - which makes for an interesting time for the helmsman.

...R

One place I worked fabricated a new lightboard for the local horse track IIRC in 1980. Even the sections were big, it was to display race odds clearly 100's of feet away.

It had light bulbs in the bottoms of tall, thin boxes made of dividers in a bigger box.

Directional traffic lights have leds with similar long walls and small aperture each, you only see them well in 1 or 2 lanes.

OTOH with a radio transmitter and radio direction finder you wouldn't have to build cheap collimators.