Go to Post Doesn't make sense, Karthik. ...... You don't scare me, other than the way 1114 normally does. - EricH [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 09-02-2013, 11:46
gamegeek1995 gamegeek1995 is offline
Registered User
FRC #4701
 
Join Date: Jan 2013
Location: Savannah, GA
Posts: 19
gamegeek1995 is an unknown quantity at this point
Unhappy Shooter Programming Help

I am currently trying to program our shooter using 1 Cim motor and 1 window motor. I am trying to set the Cim motor to be on just the Joysticks y axis and the window motor to the trigger on the joystick.

I have come up with setting up each as an individual motor and assigning them to different sections of the joystick.

I have, however, reached an impass as i am unsure of how to inizialize motors in the Begin.vi and how to use the buttons themselves to spin the motors.

If any one has any insight it would be appreciated.
Reply With Quote
  #2   Spotlight this post!  
Unread 09-02-2013, 11:56
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: Shooter Programming Help

The CIM motor and joystick both have a -1 to 1 range. You may need to flip the direction by multiplying by -1, or scale it by multiplying by a number less than 1.

For the button based motor control, determine exactly how you'd like the buttons and motor to behave. I suspect you'll find other questions with attached images that do something very similar.

In Begin, you typically Open the motor and provide it with the PWM channel number. You then store the value giving it a useful name. That allows you to access it in other parts of the program using the same name.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 09-02-2013, 12:43
bvisness's Avatar
bvisness bvisness is offline
Programming Mentor, Former Driver
FRC #2175 (The Fighting Calculators)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Woodbury, MN
Posts: 181
bvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of light
Re: Shooter Programming Help

To elaborate on what Greg said, I've attached a screenshot of how to initialize a motor in Begin.vi.
Attached Thumbnails
Click image for larger version

Name:	Capture.PNG
Views:	55
Size:	3.2 KB
ID:	13874  
Reply With Quote
  #4   Spotlight this post!  
Unread 10-02-2013, 03:06
propionate's Avatar
propionate propionate is offline
Team co-lead and LabVIEW programmer
AKA: Stephen
FRC #1732 (Hilltopper Robotics)
 
Join Date: Jan 2012
Rookie Year: 2009
Location: Milwaukee
Posts: 93
propionate is on a distinguished road
Re: Shooter Programming Help

To build on the reply above me, I have attached very basic code for having the joystick trigger control a motor.
Attached Thumbnails
Click image for larger version

Name:	Capture.PNG
Views:	72
Size:	14.2 KB
ID:	13913  
Reply With Quote
  #5   Spotlight this post!  
Unread 12-02-2013, 15:22
gamegeek1995 gamegeek1995 is offline
Registered User
FRC #4701
 
Join Date: Jan 2013
Location: Savannah, GA
Posts: 19
gamegeek1995 is an unknown quantity at this point
Re: Shooter Programming Help

Quote:
Originally Posted by propionate View Post
To build on the reply above me, I have attached very basic code for having the joystick trigger control a motor.
i am sorr that i forgot to mention that our robot is configured to be in arcade drive mode and that the shooting motor and our indexer window motor are on the second joystick if you think this changes anything
Reply With Quote
  #6   Spotlight this post!  
Unread 12-02-2013, 18:20
propionate's Avatar
propionate propionate is offline
Team co-lead and LabVIEW programmer
AKA: Stephen
FRC #1732 (Hilltopper Robotics)
 
Join Date: Jan 2012
Rookie Year: 2009
Location: Milwaukee
Posts: 93
propionate is on a distinguished road
Re: Shooter Programming Help

Quote:
Originally Posted by gamegeek1995 View Post
i am sorr that i forgot to mention that our robot is configured to be in arcade drive mode and that the shooting motor and our indexer window motor are on the second joystick if you think this changes anything


That is fine. Just adjust the example I linked to accordingly.
Reply With Quote
  #7   Spotlight this post!  
Unread 14-02-2013, 15:36
gamegeek1995 gamegeek1995 is offline
Registered User
FRC #4701
 
Join Date: Jan 2013
Location: Savannah, GA
Posts: 19
gamegeek1995 is an unknown quantity at this point
Re: Shooter Programming Help

What should i connect the Motor set outputs too???
Reply With Quote
  #8   Spotlight this post!  
Unread 14-02-2013, 15:41
gamegeek1995 gamegeek1995 is offline
Registered User
FRC #4701
 
Join Date: Jan 2013
Location: Savannah, GA
Posts: 19
gamegeek1995 is an unknown quantity at this point
Re: Shooter Programming Help

Quote:
Originally Posted by propionate View Post
That is fine. Just adjust the example I linked to accordingly.
How should the out puts be set up because i ran the program but nothing seemed to work
Reply With Quote
  #9   Spotlight this post!  
Unread 14-02-2013, 17:50
propionate's Avatar
propionate propionate is offline
Team co-lead and LabVIEW programmer
AKA: Stephen
FRC #1732 (Hilltopper Robotics)
 
Join Date: Jan 2012
Rookie Year: 2009
Location: Milwaukee
Posts: 93
propionate is on a distinguished road
Re: Shooter Programming Help

Quote:
Originally Posted by gamegeek1995 View Post
How should the out puts be set up because i ran the program but nothing seemed to work
I apologize, I am not sure what you mean by this. The code I linked to should work fine without any changes. First make sure that you are setting and calling the same Refnum in both the Begin and Teleop VI's (the string constant wired to the upper left node in your motor and joystick VI's). If these are all correct, it is hard to diagnose any problems without further details. Could you upload a copy of your Teleop and Begin VI's?
Reply With Quote
  #10   Spotlight this post!  
