|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools |
Rating:
|
Display Modes |
|
#1
|
||||
|
||||
|
paper: joystick sensitivity (gain) adjustment
Thread created automatically to discuss a document in CD-Media.
joystick sensitivity (gain) adjustment by Ether |
|
#2
|
||||
|
||||
|
Re: paper: joystick sensitivity (gain) adjustment
No dead band?
|
|
#3
|
|||
|
|||
|
Re: paper: joystick sensitivity (gain) adjustment
I had fiddled with this off and on years before, but never really worked it out properly or had the time (or a spare robot) during build season. It's nice to see it formalized and posted here.
Just to make it clear (or correct me if I'm wrong), the X and Y are not the actual joystick numbers from the X and Y axis (eg, in y = x^3, axis x number doesn't produce axis y number), but the input and output from each direction, so really you should have two formulas: AxisX_output = AxisX_input ^ 3 AxisY_output = AxisY_input ^ 3 The deadzone or band would be a separate calculation (at least programming-wise); a simple "if input is between -0.2 and +0.2 then Y= 0". Whilst doing it all at once would be elegant, it would be a nightmare to debug. Though looking at the graph for f(x)=x^3, in all practicallity the robot motors might not overcome robot weight at all under +/-0.3. I wonder what the effect would be if a<0? That is, more power near zero (to overcome the robot weight) and leveling off at higher speeds. In practice this would have to be adjusted to each individual robot; even similar robots (a prototype and competition robot for example) would have different results. Also adjust to the driver, as different drivers like different reactions. If the driver doesn't notice it, then it works! |
|
#4
|
||||
|
||||
|
Re: paper: joystick sensitivity (gain) adjustment
Not sure what you mean. You can easily add additional deadband if you wish, but for values of "a" near 1, you may not need to. |
|
#5
|
||||
|
||||
|
Re: paper: joystick sensitivity (gain) adjustment
Quote:
X' = a1*X^3 + (1-a1)*X Y' = a2*Y^3 + (1-a2)*Y Z' = a3*Z^3 + (1-a3)*Z Quote:
Quote:
Quote:
*for some reason this thread does not allow me to attach the graph Last edited by Ether : 23-12-2010 at 08:43. Reason: could not attach graph |
|
#6
|
||||
|
||||
|
Re: paper: joystick sensitivity (gain) adjustment
We take a somewhat different approach.
We use four linear equations (y=mx+b). First, we test our robot. So far, every robot we have built has been skid-steer. This means that there is an appreciable amount of motor force that it takes to break the robot into a skid to turn. Utilizing a control on the dashboard, we watch the values required to break it free using only one side. This is the B-intercept of our equation, so that the instant you move the joysticks out of the controller's preprogrammed deadband, you have enough power to turn the robot at the slowest possible speed. So we use one equation from 0 to about 80% power. This portion has a gentle slope. After that, the slope goes from that point up to 1 (maximum joystick), 1 (maximum motor output). The nice part is that we only need to enter two values into our custom VI. The "B" y-intercept value that the drivetrain manages to start turning the robot at, and the intersection point of the two slopes. For instance, if you were to graph it, the positive domain of the joystick would have these x,y points: (X,Y) (0,0.2) (0.7,0.7) (1,1) I'm trying to attach a picture, but it doesn't appear I can do so in this forum. Last edited by Tom Line : 23-12-2010 at 17:09. |
|
#7
|
||||
|
||||
|
Re: paper: joystick sensitivity (gain) adjustment
Quote:
|
|
#8
|
|||
|
|||
|
Re: paper: joystick sensitivity (gain) adjustment
Really like the idea of that use of throttle.
Out of curiosity, is there anything special about the function x^3+x? Recently we've used an exponential graph: Let min = lowest desired value (min>0, usually the highest value at which the robot doesn't move) Let max = highest desired value (usually, max = 1.0) Then, output = min(max/min)^joystick value. This also enables us to vary the max value for the turning axes based on the robot's forward speed. |
|
#9
|
||||
|
||||
|
Re: paper: joystick sensitivity (gain) adjustment
Quote:
As mentioned in the paper, when a=0, it becomes f(x)=x. When a=1, it becomes f(x)=x^3. When 0<a<1, it's something in-between. You can vary the "a" parameter to create a curve between f(x)=x and f(x)=x^3 to obtain the desired gain at low joystick settings. Also, f(x) maps the domain (-1..1) into the range (-1..1) for any chosen value of "a" between 0 and 1, so there's no extra code required to break the domain up into, say, x<0 and x>0. Quote:
If you want to add a Y-intercept to the f(x) function, you can do it like this: Code:
g(x) = b + (1-b)*[a*x^3 + (1-a)*x] for x>=0 g(x) = -b + (1-b)*[a*x^3 + (1-a)*x] for x<0 Interestingly, if you set b=0.2 and a=0.5, you get almost exactly the same curve as your exponential curve with min=0.2. I have a graph prepared to illustrate this but can't attach it to this post for some reason*. I'll upload it when I get a chance. Quote:
*if a moderator happens to be reading, would it be possible to change permissions on this thread to allow attaching graphs? |
|
#10
|
|||
|
|||
|
Re: paper: joystick sensitivity (gain) adjustment
Quote:
Selecting a joystick mapping function is one of the best teaching opportunities you have in FRC. There are many right answers, it is open to opinion, it is super easy to prototype, you can objectively compare a bunch of them on a whiteboard, and it answers the questions set forth in this article: http://www.fordham.edu/academics/pro...math/index.asp . That is to say, it might be the first time the students go in the "from problem to math" direction, instead of the "from math to problem" direction. ax^3+(1-a)x does have a few special properties, see if your students come up with these in their lists of "wants" for their formula:
|
|
#11
|
|||
|
|||
|
Re: paper: joystick sensitivity (gain) adjustment
@Ether
Cool, will try it with the y-intercept. Really curious if I'll be able to feel a significant difference at different a-values. When I stated "This also enables us to vary the max value for the turning axes based on the robot's forward speed," I meant that we found at high speeds, a slight tap to the side on the joystick will send the robot flying away. So, for example, when the robot is moving 1.0 (full speed) in the y-direction, then we might only allow the robot to move up to 0.1 in the x-direction. When the robot isn't moving in the y-direction, then we allow the full 1.0 turning speed. @EricVanWyk As a student, steering curves was the first time I went from problem->math; it was definitely among my fav. robotics experiences. I will try this with some of the rookie programmers, and maybe my calc teacher ![]() |
|
#12
|
||||
|
||||
|
Re: paper: joystick sensitivity (gain) adjustment
Quote:
To address this problem, you could use the 2-parameter g(x) function, and treat the "b" inverse deadband parameter like a variable instead of a tuning constant. In other words, adjust the value of "b" (for the rotate axis conversion) as a function of speed before running your joystick rotate axis through the g(x) conversion. caveat emptor: I've never tried this. |
|
#13
|
||||
|
||||
|
Re: paper: joystick sensitivity (gain) adjustment
Quote:
I took the liberty of parameterizing it, to make it tunable on-the-fly. Here's an implementation written in Delphi: Code:
if (x>=a) then y := c+(x-a)*((1-c)/(1-a)) else if (x>=0) then y :=b + ((c-b)/a)*x else if (x>=-a) then y := -b + ((c-b)/a)*x else y:= -c + (x+a)*((1-c)/(1-a)); The three parameters are a, b, and c:
|
|
#14
|
||||
|
||||
|
Re: paper: joystick sensitivity (gain) adjustment
Quote:
|
|
#15
|
|||
|
|||
|
Re: paper: joystick sensitivity (gain) adjustment
Yesterday I gave this to one of my programmers to put into our LabVIEW code, as a sort of a warm-up exercise. An added bonus was making it a sub-vi to plug into future code.
There is a difference in driving, though perhaps not enough to change a good driver with careful joystick control. We didn't test it fully however. A suggetion that simplifies changing "a" from rewriting code to letting the driver change it on the fly: use the thumb-thingie on the KOP joystick (it's at the base in the front and is known as axis3). It's range is -1 to +1, but with simple math can be converted to 0 to +1. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Joystick Sensitivity | furiousgeorge | NI LabVIEW | 15 | 04-02-2014 23:10 |
| joystick sensitivity adjustment | Ether | Programming | 3 | 19-02-2010 00:07 |
| joystick sensitivity | gabrielse | Programming | 2 | 08-02-2008 14:52 |
| Joystick sensitivity | Philz20 | Programming | 10 | 24-01-2008 08:34 |
| White Paper Discuss: Joystick Sensitivity Demystified - Version 2 | marccenter | Extra Discussion | 0 | 28-02-2005 16:54 |