Go to Post Frisbees [as next year's game piece]. That is all. - Frenchie461 [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 30-01-2017, 16:36
Chieftainator1's Avatar
Chieftainator1 Chieftainator1 is offline
Registered User
AKA: Carson Ausra
FRC #5182 (The Chieftainators)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2016
Location: Dowagiac, MI
Posts: 4
Chieftainator1 is an unknown quantity at this point
LabVIEW POV Help?

Hello ladies and gentlemen , our team wants to control a servo with the hat switch on top of the Logitech Extreme 3D Pro, but we've but attempting to program the hat switch for a week, we can use the servo with buttons, but we are stuck at trying to use the POVs for the hatswitch. any help or idea would be helpful.
Reply With Quote
  #2   Spotlight this post!  
Unread 30-01-2017, 16:53
Ari423's Avatar
Ari423 Ari423 is offline
LabVIEW aficionado and robot addict
AKA: The guy with the yellow hat
FRC #5987 (Galaxia)
Team Role: Mentor
 
Join Date: Mar 2015
Rookie Year: 2012
Location: Haifa, Israel
Posts: 658
Ari423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud of
Re: LabVIEW POV Help?

POVs in LabVIEW have recently been made much simpler. The same way you would get the axes and buttons on a joystick, there should be a third output array on the Joystick Get vi for POVs. The POV you want will be the first (and only) element in the array. If you index the first element of that array, you will end up with a single integer value. IIRC that integer corresponds to the angle that the POV hat is at, with forward being 0* and CW+. Then you can either send that angle value directly to the servo if you have a 360* servo or use some kind of function to map POV inputs to servo angle outputs. Good luck!
__________________
2017-present: Mentor FRC 5987
2017-present: CSA for FIRST in Israel
2012-2016: Member FRC 423
2013: Programmer
2014: Head Programmer, Wiring
2015: Head Programmer, Wiring
2016: Captain, Head Programmer, Wiring, Manipulator, Chassis, CAD, Business, Outreach (basically everything)


Reply With Quote
  #3   Spotlight this post!  
Unread 30-01-2017, 17:19
Chieftainator1's Avatar
Chieftainator1 Chieftainator1 is offline
Registered User
AKA: Carson Ausra
FRC #5182 (The Chieftainators)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2016
Location: Dowagiac, MI
Posts: 4
Chieftainator1 is an unknown quantity at this point
Re: LabVIEW POV Help?

Quote:
Originally Posted by Ari423 View Post
POVs in LabVIEW have recently been made much simpler. The same way you would get the axes and buttons on a joystick, there should be a third output array on the Joystick Get vi for POVs. The POV you want will be the first (and only) element in the array. If you index the first element of that array, you will end up with a single integer value. IIRC that integer corresponds to the angle that the POV hat is at, with forward being 0* and CW+. Then you can either send that angle value directly to the servo if you have a 360* servo or use some kind of function to map POV inputs to servo angle outputs. Good luck!
Can you show us an example by chance? we still are having trouble, after reading your reply, Thanks!
Reply With Quote
  #4   Spotlight this post!  
Unread 30-01-2017, 17:42
Ari423's Avatar
Ari423 Ari423 is offline
LabVIEW aficionado and robot addict
AKA: The guy with the yellow hat
FRC #5987 (Galaxia)
Team Role: Mentor
 
Join Date: Mar 2015
Rookie Year: 2012
Location: Haifa, Israel
Posts: 658
Ari423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud of
Re: LabVIEW POV Help?

Quote:
Originally Posted by Chieftainator1 View Post
Can you show us an example by chance? we still are having trouble, after reading your reply, Thanks!
My LabVIEW expired and I'm too lazy to put in the new activation code. Attached is a bad MS Paint drawing of what I think it looks like from memory.
Attached Thumbnails
Click image for larger version

Name:	POV.jpg
Views:	33
Size:	44.1 KB
ID:	21659  
__________________
2017-present: Mentor FRC 5987
2017-present: CSA for FIRST in Israel
2012-2016: Member FRC 423
2013: Programmer
2014: Head Programmer, Wiring
2015: Head Programmer, Wiring
2016: Captain, Head Programmer, Wiring, Manipulator, Chassis, CAD, Business, Outreach (basically everything)


Reply With Quote
  #5   Spotlight this post!  
Unread 30-01-2017, 18:32
flemdogmillion's Avatar
flemdogmillion flemdogmillion is online now
Programmer, Builder, Driver...
FRC #3007
 
Join Date: Nov 2016
Rookie Year: 2015
Location: Minnesota
Posts: 125
flemdogmillion will become famous soon enoughflemdogmillion will become famous soon enough
Re: LabVIEW POV Help?

Here, this diagram should be very helpful.
Attached Thumbnails
Click image for larger version

Name:	POVServoExample.PNG
Views:	40
Size:	17.2 KB
ID:	21660  
__________________
Team 4506: 2015-2016
Team 3007: 2017

Jack of all trades except C++ & Java
Reply With Quote
  #6   Spotlight this post!  
Unread 01-02-2017, 17:14
Chieftainator1's Avatar
Chieftainator1 Chieftainator1 is offline
Registered User
AKA: Carson Ausra
FRC #5182 (The Chieftainators)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2016
Location: Dowagiac, MI
Posts: 4
Chieftainator1 is an unknown quantity at this point
Re: LabVIEW POV Help?

Quote:
Originally Posted by flemdogmillion View Post
Here, this diagram should be very helpful.
Ok, I've tried this out with no luck, is there something I'm likely missing? I don't know how to copy my code into Chief Delphi to show you.
Reply With Quote
  #7   Spotlight this post!  
Unread 01-02-2017, 17:24
Ari423's Avatar
Ari423 Ari423 is offline
LabVIEW aficionado and robot addict
AKA: The guy with the yellow hat
FRC #5987 (Galaxia)
Team Role: Mentor
 
Join Date: Mar 2015
Rookie Year: 2012
Location: Haifa, Israel
Posts: 658
Ari423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud of
Re: LabVIEW POV Help?

Quote:
Originally Posted by Chieftainator1 View Post
Ok, I've tried this out with no luck, is there something I'm likely missing? I don't know how to copy my code into Chief Delphi to show you.
You can either select the code you want and in one of the menus there's an option like "Make PNG from selection" or you can just take a screen grab with any screen grabbing program.
__________________
2017-present: Mentor FRC 5987
2017-present: CSA for FIRST in Israel
2012-2016: Member FRC 423
2013: Programmer
2014: Head Programmer, Wiring
2015: Head Programmer, Wiring
2016: Captain, Head Programmer, Wiring, Manipulator, Chassis, CAD, Business, Outreach (basically everything)


Reply With Quote
  #8   Spotlight this post!  
Unread 03-02-2017, 15:28
Chieftainator1's Avatar
Chieftainator1 Chieftainator1 is offline
Registered User
AKA: Carson Ausra
FRC #5182 (The Chieftainators)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2016
Location: Dowagiac, MI
Posts: 4
Chieftainator1 is an unknown quantity at this point
Re: LabVIEW POV Help?

Ok, we figured out my problem and got the code to work, although it goes back to the starting position when we let go of the hat switch, any ideas on how to make it stay in the same spot? thanks
Reply With Quote
  #9   Spotlight this post!  
Unread 03-02-2017, 16:53
llung llung is offline
Registered User
FRC #4048
 
Join Date: Jan 2013
Location: Westborough, MA
Posts: 13
llung is an unknown quantity at this point
Re: LabVIEW POV Help?

Quote:
Originally Posted by Chieftainator1 View Post
Ok, we figured out my problem and got the code to work, although it goes back to the starting position when we let go of the hat switch, any ideas on how to make it stay in the same spot? thanks
How many places in your code do you set the value to the servo?
Presumably you set some value to the servo when the hat switch is depressed. i would look in the code for any other place where that servo is set and see how your code can reach that location (presumably by way of teleop.vi)
Reply With Quote
  #10   Spotlight this post!  
Unread 03-02-2017, 19:04
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,906
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: LabVIEW POV Help?

Quote:
Originally Posted by Chieftainator1 View Post
Ok, we figured out my problem and got the code to work, although it goes back to the starting position when we let go of the hat switch, any ideas on how to make it stay in the same spot? thanks
You probably need to incorporate a feedback node to remember the last value set.
Just how you do that depends on what your code looks like.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #11   Spotlight this post!  
Unread 04-02-2017, 08:59
Ari423's Avatar
Ari423 Ari423 is offline
LabVIEW aficionado and robot addict
AKA: The guy with the yellow hat
FRC #5987 (Galaxia)
Team Role: Mentor
 
Join Date: Mar 2015
Rookie Year: 2012
Location: Haifa, Israel
Posts: 658
Ari423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud of
Re: LabVIEW POV Help?

Quote:
Originally Posted by Chieftainator1 View Post
Ok, we figured out my problem and got the code to work, although it goes back to the starting position when we let go of the hat switch, any ideas on how to make it stay in the same spot? thanks
Another option is to put the servo.set command in a conditional statement and then only set it if the POV value is not -1. Then when the POV value is -1 the servo won't get set to a new value and it will keep its last value.
__________________
2017-present: Mentor FRC 5987
2017-present: CSA for FIRST in Israel
2012-2016: Member FRC 423
2013: Programmer
2014: Head Programmer, Wiring
2015: Head Programmer, Wiring
2016: Captain, Head Programmer, Wiring, Manipulator, Chassis, CAD, Business, Outreach (basically everything)


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 10:52.

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