DIY AutoSteer with AgOpenGPS - Page 3 - The Combine Forum
 1076Likes
Reply
 
LinkBack Thread Tools
post #21 of 1792 (permalink) Old 04-24-2017, 12:37 PM Thread Starter
Senior Member
 
Join Date: Aug 2012
Location: Vermilion Alberta Canada
Posts: 5,344
Mentioned: 5 Post(s)
Quoted: 2342 Post(s)
Quote:
Originally Posted by torriem View Post
As far as control goes, Matt Reimer used a standard PWM 12V motor controller to drive the two solenoids for his autonomous tractor. PWM on one solenoid to steer in one direction, and the other to steer in the other direction I'm presuming.

I can't remember what valve block Matt was using.
But don't you also have to control the load sense line to get actual flow to start with?

BrianTee is offline  
Sponsored Links
Advertisement
 
post #22 of 1792 (permalink) Old 04-24-2017, 06:24 PM
Member
 
CQuick's Avatar
 
Join Date: Feb 2017
Location: Somerset, UK
Posts: 92
Mentioned: 4 Post(s)
Quoted: 46 Post(s)
If you've got a spare spool it may be wise to use a standard proportional valve, 3 position, all 4 ports blocked in the centre. Works on older open centre systems too, placed in parallel with the Orbitrol. These are fairly inexpensive (650).

CCLS systems need a pre-compensated valve with P connected to LS in all positions other than centre. Quite a rare part though I think, spoke to my local hydraulic supplier and even they didn't know where to start! A possible bodge would be to use a separate solenoid valve which fires in tandem with the proportional valve, and connects P to LS when active.

I'm planning to do my testing on an older open centre tractor so I can put the research on the back-burner for a while until I at least have a working autosteer using cheaper components

BrianTee and Wedge like this.
CQuick is offline  
post #23 of 1792 (permalink) Old 04-24-2017, 07:50 PM Thread Starter
Senior Member
 
Join Date: Aug 2012
Location: Vermilion Alberta Canada
Posts: 5,344
Mentioned: 5 Post(s)
Quoted: 2342 Post(s)
Quote:
Originally Posted by CQuick View Post
If you've got a spare spool it may be wise to use a standard proportional valve, 3 position, all 4 ports blocked in the centre. Works on older open centre systems too, placed in parallel with the Orbitrol. These are fairly inexpensive (650).

CCLS systems need a pre-compensated valve with P connected to LS in all positions other than centre. Quite a rare part though I think, spoke to my local hydraulic supplier and even they didn't know where to start! A possible bodge would be to use a separate solenoid valve which fires in tandem with the proportional valve, and connects P to LS when active.

I'm planning to do my testing on an older open centre tractor so I can put the research on the back-burner for a while until I at least have a working autosteer using cheaper components
From what i understand the load sense line can be either direction too. Some sense a drain, while others sense pressure. Both end up providing a supply signal to increase pressure.
BrianTee is offline  
Sponsored Links
Advertisement
 
post #24 of 1792 (permalink) Old 04-24-2017, 07:57 PM
Senior Member
 
Join Date: Sep 2009
Location: S. AB
Posts: 3,297
Mentioned: 5 Post(s)
Quoted: 808 Post(s)
I don't know anything about the load sensing line. Matt has never said anything in his videos about that. From his writings on the diydrones forum, it appears he's just using this PWM motor controller with built-in feedback that he takes from a wheel angle sensor. His schematic only shows two wires controlling the steering valve: 12v for each solenoid. The steering valve he uses is made by Outback.

http://diydrones.com/group/ardurover...Group%3A903163
torriem is offline  
post #25 of 1792 (permalink) Old 04-25-2017, 01:17 AM Thread Starter
Senior Member
 
Join Date: Aug 2012
Location: Vermilion Alberta Canada
Posts: 5,344
Mentioned: 5 Post(s)
Quoted: 2342 Post(s)
If he is using an Outback valve, then yes, all the complicated stuff is done in there.

Geek chart! Nothing like seeing a picture of what is going on with parameters.....

m_elias likes this.
BrianTee is offline  
post #26 of 1792 (permalink) Old 05-05-2017, 01:51 PM
Member
 
CQuick's Avatar
 
Join Date: Feb 2017
Location: Somerset, UK
Posts: 92
Mentioned: 4 Post(s)
Quoted: 46 Post(s)

Initial testing! Couldn't get AOG to output anything useful so sent some 'dummy' data out of the arduino. All completely untuned, as you can see, but the concept works! Note that i the video I said '30 degrees' when I actually mean 30%; where 0% is full left and 100% is full right steer.

Next steps:

GUI - Add sliders for adjustment of parameters e.g. PWM floor (minimum PWM value for the valve to turn on)
Tune parameters such as input and output weights (and maybe tweak the membership functions, rules etc of the fuzzy system)
Remove arduino - for a more streamlined system. Only there because I didn't have time to code all the stuff in Python
Steering movement sensor - Automatic disengagement when steering wheel movement detected. Could possibly do it in code where it detects when it is 'fighting' the operator, although will need some careful programming to avoid disengaging when hitting a bump, etc.

