Go to Post what would we do without brandon? - Arefin Bari [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 21-11-2015, 09:55
chubchub5577's Avatar
chubchub5577 chubchub5577 is offline
Registered User
FRC #1802
 
Join Date: Nov 2015
Location: Kansas City, Kansas
Posts: 18
chubchub5577 is an unknown quantity at this point
LabVIEW Noob... Joystick POV hats help!

I have just started programming for my team we have lost our programmer and I have stepped in to learn LabVIEWfor the team and its going well so far. our team (1802) has been getting help from teams like 1986 in Kansas and they are great classes but only got me started. I will post a screen shot of the code if you can help I would be so thankful! This is what the code is trying to do...
1) Arcade Drive (Easy that's the RoboRIO template)
2) Move two independent motors to spin one way and another. On an Xbox controller one motor will use button A and B and the other will use X and Y buttons
3) Use the POV Directional buttons on a joystick to move the two independent motors together at the same time.

I thought what I had would work, I see where I went wrong but I cannot thing of the solution. I was going off what I learned from the LabVIEW Training from the other day. Hope to hear you soon thank you very much hope you can help I am still very new to the language and desperately trying to learn all that I can before the season starts.

Here's the code
http://i.imgur.com/xUw2vmL.png?1

Thanks,
Piper High School Team Stealth 1802
Programmer, Financial Director
  #2   Spotlight this post!  
Unread 21-11-2015, 15:10
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: 619
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 Noob... Joystick POV hats help!

The POV output gives you a number from -1 to 360 based on which direction it is being pressed. No direction is -1, forward is 0, and it increases clockwise, outputting the angle from forwards. If you want to see if the POV is being pressed forward, get the first POV number from the array and check if it equals 0. If you want to see if it is being pushed backwards, check if that same POV number equals 180.
__________________
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)


  #3   Spotlight this post!  
Unread 21-11-2015, 17:07
tr6scott's Avatar
tr6scott tr6scott is offline
Um, I smell Motor!
AKA: Scott McBride
FRC #2137 (TORC)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2005
Location: Oxford, MI
Posts: 520
tr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond repute
Re: LabVIEW Noob... Joystick POV hats help!

If you are going to use... Up to control something, it is advisable to "OR" all of the possible "UP" directions as many POV hats are tough to tell if you are up, or up&left or Up&Right...

This is a vi E2 wrote to turn POV to Boolean, see the or's for the top, left, right, down outputs.
Attached Thumbnails
Click image for larger version

Name:	POV.JPG
Views:	106
Size:	47.7 KB
ID:	19488  
__________________
The sooner we get behind schedule, the more time we have to catch up.

  #4   Spotlight this post!  
Unread 21-11-2015, 18:48
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: LabVIEW Noob... Joystick POV hats help!

Hey my team has been made some Labview programming tutorials that you might find useful. I think the button drive one will answer you questions about how to drive two different motors at the same time. Let me know if you have any question or if you would like a video on something else

Tank drive: https://www.youtube.com/watch?v=ryUYf0enAaI

Button Drive: https://www.youtube.com/watch?v=nU7nKDY83Gs

Arcade Drive: https://www.youtube.com/watch?v=8lnWZHdwfgs
__________________
2016 Tesla Division Finalist
2016 Central Illinois Regional Finalist
2015 Newton Division Finalist
2015 Newton Quality Award
  #5   Spotlight this post!  
Unread 22-11-2015, 09:05
tr6scott's Avatar
tr6scott tr6scott is offline
Um, I smell Motor!
AKA: Scott McBride
FRC #2137 (TORC)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2005
Location: Oxford, MI
Posts: 520
tr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond repute
Re: LabVIEW Noob... Joystick POV hats help!

Sorry, I did not read the whole post or look at the code, now that I have, your mistake is you have multiple motor outputs in multiple loops, so some loops are telling the motor to turn on, some are turning it to turn off, you never know which command is last processed before and updated to the actual hardware.

There is one motor, there needs to be one motor set, then your program needs to control what speed you are telling it to run.

EDIT......

From your description, it sounds like you want to control 4 motors that are not on the driveline, but you RefNums are the same, I also can not see your begin, you need 4 different motor set refnums with unique names.
__________________
The sooner we get behind schedule, the more time we have to catch up.


Last edited by tr6scott : 22-11-2015 at 09:15.
  #6   Spotlight this post!  
Unread 22-11-2015, 17:05
Jonathan L. Jonathan L. is offline
Programmer alumnus, mentor, and CSA
FRC #1094 (Channel Cats)
 
Join Date: Jan 2013
Rookie Year: 2011
Location: St. Louis MO
Posts: 77
Jonathan L. is a jewel in the roughJonathan L. is a jewel in the roughJonathan L. is a jewel in the roughJonathan L. is a jewel in the rough
Re: LabVIEW Noob... Joystick POV hats help!

In the TeleOp VI, it looks like you have both axis 0 and axis 1 setting the X-Axis global for the drive.
Closed Thread


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:19.

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