|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Equation for joystick input to Talons
hello all, we currently have decided to look into tweaking the operator controls of driving the robot. we currently have the joystick to Talon equation as a linear equation: y=x. What the joysticks get is sent to the talons. Each get values between -1 and 1. I'm sure you know this. y is what the Talons receive and x is the joystick input. What we're looking for is an equation that starts out slow, but once you get x to be around .4 to .6, y should be roughly equal to the x value. Past that, the y value should rapidly increase until you reach where x is around .75 or .8, where it should become very close to 1.
Example point table: x,y 0,0 .1,.005 .5,.5 .6,.8 1,1 I know it may not be much, but I am also wondering what you may have used. this isn't really an issue with sensitivity, we are just looking to drive a little more slowly when the joysticks are lightly touched, but once they get past .6 or .7, drive very closely to full power if not full. I understand we can do this with simple if statements, but an equation would make it... "flow"... much better. Thank you for your help ![]() |
|
#2
|
||||
|
||||
|
Re: Equation for joystick input to Talons
|
|
#3
|
|||||
|
|||||
|
Re: Equation for joystick input to Talons
You could use an interpolation table.
Basically, you make a table like you already made, and the software linearly interpolates between the points. Super easy to write, calibrate, etc. I wrote a LV VI to do this (it's in the BuzzLib download here). I can try to dig up my C version if anyone wants it. |
|
#4
|
||||
|
||||
|
Re: Equation for joystick input to Talons
Here is an sketch I drew up, I'm not entirely convinced that if I found it's equation we would use it, but it was my first idea.
http://i.imgur.com/57TuSZw.jpg (ignore the scribble )@ the posted image: yes, i have come across those equations in my searches. i would like something that changes concavity once it reaches roughly .5. nothing extremely fancy like my sketch, but something of the likes. my sketch doesn't reflect this paragraph, btw. i'm probably confusing you all. sorry about that. |
|
#5
|
||||
|
||||
|
Re: Equation for joystick input to Talons
Quote:
Or I can show you how to do it yourself. Last edited by Ether : 04-02-2014 at 16:07. Reason: removed link |
|
#6
|
||||
|
||||
|
Re: Equation for joystick input to Talons
I've know the basics of how to do it with f'(x) and f''(x), but the only problem I run across is changing the way the curve "bends" per se... If you could PM me how you do it that would be fantastic.
|
|
#7
|
|||||
|
|||||
|
Re: Equation for joystick input to Talons
If you must have an equation, you could type your in->out pairs into Excel, graph them (x vs y), then add a trendline and use the equation.
|
|
#8
|
||||
|
||||
|
Re: Equation for joystick input to Talons
Will try that now, completely forgot about this. thank you.
|
|
#9
|
||||
|
||||
|
Re: Equation for joystick input to Talons
Quote:
Last edited by Ether : 04-02-2014 at 16:06. |
|
#10
|
|||||
|
|||||
|
Re: Equation for joystick input to Talons
http://www.wolframalpha.com/input/?i...nd+%281%2C1%29
Wolfram Alpha can do some magic... try tweaking this around a bit |
|
#11
|
||||
|
||||
|
Re: Equation for joystick input to Talons
Thank you for that wolframalpha link! I didn't know you could do that. We will definitely be tweaking that. I've found an equation to use for now by means of Excel - y = 0.9703x^5 - 2.673x^4 + 0.3901x^3 + 2.0981x^2 + 0.2075x. It seems to look good and we will be testing it on the drive train soon. Thank you to all your posts! Definitely helped.
|
|
#12
|
|||||
|
|||||
|
Re: Equation for joystick input to Talons
If you have even powers in your equation, you will have to take the abs of the input variable and multiply the output by the sign of the input, because you will lose the sign on the even terms but not the odd terms.
An equation with all odd powers would not do that. |
|
#13
|
||||
|
||||
|
Re: Equation for joystick input to Talons
Yep, I've got that accounted for.
|
|
#14
|
||||
|
||||
|
Re: Equation for joystick input to Talons
For a basic interpolation given a few points, this should give you an idea. Your particular data points wouldn't produce a perfect equation fitting into ±1 range, but that can be fixed with some scaling. I would really like to know if there's an alternative to doing it this way, though :)
|
|
#15
|
||||
|
||||
|
Re: Equation for joystick input to Talons
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|