|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools |
Rating:
|
Display Modes |
|
#1
|
|||
|
|||
|
Mecanum wheels spinning too fast!
Before and after we have programmed a "dead zone" into our coding, we noticed that our xbox 360 thumbsticks are very touchy. Just barely moving the joysticks move the robot wheels too fast. What I need is some Labview coding that slowly starts moving the robot in the direction the thumbstick is being pushed, and then it ramps up to a higher speed when the the thumbstick is pushed all the way. Any help?
|
|
#2
|
||||
|
||||
|
Re: Mecanum wheels spinning too fast!
I would try to put in a selector that would take the input from the joystick and halve (or divide) it until it is greater or equal to 1 and then keep it constant to increase speed. Add in your deadzone and this should work.
![]() Last edited by pastelpony : 02-02-2015 at 02:12 PM. |
|
#3
|
||||
|
||||
|
Re: Mecanum wheels spinning too fast!
Square or cube the joystick commands.
|
|
#4
|
|||
|
|||
|
Re: Mecanum wheels spinning too fast!
How can I square or cube those joystick values, Alpha Beta? Also, pastelpony, would like to see that selector coding, thank you for your help!
Last edited by ironmare : 02-02-2015 at 02:18 PM. |
|
#5
|
||||
|
||||
|
Re: Mecanum wheels spinning too fast!
Can you give us a glimpse of what your code looks like right now?
|
|
#6
|
|||||
|
|||||
|
Re: Mecanum wheels spinning too fast!
The easiest way to square the joystick input values is to set the "square inputs" terminal to TRUE when you open your drive motors and let the WPI library take care of it for you.
If you want to cube them, then take the value from each joystick axis and multiply it by itself, then multiply the result by the original value. |
|
#7
|
||||
|
||||
|
Re: Mecanum wheels spinning too fast!
Edited in.
|
|
#8
|
||||
|
||||
|
Re: Mecanum wheels spinning too fast!
Quote:
Note there is a small bit of logic needed to restore the sign to values that were initially negative. |
|
#9
|
||||
|
||||
|
Re: Mecanum wheels spinning too fast!
Wouldn't squaring/cubing/multiplying the value of the inputs only make the stick more sensitive, though?
|
|
#10
|
||||
|
||||
|
Re: Mecanum wheels spinning too fast!
Quote:
Last edited by Ether : 02-02-2015 at 03:32 PM. |
|
#11
|
||||
|
||||
|
Re: Mecanum wheels spinning too fast!
I completely forgot that we're talking about decimals. Thank you for that reminder.
|
|
#12
|
||||
|
||||
|
Re: Mecanum wheels spinning too fast!
they way we fit this is we create a lookup table and we run the joystick command through that. This way you can have a custom joystick response. This also allows you to add a deadband, back lash corrections and ramp rates
|
|
#13
|
||||
|
||||
|
Re: Mecanum wheels spinning too fast!
Quote:
|
|
#14
|
||||
|
||||
|
Re: Mecanum wheels spinning too fast!
sorry no both ways work just as well. Just was putting out another option. We have just had good luck with this method. here is an example of how we use it http://i.imgur.com/Bq7QMuE.png
Last edited by Bpk9p4 : 02-03-2015 at 02:00 PM. |
|
#15
|
||||
|
||||
|
Re: Mecanum wheels spinning too fast!
Quote:
Just for fun, when you have a symmetric piecewise linear curve like that with so few pieces, you can create a very simple tunable piecewise linear function. I labeled the points (a,0), (a,b), and (c,d) on your diagram (attached). C code for the piecewise linear code for that is quite simple: Code:
// do the following once at initialization, // or any time you change a ,b, c, or d on-the-fly: m1=(d-b)/(c-a); m2=(1-d)/(1-c); Code:
// Let J be the abscissa and K be the ordinate on your graph. // Here's the piecewise linear code to convert J to K: x=fabs(J); if (x<a) K=0; else if (x<c) K=b+m1*(x-a); else K=d+m2*(x-c); if (J<0) K=-K; |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|