Go to Post Maybe it just seemed like five hours...I had freshmen in my vehicle! - Qbot2640 [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 Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 12-02-2010, 13:15
j.cole j.cole is offline
Registered User
FRC #0379
 
Join Date: Jan 2010
Location: Girard
Posts: 159
j.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud of
Deadzone(ish) Problem

Our joysticks are overly responsive and we need to cut down the responsiveness
I have a picture but I cant attach it here's an example
(if input is ± 22.5 from 180 set to 180
if input is ± 22.5 from -135 set to -135)
Specs.
Drive system - Holonomic
Controller - Logitech Dual action
__________________

It's not normally a good idea to give a programmer a drill but rules are made to be broken.
Reply With Quote
  #2   Spotlight this post!  
Unread 12-02-2010, 14:29
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: Deadzone(ish) Problem

I don't understand how the numbers you gave relate to joysticks, but no matter.


If you want to take an input value and test to see whether it is between two other values, use the In Range and Coerce function.

If you want to take a value and force it to a constant only when some condition is true, a common way is to use a case block. In the "false" case, wire the value straight through the block from input to output. In the "true" case, place a constant and wire it to the output of the block, leaving the input unattached.

That should give you enough information to get started.
Reply With Quote
  #3   Spotlight this post!  
Unread 12-02-2010, 23:41
j.cole j.cole is offline
Registered User
FRC #0379
 
Join Date: Jan 2010
Location: Girard
Posts: 159
j.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud of
Re: Deadzone(ish) Problem

I bypassed all that by using a formula case although im not sure if it will work because i put a ± in it and i don't know if LabView will recognize it
__________________

It's not normally a good idea to give a programmer a drill but rules are made to be broken.
Reply With Quote
  #4   Spotlight this post!  
Unread 13-02-2010, 04:30
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Deadzone(ish) Problem

If the run arrow is broken, clicking it will tell you why. I don't believe the formula node understands +/- or ± or any similar syntax. You probably want to look at using absolute value icon or abs() within the formula.

Greg McKaskle
Reply With Quote
  #5   Spotlight this post!  
Unread 13-02-2010, 12:36
j.cole j.cole is offline
Registered User
FRC #0379
 
Join Date: Jan 2010
Location: Girard
Posts: 159
j.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud of
Re: Deadzone(ish) Problem

we got it to work with a formula node with the following formula

if (x>=167.5 && x<=202.5) y=180;
else if (x>=-157.5 && x<=-112.5) y=-135;
else if (x>=-112.6 && x<=-67.5) y=-90;
else if (x>=-67.6 && x<=-22.5) y=-45;
else if (x>=-22.6 && x<=22.5) y=0;
else if (x>=22.6 && x<=67.5) y=45;
else if (x>=67.6 && x<=112.5) y=90;
else if (x>=112.6 && x<=157.5) y=135;
else (y=180);
__________________

It's not normally a good idea to give a programmer a drill but rules are made to be broken.
Reply With Quote
  #6   Spotlight this post!  
Unread 13-02-2010, 13:30
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Deadzone(ish) Problem

If that is truly what you want, you may want to adjust your code a bit more. Try values such as 22.55 and see what you get.

If you want to output a more coarse joystick value like that, an equivalent approach with much less code is to take the angle, divide by 45, round to nearest integer, then multiply by 45. Finally, if you really can have values above 180, you can use In Range and Coerce to pin the big values back to the limits.

Greg McKaskle
Reply With Quote
  #7   Spotlight this post!  
Unread 13-02-2010, 13:57
Luke Pike's Avatar
Luke Pike Luke Pike is offline
Programmer
FRC #1501 (THRUST)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Huntington
Posts: 114
Luke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to all
Re: Deadzone(ish) Problem

If you want to tone down the responsiveness, try creating a function to map joystick values to something else. An easy one is simply squaring the joystick value, i.e. x^2 or x*x.

If you want to just limit the range, use "In Range and Coerce" like Greg suggested.
__________________
Twitter Profile
Reply With Quote
  #8   Spotlight this post!  
Unread 14-02-2010, 11:09
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Re: Deadzone(ish) Problem

It sounds like you want a stepped function, with every step 45 degrees wide.
Why not divide by 45, round towards nearest, and then multiply back up?
(Unless, of course, you require this code to be in the formula node. I don't know how to round within the formula node)
__________________
-- Marshal Horn
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
URGENT(ish): Twitchy motors csshih Electrical 20 22-02-2011 14:27
Cleveland-ish Teams? synth3tk General Forum 3 25-08-2008 01:14
2200 - Done (ish) Bochek Robot Showcase 5 16-02-2008 21:52
Speed Ramping with Deadzone Dan894 Programming 11 20-01-2006 14:04
A plug-ish question Ydnar 3D Animation and Competition 1 25-01-2002 01:22


All times are GMT -5. The time now is 22:38.

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