All in all though, I call that a successful first test!
torriem, BrianTee and ghostflames like this.
CQuick is offline  
post #27 of 1792 (permalink) Old 05-06-2017, 01:08 AM Thread Starter
Senior Member
 
Join Date: Aug 2012
Location: Vermilion Alberta Canada
Posts: 5,344
Mentioned: 5 Post(s)
Quoted: 2342 Post(s)
I've uploaded the latest AgOpen with the Arduino code under steer. It should work. You have to be within 3 or 4 meters of ABLine, and reasonable heading.

Hopefully it will work for you.

The Arduino code is very different in this one. It uses headings calculated based on distance from line, as opposed to a distance only and PID. Its a strange version of feed forward PID with the heading error being the control. That way there should be significantly reduced error by following a changing heading rather then trying to shoot for a line. Wish i had more time to play with this.

Your test looks great.

Last edited by BrianTee; 05-06-2017 at 01:11 AM.
BrianTee is offline  
post #28 of 1792 (permalink) Old 05-07-2017, 04:38 AM
Member
 
CQuick's Avatar
 
Join Date: Feb 2017
Location: Somerset, UK
Posts: 92
Mentioned: 4 Post(s)
Quoted: 46 Post(s)
Sorry Brian, couldn't get that to work either, won't even show the arduino data in the setup window. Not to worry though, i'm going to leave it for a few months until after exams/harvest, and just refine what I've got, maybe get a few boards made up. Hopefully will be able to resume testing in the autumn and winter. Thank you for all the hard work and effort you've put into this!

My code is up on Github if anyone wants to have a look (try not to laugh too hard!)
https://github.com/charlesquick/FuzzySteer
CQuick is offline  
post #29 of 1792 (permalink) Old 05-07-2017, 11:02 AM
Senior Member
 
Join Date: Sep 2009
Location: S. AB
Posts: 3,297
Mentioned: 5 Post(s)
Quoted: 808 Post(s)
What exactly does the R code do? What is the principle by which it operates?

EDIT: Here's a link that describes the general idea, and compares it a bit to PID:
https://en.wikipedia.org/wiki/Fuzzy_control_system

So if I understand your code correctly, the pwm output for the steering valve is currently coming from the Pi, from python, and the steering angle is coming from the arduino, correct? The arduino is passing information from the tablet, combined with the steering angle sensor reading to the Pi over the second serial link, which then does the fuzzy control calculations to determine the desired steering angle, and then outputs PWM to the motor controller board. So really if you had a way of doing analog input on the Pi, you could eliminate the arduino entirely. Did I get that right? Is the Pi Python code real time enough to work reliably

Last edited by torriem; 05-07-2017 at 11:33 AM.
torriem is offline  
post #30 of 1792 (permalink) Old 05-07-2017, 12:07 PM
Member
 
CQuick's Avatar
 
Join Date: Feb 2017
Location: Somerset, UK
Posts: 92
Mentioned: 4 Post(s)
Quoted: 46 Post(s)
Torriem,
Yes you're absolutely correct. I only used the arduino because I was running out of time and it was easier to use Brian's existing serial code and make use of the Arduino's ADC. The Pi should definitely be fast enough to handle the calculations in real time, this is helped by the fact that the R code runs in a separate thread. The system takes a few seconds to load initially, but after that it seems pretty quick. If you like, I can run some tests to put a number on exactly how fast.

Edit:

You might be wondering how to decipher the .fis file:

Inputs distance, delta and speed are categorised into the relevant membership functions as defined in the 3 [input] sections. For example, distance = -323, delta = 52, speed = 6 will be sorted as follows:

distance only falls under the 'neg_low' membership function, to a degree of around 0.3
delta is 'pos_zero' to a degree 0.5 and 'pos_low' to a very small degree
speed is 0.6 'low' and 0.4 'med'

The [rules] section goes like this: IF (antecedent 1) AND (antecedent 2) AND (antecedent 3) THEN (consequent 1). Zero means undefined (so speed isn't evaluated in most of the rules)

i.e. 1 1 0, 9 (1) : 1 equates to distance, delta, speed, output, weight (always 1), evaluation type (1 = AND, 2 = OR). So it translates to IF (distance is neg_hi) AND (delta is neg_hi) THEN (output is pos_hi).

Evaluate all of these rules to the membership degrees we calculated earlier and then take the centre of the output and out pops your steer value.

I hope this helps you understand what I've done If you search youtube for Fuzzy Logic there's a few good videos on the subject too.


Last edited by CQuick; 05-07-2017 at 12:42 PM.
CQuick is offline  
Sponsored Links
Advertisement
 
Reply

Quick Reply
Message:
Options

Register Now



In order to be able to post messages on the The Combine Forum forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.

User Name:
Password
Please enter a password for your user account. Note that passwords are case-sensitive.

Password:


Confirm Password:
Email Address
Please enter a valid email address for yourself.

Email Address:
OR

Log-in










Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page



Posting Rules  
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

 
For the best viewing experience please update your browser to Google Chrome