I want to use pixhawk with the apm rover firmware to operate an agricultural tractor. I need to set up my tractor as an rc vehicle. My plan is as follows: any feedback I can get is appreciated. I plan to order the parts in the next couple days but if there is something I've overlooked or my plan has no chance of success let me know.
Throttle control: Linear servo (https://www.servocity.com/html/25_lbs__thrust_linear_actuator.html#...) I don't see too many problems here.
GPS: I plan to use the gps already installed in the tractor. I am planning on buying a pololu 23201a to convert the serial nmea to something I can input to the pixhawk.
Steering: This is what I'm most worried about. The tractor has an electric over hydraulic steering valve, so basically provide 12v to right side tractor turns right, provide 12v to left side tractor turns left. I am planning to put in a dual 12v relay controlled by pwm signals for the steering https://www.servocity.com/html/electronic_pwm_controlled_dual.html#... Anybody have a gut feel on whether this will work or not? The problem is the steering output from pixhawk needs to reach a certain threshold before steering valve will operate this is quite a bit differnt than how it is set up on my rc car where each pwm value corresponds to a specific steering angle.
Clutch: Much testing has to be done with a person in the cab to operate the clutch and some sort of ignition failsafe installed before I get the tractor to be totally autonomous but I would like to start thinking about the clutch, and start testing some setups with a person in the cab. I could get a linear actuator that releases the clutch when throttle pwm reaches some predefined threshold? But I would really like a system that if the power is cut or signal is lost clutch is automatically depressed which will stop the vehicle. I could set the clutch up to be always depressed and use a linear actuator to engage it. Connect the actuator to the clutch with an electric solenoid so if power is lost actuator releases and clutch disengages. Anyone else have some good ideas?
So I have spent the last week continuing my work on the tractor. I was hoping that I could control the tractor through the CANBUS but I now believe this to be very difficult. The main reason is that most of the data on the CANBUS is sent periodically so just sending the code to put the tractor in gear does nothing. You can do some things using ISOBUS but even those have certain restrictions built in. I thought each switch on my tractor would have its own canbus id so if i cut the power to that switch I would be able to send false data onto the bus to spoof it but it looks like many swithches run some simple binary wires into an ecm which is one node on the bus so taking over one operation at a time is harder and more complicated than I thought. It is quite simple to read the engine rpm, oil pressure, coolant temp, and fuel level using an arduino and canbus Shield. I just need to send the information to pixhawk and then transmit that over mavlink to my app and I will be able to monitor the tractors health.
I really want rid of the actuators in the cab so I took apart my steering column to get access to the switch that puts the tractor in and out of gear. It has 8 wires on it that are either a 1(5volts) or 0(ground) depending on the location of the switch. I only needed to change 4 of those wires to put it from neutral to forward, so I ran those wires through an ardiuno which passes the signal through unless the pixhawk is trying to put the tractor in gear in which case the tractor goes into gear without moving the lever. So basically the tractor will look and act totally stock except under the right set of conditions the pixhawk will have control. Still working out exactly what the right set of conditions will be but this looks like a promising avenue. I will do something similar with the other tractor controls. This should greatly increase the reliability of the whole system as there will be less moving parts.
That is fantastic Matthew. Very well done indeed to get all the code up on github!
Just to say thank you for continuing to share. I'm in Texas trying to steer my 50 hp JD with a home brew steering control solution since my model only has basic power steering and will be using the JRK21V3 and Arduino with the Pixhawk. I've done the RC car thing so for me now the next phase is "upscaling" the solution. I also saw you shared your Python code. Although that is down the path for me I wanted to say your are helping inspire people. The attached photo is only to get some dimensions worked out.
That's awesome keep us posted as you progress!
I will still post videos and progress updates here as they happen but the nitty gritty details will be on git hub from now on. I am going to post code here https://github.com/mattdreimer/AutonomousGrainCart and I have also started a wiki here https://github.com/mattdreimer/AutonomousGrainCart/wiki This will allow for a little bit more organization. I'm also going to be offering to set up and install this in other peoples equipment, feel free to contact me if you are interested. Ultimately I want to make farms more productive and food cheaper to help feed the world so the project will remain entirely open. Please feel free to get involved and contribute, there is lots of work to do
Thank's Matthew to share your progress, directly to favorite page. :D
Did you see this challenge? looks interesting to follow http://diydrones.com/profiles/blogs/agbot-challenge
I'm testing a M8N gps on my copter, It's looks interesting for Ag task, very accurate; if we can use a cheap RTK gps and your system perhaps it's possible to draw a mission and seed, fertilizer, etc. with autosteer and 2 cents, that's looks great. I'm thinking in first step the little grass cutter tractor perhaps and a precision fertilizer spreader but many to learn yet.
Looks great Matthew. Very noble goals. I'm subscribed and following your github repository and will help where I can which will most likely be on the Rover code itself.
Matthew, great job! I subscribed to DIY Drones because of this thread. I found this site looking to do an auto steer for corn and soybean combining with an all DIY approach. The autonomous cart is just over the top! I was aware of Kinze's efforts but not the anticipated price tag. I'd rather put the money towards a cart with tracks to reduce compaction. I will eventually get signed up for github and work through the code and will likely have a bunch of questions so hope I'm not too much of a bother. Our tractor is Case Magnum MX305 with Pro600 monitor. RTK subscription in the spring for planting. Get by with WAAS in the fall for tillage. Combine is 2188, also with Pro600 but no auto steer. WAAS only for yield mapping. Anyways, you have broken a lot of ground here. I've read most of the thread so I apologize if I missed this but I would like to contribute right off the bat. Hopefully it's useful but it relates to your oil pres./cooling issue you had during harvest. I found a couple solutions that could come into the Arduino through a digital line that would monitor oil pres. and coolant temp. They are essentially Murphy switches (I believe the name was derived from Murphy's Law?) Back in the day IH combines had these analog gauges in them for both coolant temp and oil pressure. They had a movable "blade" that would act as a closed switch if the needle went out of range. Pretty simple. I haven't priced new but a lot of IH and Massey combines in the late 70's early 80's had them and you could probably pick one up from a wrecker pretty cheap. Pics at end of thread.
The other option for temperature would be one of these, a little fancier and about $43
I haven't seen a digital equivalent for oil pres. yet but there might be something out there.
Should be able to monitor the gauge style (switch closing) or digital style (voltage output) pretty easily with the Arduino.
Edit: Also, depending on the tractor, dash, etc. it might be possible to put an optical sensor over the warning light on the dash of the cart tractor. Would have to see if the uhmmm, idiot light could be picked up by a photo cell on the Arduino.
Congratulations once again on your awesome achievement. The community looks very useful also! Great job everyone!
Thanks for the feedback James. Does Mx305 have all electronic controls? If so you can control the tractor by putting an arduino in between the switch and the ecm the wires run to. You need to find out what signals the switch sends then pass the signals through the arduino for normal operation and send your own signals for remote control. I'm documenting this on the github wiki for my tractor. The concept will be the same for yours. If you get it up and running add a case folder on github then the model number of the tractor so the arduino code needed gets documented.
I love murphy switches. I was surprised to find out my tractor JD7930 does not have them built into the software. I think it's because if the tractor shut off randomly much damage might be done to the transmission. Modern tractors have some conveniences but there is something to be said for simplicity.
I have the broad strokes of a plan in place to monitor the tractors health remotely in the combine. It will be a while before I can complete it but once it is done it should be relatively plug and play and work for all models with a canbus (this would include yours). Basically an arduino and canbus shield will get plugged into the data port (it might be possible to skip this and wire straight to pixhawk canbus port) then transmit that data over mavlink to the graincart app running in the combine and voilla the combine driver can monitor the health of the tractor. The codes for engine rpm, oil pressure,,, ect are all standardized (J1939) so that is why it will work with all models.
Thanks Grant. I am currently trying to finish up getting rid of the actuators in my cab. I have one down and one to go. Then I have a few more things to do before I start developing the telematics for monitoring the engine health. Once I really get going on that I will need some guidance on adding some features to the rover code so I can pass the information from the tractor over Mavlink. I'll let you know when I get there.
Awesome job Matthew! I just read the entire discussion from start to finish. I found your project via youtube videos. A quick google search and and ended up here. I have now joined so that I can continue to follow your project.
Two things ( although there are many more) that I think are brilliant with your approach:
1. You started with an open source aviation based software/hardware platform ( PIXHAWK ) and adapted it to agriculture.
2. You used mechanical actuators to replace the the mechanical motions that a human operator would have done. Actuators are simple an effective.
I farm as well, and could definitely see this project used and implemented in our part of the country.
Matthew has done some fantastic work with his project. He actually started with the Rover code http://rover.ardupilot.com/ which is part of the Ardupilot project, that includes Copters and Planes as well as ground based Rovers