Go to Post It will mean far more than you can imagine...and really, you can't lose. - David Kelso [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-2012, 22:21
JM96PWNS's Avatar
JM96PWNS JM96PWNS is offline
Registered User
FRC #0240
 
Join Date: Feb 2012
Rookie Year: 2009
Location: United States
Posts: 15
JM96PWNS has a little shameless behaviour in the past
Help with Lazy Susan Shooter on Joystick

Hey guys, I'm fairly new to programming. What I want as represented with my code is to trigger the joystick on the x-axis, and somehow connect it to the "set output" box so I can manually change the direction of the shooter in correlation with the limit switches. So when the shooter hits limit switch left or right, it turns off, which is set to "0" on the inside true case. So how do I do that? I've tried an "or" function but my motors don't just seems to work. Any ideas? thanks.

-ps its a Lazy Susan with Window Motors..
Attached Thumbnails
Click image for larger version

Name:	Lazy susan shooter.png
Views:	32
Size:	13.6 KB
ID:	11716  
Reply With Quote
  #2   Spotlight this post!  
Unread 04-02-2012, 23:14
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: Help with Lazy Susan Shooter on Joystick

A thread last year included an elegant bit of LabVIEW code for handling limit switches.
Reply With Quote
  #3   Spotlight this post!  
Unread 04-02-2012, 23:25
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 432
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Re: Help with Lazy Susan Shooter on Joystick

You've got the right idea.

I'm not familiar with your hardware setup, but something like the following could probably get the job done.
Click image for larger version

Name:	labview.png
Views:	19
Size:	20.8 KB
ID:	11720

The Set Output VIs (boxed in red) need to be supplied with a speed. Right click on the input node and click create constant (or something to that effect - its been a while since I've used labview). This will make an input variable which you can hard code to a value from 1.0 to -1.0. Start with a low value 0.2 to -0.2 and see how fast that makes the motors rotate. Also, before you fully implement this, be sure to verify you're turning in the correct direction (toward the limit switch that should stop drive motion). If you go in the wrong direction you'll keep going and stall the drive which could cause damage depending on your setup.

Inside the nested false block make sure you have a Set Output VI which stops the motor. Same for the case where the joystick inputs are within .1 to -.1, motor should be stopped by sending the Set Output VI "0.0"

Note: I don't know if the "Shooter Limit Right" and" Shooter Limit Left" variables are in the correct box (may need to be switched depending on how your joystick makes the motors turn).

Goodluck, you're on the right path.
__________________
http://team2168.org
Reply With Quote
  #4   Spotlight this post!  
Unread 04-02-2012, 23:45
JM96PWNS's Avatar
JM96PWNS JM96PWNS is offline
Registered User
FRC #0240
 
Join Date: Feb 2012
Rookie Year: 2009
Location: United States
Posts: 15
JM96PWNS has a little shameless behaviour in the past
Re: Help with Lazy Susan Shooter on Joystick

Right, but hard wiring the "shooter rotation" from a number from 1.0 to -1.0 just doesn't seem right. its not something like an elevator motor,(which would just be to turn on and off). It just goes LEFT and RIGHT, so if i set it to "1" it would just turn and hit the limit switch. I actually want to control the direction of the shooter via joystick values. Imagine Logomotion, and I was controlling an arm(up and down) with a joystick, its like that only left and right. Any inputs? thanks though, cleared up the limit switches!
Reply With Quote
  #5   Spotlight this post!  
Unread 05-02-2012, 01:06
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 432
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Re: Help with Lazy Susan Shooter on Joystick

Click image for larger version

Name:	labview.png
Views:	21
Size:	13.5 KB
ID:	11723

This is probably more along the lines of what you were looking for.

Obviously this isn't tested, but I think it will work.

Code in words: Command the motor to the value found on Axis 1 (direction & magnitude) if either of the following conditions are met:
  • Commanded to the right and the right switch isn't pressed
  • Commanded to the left and the left switch isn't pressed

Again, I don't know which switches correlate to which directions on your stick, so the code may not work perfectly, TEST TEST TEST
__________________
http://team2168.org
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:26.

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