Apm Rover in tractor setup.

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#.VVOUCJNyP5U) 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#.VVTFmZNyP5U  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?

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –


    • Hi Matthew,

      That sounds very good - but I still suggest you watch it like a hawk.

      The fact is next to a train locomotive or ship, modern tractors represent about the most mass and horsepower of any movable thing we have.

      Based on the theory of anything that can go wrong will go wrong (a very well tested theory), I'd say safety is seriously important for these things, they can turn lethal and major property destructive at the slightest provocation.

      I have no doubt we will be seeing them on D9 Cat Dozers soon - what can possibly go wrong?

      That said, I am all for it, automation in this arena is a major time and economic breakthrough and it is going to happen, danger or not.

      I have opened a discussion on the developers web site to provide for the possibility of a time out interrupt signal (which will signal that the controller is no longer doing anything productive (crashed!).

      Assuming the developers pick this up it would provide you with a reliable signal indicating the controller was not functioning as expected and you could use it to shut down your equipment.

      The hardware to permit this is pretty much intrinsic to all microprocessors these days and I think that the only reason it hasn't been emphasized is that since we are talking about a flying vehicle (which depends on the controller to fly) knowing that it wasn't working anymore would simply have the same result as not knowing. - (Crash!)

      I think the work you are doing is awesome and it is going to make the big companies heads spin to see how you have leapfrogged them for pennies with hobby grade equipment.

      I am sure they were planning on this in two or three years for 20 or 30 times the money.

      Up the system, damn the torpedoes and full speed ahead.

      Best Regards,


    • 100KM

      "I have no doubt we will be seeing them on D9 Cat Dozers soon"

      Cat's actually been in this game for some time now.  D9?  I think D11s are used as street sweepers for these fully autonomous trucks...


      Sorry Matthew - not trying to spam your thread.  The focus on safety is intense for these machines for obvious reasons.  I think what you are doing with your resources is great.  I hope you are able to develop a robust failsafe system so you can safely and confidently operate your system this fall.

    • Thanks Gary I really appreciate the interest you are taking in the safety aspect of this. As I make progress on the safety features I'll post pics and schematics and ask you and everyone else to pick holes in it. Obviously I'll be doing a ton of my own testing, but if this is ever going to go somewhat mainstream as a diy thing we will need to have some very well documented and robust safety systems.

    • So I bought this relay with remote from IC station. http://www.icstation.com/channel-wireless-remote-control-relay-modu... Top part of the picture is reciever upside down, second picture is reciever right side up and then the remote.  It can be set to momentary or latching and it is easy to program the remotes to different recievers. I orderd 4 of them so everyone in the field can have one. That way anyone can shut down the tractor.

      3702882401?profile=originalI set all the remotes to one reciever and wired it up as follows.  The dual relay board is activated by my DX9 rc remote.  If it goes out of range the brakes come on.  The relay for the small remotes is wired up in series with the dual relay board so three relays would need to stick simultaneously for me not to be able to use the best emergency stopping method. Also it should be noted that the power from these relays operates an air solenoid that releases the brakes so if the power fails the brakes are spring return and will apply.  I'm still thinking about the design of the bar switch combo to be mounted on the front of the tractor but those wires will get hooked up to lim Y on dual relay board.

      3702882239?profile=originalThe one thing about this setup that I can't decide on is how to hook it up.  Should I hook the pwm leads into pixhawk with passthru from my rc remote? Then if pixhawk fails or is disarmed the brake is on, but I already have pixhawk controlling the shuttle shift, which starts and stops the tractor as well. Or I could hook it up directly to rc reciever and bypass pixhawk. Have I missed something obvious or fooled myself into thinking I have some redundancy that I don't really have?  It works as expected when I installed it in the tractor.

    • Alright so I've been reading this for a while now Matthew, and I'm only on page 8 so far, where you're discussing safety and redundancy. I think you've come very far since where you started, but you're missing a couple things. Some big, some small. Firstly. You need to parallel another air solenoid to control your air cylinder - what happens if your first solenoid burns out? Your air cylinder presumably doesn't release and that could be bad news bears. Second,I know you mentioned not liking sonar in favour of the bumper, but the reality is that by the time someone/something has hit that bumper, it's far too late. Maybe not for the side of your combine, but who knows what unforeseen situation could arise, and somebody sees fit to decide to block your tractor, assuming it won't run them over. As it is currently, it could be pretty messy. I like your external remotes idea, but I'd make sure there's 2 receivers for those as well. mounted physically far away from each other, so they have different interference characteristics. Another suggestion I have would be to mount a camera inside, maybe pointed at the dash, so you can monitor for warning lights, watch your speed and such in case it misbehaves. Plus, if you're using this regularly this fall without an operator, you might forget to check the fuel gague ;). AWESOME project. Killer potential, in the most double entendre of ways. I look forward to more updates soon
    • Thanks for the extensive reply I appreciate the thought and time it took. My air solenoid needs power to take the brakes off. If the solenoid burns out the brakes will come on which might be annoying but not a safety concern. I've scrapped the bumper idea, which makes me a little nervous but the failsafes that operate the brake work really well. When that comes on the tractor stops in a hurry. So everyone in the field gets a key fob with a red button that applies the brakes, range is about 200m (100m very reliably). Also if my hobby remote (spektrum dx9) goes out of range the brakes come on. The brakes can also be applied from the dx9 manually. A camera would be great and I definitely considered it but next year I will integrate this into the can bus and get rid of the actuators in the cab so I'll be able to send all the critical tractor data over the telemetry link to the combine driver. We are going to have to be diligent about checking fluids and belts every day and fixing things that are wore before they break. The truck driver will be in the cab at least once an hour to unload the cart so hopefully we can catch problems early. I realize a lot could go wrong in an hour though. Essentially I am as surprised as anyone it's gotten this far and I haven't gotten everything figured out yet. It's been surprisingly reliable in testing so far and it is just too useful not to use. So i'm planning to use this all fall autonomously and it will get completely reworked over the winter. Probably I will learn a lot once we start harvesting for real and I can take all that and rethink the whole design for next year. At least for the first few weeks of harvest I will be the only one in the combine, depending on how it goes I might train someone else to operate it.
    • Developer

      Your lower case "f"all tricked me!  I thought "wet fall" was some sort of Canadian farming term :-)

      The BBB with a PXF is a good option (http://diydrones.com/group/pixhawk-fire-cape-user-group) - its also completely open source which I like.  At the moment I would probably lean towards the Navio+ on a Raspberry PI2 as you have more spare CPU available with the PI2 compared to the BBB.  You could also go companion computer with a Pixhawk and use a powerful ODroid or equivalent for even more computing power if required.

      Thanks, Grant.

    • Fall (August to November). What I mean by wet is that we do on occasion get so much rain during this time that the combine might leave ruts in the field from one end to the other. If this happens we cannot bring our trucks onto the field and you can only put 1 hopper into a cart (chaser bin on your side of the world I think?) that normally holds 4, to keep the weight light enough that it doesn't sink out of sight. This is an abnormal occurance but im almost 30 and it's happened twice in my lifetime. Right now the the tractor is not accurate enough to unload itself into the semi so if a person had to get in every hopper it would make the autopilot pointless.

      Next year I want to add vision for emergency stopping and also for unloading into the truck, should be a fun challenge! I saw a video of two rc planes doing a mock refueling in the air using some sort of vision system, compared to that what I need to do is a cake walk. I'm thinking that a beagle bone black with a fire cape will be the way to go in the future. What do you think?
    • Developer

      Matthew, what's a wet fall and why does it cause problems?

      Thanks, Grant.

    • After I submitted my previous essay of a comment I had another couple thoughts, but I decided to put them separate instead of editing.

      Ideally, you want to have a system where no single point of failure can cause it to behave in a dangerous way, and in as many ways as possible protect yourself against two point failures as well, because those are surprisingly common. Even in the aircraft industry. I'm certainly not saying you should hold yourself to aviation standards, especially since you aren't producing a commercial product or anything. I think your brake trip mechanism is excellent, and things like the relays in series will serve you very well. I think you must also consider the situation where you are the point of failure, meaning that if its the end of a 15 hour day combining, and you've been having great success all day
      long, you might not notice the tractor misbehaving soon enough, especially if the combine is starting to plug at the same time and you are focused on looking down at the header, or if your phone rings right then. Probably you would. I know farmers are excellent at looking every direction at once. Just thought I'd mention not every failure is a hardware failure. In the real world,rob ably more than half the accidents are human error of some sort.

      On a slightly related note, a lot of human errors are caused by a misunderstanding of some sort, so I like how when you send the tractor away, you have to speed it up manually (also great job on the python in general- though I'm no authority on coding, it seems to work, which is the most important attribute IMO)
      Perhaps to avoid misunderstandings( on anyone's part, not just yours) it would be a good thing if the tractor signalled its intent somehow, just a bit before actually performing a significant action? I'm not exactly sure how this would operate, but it would be kinda neat and at the very least could help with some debugging.

      I'd also want to make it so if the combine stops, the tractor stops almost immediately, so that it doesn't decide to turn right and go around.

      Finally(for now I think) what happens if the tractor gets stuck? I don't know what you're like there in Manitoba but my at my friends just south of Yorkton they get stuck combining a couple times a year, and that would probably be a real pain to have the tractor dig itself in. Maybe If the GPS reported speed drops below what you requested, halt? This is more a question for the devs though not you I think.
This reply was deleted.