Unread 16-02-2013, 10:23
gamegeek1995 gamegeek1995 is offline
Registered User
FRC #4701
 
Join Date: Jan 2013
Location: Savannah, GA
Posts: 19
gamegeek1995 is an unknown quantity at this point
Re: Shooter Programming Help

Quote:
Originally Posted by propionate View Post
I apologize, I am not sure what you mean by this. The code I linked to should work fine without any changes. First make sure that you are setting and calling the same Refnum in both the Begin and Teleop VI's (the string constant wired to the upper left node in your motor and joystick VI's). If these are all correct, it is hard to diagnose any problems without further details. Could you upload a copy of your Teleop and Begin VI's?
Her are our begin vi and tele op vi
Attached Thumbnails
Click image for larger version

Name:	Begin vi.jpg
Views:	22
Size:	124.5 KB
ID:	14035  Click image for larger version

Name:	Teleop Program.jpg
Views:	29
Size:	158.6 KB
ID:	14036  
Reply With Quote
  #11   Spotlight this post!  
Unread 17-02-2013, 00:38
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: Shooter Programming Help

Quote:
Originally Posted by gamegeek1995 View Post
Her are our begin vi and tele op vi
I don't see anything obviously wrong with what you're showing us. What does it do when you run it? What do you want it to do instead?
Reply With Quote
  #12   Spotlight this post!  
Unread 18-02-2013, 09:23
gamegeek1995 gamegeek1995 is offline
Registered User
FRC #4701
 
Join Date: Jan 2013
Location: Savannah, GA
Posts: 19
gamegeek1995 is an unknown quantity at this point
Re: Shooter Programming Help

Quote:
Originally Posted by Alan Anderson View Post
I don't see anything obviously wrong with what you're showing us. What does it do when you run it? What do you want it to do instead?
When the above code was put on the robot it just sort of lurched and then did nothing after that

We went back and loaded a fresh driver code with no modifications on it to check to see if maybe something happened to the robot but it worked fine with the unmoddified program
Reply With Quote
  #13   Spotlight this post!  
Unread 18-02-2013, 10:59
bleem313's Avatar
bleem313 bleem313 is offline
Registered User
AKA: Sean
FRC #2106 (The Junkyard Dogs)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Goochland
Posts: 5
bleem313 is an unknown quantity at this point
Re: Shooter Programming Help

I'm having the same sort of problem on our robot. When using JUST the default code for mechanum, everything works fine, but the moment I try to add initializing and running another motor to the code, all the motors stop working, and get blinking lights, as if they are receiving no input signal.

Just initializing the two Shooter motors in Begin causes the problem.

Here are screenshots to help
__________________
Reply With Quote
  #14   Spotlight this post!  
Unread 18-02-2013, 12:12
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: Shooter Programming Help

Quote:
Originally Posted by gamegeek1995 View Post
When the above code was put on the robot it just sort of lurched and then did nothing after that
Quote:
Originally Posted by bleem313 View Post
I'm having the same sort of problem on our robot. When using JUST the default code for mechanum, everything works fine, but the moment I try to add initializing and running another motor to the code, all the motors stop working, and get blinking lights, as if they are receiving no input signal.
Clues!

Things work when you only have a few motors defined, but then when you add more motors the problem appears. This is a clear indication that the Digital Sidecar is not receiving 12 volt power from the Power Distribution Board. Check the LED labeled "BAT" on the Digital Sidecar and make sure it's lit (the 6V and 5V LEDs should be lit as well).
Reply With Quote
  #15   Spotlight this post!  
Unread 18-02-2013, 12:19
bleem313's Avatar
bleem313 bleem313 is offline
Registered User
AKA: Sean
FRC #2106 (The Junkyard Dogs)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Goochland
Posts: 5
bleem313 is an unknown quantity at this point
Re: Shooter Programming Help

Quote:
Originally Posted by Alan Anderson View Post
Clues!

Things work when you only have a few motors defined, but then when you add more motors the problem appears. This is a clear indication that the Digital Sidecar is not receiving 12 volt power from the Power Distribution Board. Check the LED labeled "BAT" on the Digital Sidecar and make sure it's lit (the 6V and 5V LEDs should be lit as well).
I have done this. All 3 lights are lit. When I get back to the robot, I will replace the digital sidecar and the module to see if that changes anything.
__________________
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