Go to Post I guess Team 999 was like "Chute first, ask questions later". - KPSch [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 04-02-2013, 11:27
Carl Carl is offline
Carl
FRC #4717 (The Outlaws)
Team Role: Programmer
 
Join Date: Feb 2013
Rookie Year: 2013
Location: Lubbock
Posts: 4
Carl is an unknown quantity at this point
labVIEW joystick connection issues

Hello I am the programmer for team 4717. This is our first year first in the competition and we are having trouble getting our code to work properly in our robot, we have isolated the problem to our labVIEW code. We can get one one joystick to connect to the robot at a time even if two joysticks register on the dashboard only one will operate. Any sort of help will be very appreciated.
Reply With Quote
  #2   Spotlight this post!  
Unread 04-02-2013, 11:32
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
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,833
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 joystick connection issues

How did you update your code to handle the second joystick?
The default Arcade code comes assuming a single joystick.
If you added a second joystick, what does your code do with it?
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #3   Spotlight this post!  
Unread 04-02-2013, 14:25
Carl Carl is offline
Carl
FRC #4717 (The Outlaws)
Team Role: Programmer
 
Join Date: Feb 2013
Rookie Year: 2013
Location: Lubbock
Posts: 4
Carl is an unknown quantity at this point
Re: labVIEW joystick connection issues

The existing code only runs 1 motor controller. We can't get the other controller to respond no matter where it is plugged in. We know it works because we changed the second controller to the slot where the first has been working and all is golden.

So....

We duplicated all the joystick code in teleop.vi and went in and changed it to USB2 (where the second joystick is attached), and duplicated all the linked modules, adjusting them where we could find to adjust them to try and control the other side. Now, the dashboard thinks it has 2 joysticks, but just 1 of them is making any feedback on the readouts. The Driver Station recognized we have both joysticks attached, but LabView isn't the most intuitive at digging through pre-existing code.
Reply With Quote
  #4   Spotlight this post!  
Unread 04-02-2013, 14:43
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: labVIEW joystick connection issues

Quote:
Originally Posted by Carl View Post
The existing code only runs 1 motor controller. We can't get the other controller to respond no matter where it is plugged in. We know it works because we changed the second controller to the slot where the first has been working and all is golden.
What did you change in the code to run a second motor?

Quote:
We duplicated all the joystick code in teleop.vi and went in and changed it to USB2 (where the second joystick is attached),
That's exactly half of what you need to do. The other half is to give the RefNum for the second joystick a unique name like "Joystick 2", where the first one is "Joystick 1".

Quote:
and duplicated all the linked modules, adjusting them where we could find to adjust them to try and control the other side.
What does "duplicated all the linked modules" mean?

Quote:
Now, the dashboard thinks it has 2 joysticks, but just 1 of them is making any feedback on the readouts. The Driver Station recognized we have both joysticks attached, but LabView isn't the most intuitive at digging through pre-existing code.
There's a section in the code which sends the joystick values to the Dashboard. You should duplicate that for the second joystick, changing the obvious "1" in the string constant for the SmartDashboard name to "2".
Reply With Quote
  #5   Spotlight this post!  
Unread 04-02-2013, 14:54
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
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,833
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 joystick connection issues

So you have two distinct problems.
Although your question is about the second problem, I don't expect your recoding of the Joystick to do you much good until you've resolved the first issue of the unresponsive motor controller.

From your testing of the motor controller in the PWM port that works, it sounds like the motor controllers are fine and the PWM cables are plugged into them properly.

Which PWM port works?
When the non-working PWM port is connected, what is the motor controller status light doing?
Are the three green power lights on the Digital Sidecar all brightly lit?


For the addition of the Joystick you might want to post your Begin.vi and Teleop.vi, so we can see if anything's not hooked up right. But the PWM port won't suddenly start working because a new joystick was added.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #6   Spotlight this post!  
Unread 04-02-2013, 16:36
LHSMrBlack LHSMrBlack is offline
Registered User
AKA: Sam Black
FRC #4717 (The Outlaws)
Team Role: Teacher
 
Join Date: Feb 2013
Rookie Year: 2006
Location: Lubbock, TX
Posts: 4
LHSMrBlack is an unknown quantity at this point
Re: labVIEW joystick connection issues

Ok, I'm Carl's teacher/coach/programming-overseer/whatever. Maybe I can clarify a little what we've tried.

When we did the whole "select all"/copy/paste in regards to the joystick/motor blocks of code, we changed all the names of one set to "Joystick 2" and ".... Motor 2..." and all. The vi's that are part of the section were opened and saved with "2" in the name.

I just found the "Tank Drive" block. (Yeah, yeah, LabView isn't high on my list of favorite programming environments but Eclipse won't deploy to the cRio so we are going with LV at the moment). I tried plugging it in place of the Arcade Drive block. That was an interesting change of effects -- now, I get nothing when I push the one working stick forward or backward, but it pulses now when we push it in any other direction.

I'd like to get this driving for a show-and-tell tonight, but I'm about to pull what hair I have out over this.

We are plugged into PWM2 which is actually sending working signals to the motor controller. PWM1 and PWM3 .....not so much. Tell me what pics you want to see and we will take them.
Reply With Quote
  #7   Spotlight this post!  
Unread 04-02-2013, 19:37
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
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,833
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 joystick connection issues

I'd like to see a photo of the Digital Sidecar with power on, showing the wiring and status lights.

It's easiest to create a new default Arcade robot project, build and download that until the wiring problem gets sorted out.

If you want to zip up your current robot project and attach it to a post here, we'll take a look and see what's not working in there.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #8   Spotlight this post!  
Unread 04-02-2013, 22:22
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: labVIEW joystick connection issues

Quote:
Originally Posted by LHSMrBlack View Post
The vi's that are part of the section were opened and saved with "2" in the name.
Are you saying that you created new VIs named "WPI_JoystickOpen2.vi" and "WPI_JoystickRefNum Registry Set 2.vi"? That would certainly keep things from working as designed.

I agree with Mark's advice. Create a fresh Arcade project and get it to control your robot so you can verify things are properly wired. Then we can help you make changes and additions to control other robot functions.
Reply With Quote
  #9   Spotlight this post!  
Unread 05-02-2013, 07:13
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: labVIEW joystick connection issues

You may also want to try using Test Mode.

With the code running, change the driver station into test mode and on the dashboard click to the Test tab. It will show you the joysticks and motors that have been opened. If you enable the robot on the DS, you can now see the values of the joysticks in the table. See if they change when moved. You can also select the Value of a motor, set the slider to a value and Enable the motor to see if it works using this code. If it doesn't work in test mode, it is either because it wasn't opened properly in Begin, or more likely due to an electrical issue.

Greg McKaskle
Reply With Quote
  #10   Spotlight this post!  
Unread 05-02-2013, 12:26
LHSMrBlack LHSMrBlack is offline
Registered User
AKA: Sam Black
FRC #4717 (The Outlaws)
Team Role: Teacher
 
Join Date: Feb 2013
Rookie Year: 2006
Location: Lubbock, TX
Posts: 4
LHSMrBlack is an unknown quantity at this point
Re: labVIEW joystick connection issues

We have restarted, again, with an entirely fresh project.

The only modifications we have done to it is, in Begin.vi, change from the Jaguar controller (in the drop-down) to Victor (which is what we have). We have verified that the ports the controllers are plugged into are the ports listed there, as well.

Still, only 1 side is working.
Attached Thumbnails
Click image for larger version

Name:	CIMG0212.JPG
Views:	17
Size:	1.59 MB
ID:	13810  
Attached Files
File Type: zip Final Hope 2013 Robot Project.zip (3.47 MB, 5 views)
Reply With Quote
  #11   Spotlight this post!  
Unread 05-02-2013, 12:53
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Re: labVIEW joystick connection issues

Just a side note - The two white wires in the end of your Power Distribution Board are illegal and will not pass inspection. Wrapping each end of the wire in red electrical tape will not suffice - the entirety of the wire's insulation must be red.
Reply With Quote
  #12   Spotlight this post!  
Unread 05-02-2013, 13:02
LHSMrBlack LHSMrBlack is offline
Registered User
AKA: Sam Black
FRC #4717 (The Outlaws)
Team Role: Teacher
 
Join Date: Feb 2013
Rookie Year: 2006
Location: Lubbock, TX
Posts: 4
LHSMrBlack is an unknown quantity at this point
Re: labVIEW joystick connection issues

Quote:
Originally Posted by DominickC View Post
Just a side note - The two white wires in the end of your Power Distribution Board are illegal and will not pass inspection. Wrapping each end of the wire in red electrical tape will not suffice - the entirety of the wire's insulation must be red.
Thanks, we will take care of that in the next hour and I'll talk to my electrician mentor to ensure no more white wire is used.
Reply With Quote
  #13   Spotlight this post!  
Unread 05-02-2013, 13:05
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,579
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: labVIEW joystick connection issues

Quote:
Originally Posted by DominickC View Post
Just a side note - The two white wires in the end of your Power Distribution Board are illegal and will not pass inspection. Wrapping each end of the wire in red electrical tape will not suffice - the entirety of the wire's insulation must be red.
White is a legal color for positive voltage. See R50A.
Reply With Quote
  #14   Spotlight this post!  
Unread 05-02-2013, 13:12
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
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,833
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 joystick connection issues

Quote:
Originally Posted by LHSMrBlack View Post
Still, only 1 side is working.
That actually helps narrow the problem down a bit.
It isn't the code if you're using the default arcade project, so it's the wiring.

The Sidecar looks clean and the connections proper.
Power is good.

One candidate is a bad or reversed crimp on the 37-pin ribbon cable. Especially since they had to be hand-made, those have a high potential for wiring issues.
You can use a multi-meter to test that each pin connects through to the other end.
When you take the cable and plug it into itself, does it form a simple loop (correct) or does it form a mobius strip (reversed)?

I assume that if the PWM connections at the Sidecar are swapped, that the corresponding inoperable Victor then starts operating normally?
And PWM 2 is still the port that works and PWM 1 is the port that doesn't work?
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 05-02-2013 at 13:17.
Reply With Quote
  #15   Spotlight this post!  
Unread 05-02-2013, 13:40
LHSMrBlack LHSMrBlack is offline
Registered User
AKA: Sam Black
FRC #4717 (The Outlaws)
Team Role: Teacher
 
Join Date: Feb 2013
Rookie Year: 2006
Location: Lubbock, TX
Posts: 4
LHSMrBlack is an unknown quantity at this point
Re: labVIEW joystick connection issues

The 37-pin cable forms a simple loop. We will run it through the multi-meter later this afternoon just to be absolutely sure all is 100% with it.

Yes, if we swap the PWM connectors, the other Victor functions.

However, it's PWM 1, not 2, that's working
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 22:50.

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