Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Mecanum wheels spinning too fast! (http://www.chiefdelphi.com/forums/showthread.php?t=133870)

ironmare 02-02-2015 01:57 PM

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?

pastelpony 02-02-2015 02:02 PM

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.


Alpha Beta 02-02-2015 02:04 PM

Re: Mecanum wheels spinning too fast!
 
Square or cube the joystick commands.

ironmare 02-02-2015 02:10 PM

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!

samfruth 02-02-2015 02:34 PM

Re: Mecanum wheels spinning too fast!
 
Can you give us a glimpse of what your code looks like right now?

Alan Anderson 02-02-2015 02:46 PM

Re: Mecanum wheels spinning too fast!
 
1 Attachment(s)
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.

pastelpony 02-02-2015 02:53 PM

Re: Mecanum wheels spinning too fast!
 
Quote:

Originally Posted by ironmare (Post 1437335)
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!

Edited in.

Alpha Beta 02-02-2015 02:53 PM

Re: Mecanum wheels spinning too fast!
 
1 Attachment(s)
Quote:

Originally Posted by ironmare (Post 1437335)
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!

Squaring the inputs is a selectable feature built into the arcade and tank drive vi's. If you open one of them up you can see how it is done and mirror the logic. At first glance I didn't see it being utilized in the mecanum drive vi. I wonder if there is a reason.

Note there is a small bit of logic needed to restore the sign to values that were initially negative.

pastelpony 02-02-2015 03:10 PM

Re: Mecanum wheels spinning too fast!
 
Wouldn't squaring/cubing/multiplying the value of the inputs only make the stick more sensitive, though?

Ether 02-02-2015 03:27 PM

Re: Mecanum wheels spinning too fast!
 
1 Attachment(s)
Quote:

Originally Posted by pastelpony (Post 1437368)
Wouldn't squaring/cubing/multiplying the value of the inputs only make the stick more sensitive, though?

see attachment



pastelpony 02-02-2015 03:30 PM

Re: Mecanum wheels spinning too fast!
 
Quote:

Originally Posted by Ether (Post 1437373)
What is the value of (0.5)2 ?



I completely forgot that we're talking about decimals. Thank you for that reminder.

Bpk9p4 02-03-2015 11:49 AM

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

Ether 02-03-2015 12:18 PM

Re: Mecanum wheels spinning too fast!
 
Quote:

Originally Posted by Bpk9p4 (Post 1437651)
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

You seem to be implying that using a lookup table to shape the joystick output allows implementing a ramp rate, whereas using a function to shape the joystick output does not. Is that what you intended?



Bpk9p4 02-03-2015 01:40 PM

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

Ether 02-04-2015 03:57 PM

Re: Mecanum wheels spinning too fast!
 
1 Attachment(s)
Quote:

Originally Posted by Bpk9p4 (Post 1437690)
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

You mentioned you were using a Lookup Table for that.

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;




All times are GMT -5. The time now is 05:58 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi