Go to Post 2015 never happened - Chris is me [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 02-02-2015, 13:57
ironmare ironmare is offline
Registered User
FRC #5072
 
Join Date: Jan 2015
Location: United States
Posts: 7
ironmare is an unknown quantity at this point
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?
Reply With Quote
  #2   Spotlight this post!  
Unread 02-02-2015, 14:02
pastelpony's Avatar
pastelpony pastelpony is offline
Programmer/Electrical
AKA: Zach M
FRC #3525 (Nuts and Bolts of Fury)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: Waterbury, Connecticut
Posts: 152
pastelpony will become famous soon enough
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.

__________________
Team 3525 Head Programmer (2014- ) - Java (Formerly LabVIEW)

Last edited by pastelpony : 02-02-2015 at 14:12.
Reply With Quote
  #3   Spotlight this post!  
Unread 02-02-2015, 14:04
Alpha Beta's Avatar
Alpha Beta Alpha Beta is offline
Strategy, Scouting, and LabVIEW
AKA: Mr. Aaron Bailey
FRC #1986 (Team Titanium)
Team Role: Coach
 
Join Date: Mar 2008
Rookie Year: 2007
Location: Lee's Summit, Missouri
Posts: 763
Alpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond repute
Re: Mecanum wheels spinning too fast!

Square or cube the joystick commands.
__________________
Regional Wins: 2016(KC), 2015(St. Louis, Queen City), 2014(Central Illinois, KC), 2013(Hub City, KC, Oklahoma City), 2012(KC, St. Louis), 2011(Colorado), 2010(North Star)
Regional Chairman's Award: 2014(Central Illinois), 2009(10,000 Lakes)
Engineering Inspiration: 2016(Smoky Mountain), 2012(Kansas City), 2011(Denver)
Dean's List Finalist 2016(Jacob S), 2014(Cameron L), 2013(Jay U), 2012(Laura S), 2011(Dominic A), 2010(Collin R)
Woodie Flowers Finalist 2013 (Aaron Bailey)
Championships: Sub-Division Champion (2016), Finalist (2013, 2010), Semifinalist (2014), Quaterfinalist (2015, 2012, 2011)
Other Official Awards: Gracious Professionalism (2013) Entrepreneurship (2013), Quality (2015, 2015, 2013), Engineering Excellence (Champs 2013, 2012), Website (2011), Industrial Design (Archimedes/Tesla 2016, 2016, 2015, Newton 2014, 2013, 2011), Innovation in Control (2014, Champs 2010, 2010, 2008, 2008), Imagery (2009), Regional Finalist (2016, 2015, 2008)
Reply With Quote
  #4   Spotlight this post!  
Unread 02-02-2015, 14:10
ironmare ironmare is offline
Registered User
FRC #5072
 
Join Date: Jan 2015
Location: United States
Posts: 7
ironmare is an unknown quantity at this point
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 14:18.
Reply With Quote
  #5   Spotlight this post!  
Unread 02-02-2015, 14:34
samfruth's Avatar
samfruth samfruth is offline
Registered User
FRC #1710 (Ravonics Revolution)
Team Role: Driver
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Olathe, Kansas
Posts: 132
samfruth will become famous soon enough
Re: Mecanum wheels spinning too fast!

Can you give us a glimpse of what your code looks like right now?
Reply With Quote
  #6   Spotlight this post!  
Unread 02-02-2015, 14:46
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
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.
Attached Thumbnails
Click image for larger version

Name:	cube.gif
Views:	42
Size:	1.6 KB
ID:	18092  
Reply With Quote
  #7   Spotlight this post!  
Unread 02-02-2015, 14:53
pastelpony's Avatar
pastelpony pastelpony is offline
Programmer/Electrical
AKA: Zach M
FRC #3525 (Nuts and Bolts of Fury)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: Waterbury, Connecticut
Posts: 152
pastelpony will become famous soon enough
Re: Mecanum wheels spinning too fast!

Quote:
Originally Posted by ironmare View Post
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.
__________________
Team 3525 Head Programmer (2014- ) - Java (Formerly LabVIEW)
Reply With Quote
  #8   Spotlight this post!  
Unread 02-02-2015, 14:53
Alpha Beta's Avatar
Alpha Beta Alpha Beta is offline
Strategy, Scouting, and LabVIEW
AKA: Mr. Aaron Bailey
FRC #1986 (Team Titanium)
Team Role: Coach
 
Join Date: Mar 2008
Rookie Year: 2007
Location: Lee's Summit, Missouri
Posts: 763
Alpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond repute
Re: Mecanum wheels spinning too fast!

Quote:
Originally Posted by ironmare View Post
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.
Attached Thumbnails
Click image for larger version

Name:	Square Inputs.PNG
Views:	46
Size:	6.1 KB
ID:	18093  
__________________
Regional Wins: 2016(KC), 2015(St. Louis, Queen City), 2014(Central Illinois, KC), 2013(Hub City, KC, Oklahoma City), 2012(KC, St. Louis), 2011(Colorado), 2010(North Star)
Regional Chairman's Award: 2014(Central Illinois), 2009(10,000 Lakes)
Engineering Inspiration: 2016(Smoky Mountain), 2012(Kansas City), 2011(Denver)
Dean's List Finalist 2016(Jacob S), 2014(Cameron L), 2013(Jay U), 2012(Laura S), 2011(Dominic A), 2010(Collin R)
Woodie Flowers Finalist 2013 (Aaron Bailey)
Championships: Sub-Division Champion (2016), Finalist (2013, 2010), Semifinalist (2014), Quaterfinalist (2015, 2012, 2011)
Other Official Awards: Gracious Professionalism (2013) Entrepreneurship (2013), Quality (2015, 2015, 2013), Engineering Excellence (Champs 2013, 2012), Website (2011), Industrial Design (Archimedes/Tesla 2016, 2016, 2015, Newton 2014, 2013, 2011), Innovation in Control (2014, Champs 2010, 2010, 2008, 2008), Imagery (2009), Regional Finalist (2016, 2015, 2008)
Reply With Quote
  #9   Spotlight this post!  
Unread 02-02-2015, 15:10
pastelpony's Avatar
pastelpony pastelpony is offline
Programmer/Electrical
AKA: Zach M
FRC #3525 (Nuts and Bolts of Fury)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: Waterbury, Connecticut
Posts: 152
pastelpony will become famous soon enough
Re: Mecanum wheels spinning too fast!

Wouldn't squaring/cubing/multiplying the value of the inputs only make the stick more sensitive, though?
__________________
Team 3525 Head Programmer (2014- ) - Java (Formerly LabVIEW)
Reply With Quote
  #10   Spotlight this post!  
Unread 02-02-2015, 15:27
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,091
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Mecanum wheels spinning too fast!

Quote:
Originally Posted by pastelpony View Post
Wouldn't squaring/cubing/multiplying the value of the inputs only make the stick more sensitive, though?
see attachment


Attached Thumbnails
Click image for larger version

Name:	squared and cubed.png
Views:	42
Size:	11.4 KB
ID:	18094  

Last edited by Ether : 02-02-2015 at 15:32.
Reply With Quote
  #11   Spotlight this post!  
Unread 02-02-2015, 15:30
pastelpony's Avatar
pastelpony pastelpony is offline
Programmer/Electrical
AKA: Zach M
FRC #3525 (Nuts and Bolts of Fury)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: Waterbury, Connecticut
Posts: 152
pastelpony will become famous soon enough
Re: Mecanum wheels spinning too fast!

Quote:
Originally Posted by Ether View Post
What is the value of (0.5)2 ?


I completely forgot that we're talking about decimals. Thank you for that reminder.
__________________
Team 3525 Head Programmer (2014- ) - Java (Formerly LabVIEW)
Reply With Quote
  #12   Spotlight this post!  
Unread 03-02-2015, 11:49
Bpk9p4's Avatar
Bpk9p4 Bpk9p4 is offline
Registered User
FRC #1756
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Illinios
Posts: 274
Bpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant future
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
Reply With Quote
  #13   Spotlight this post!  
Unread 03-02-2015, 12:18
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,091
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Mecanum wheels spinning too fast!

Quote:
Originally Posted by Bpk9p4 View Post
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?


Reply With Quote
  #14   Spotlight this post!  
Unread 03-02-2015, 13:40
Bpk9p4's Avatar
Bpk9p4 Bpk9p4 is offline
Registered User
FRC #1756
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Illinios
Posts: 274
Bpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant future
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 : 03-02-2015 at 14:00.
Reply With Quote
  #15   Spotlight this post!  
Unread 04-02-2015, 15:57
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,091
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Mecanum wheels spinning too fast!

Quote:
Originally Posted by Bpk9p4 View Post
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;

Attached Thumbnails
Click image for larger version

Name:	piecewise_linear.png
Views:	59
Size:	201.0 KB
ID:	18144  
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 02:14.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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