Go to Post Trust me. I am a Clock after all. ;) - Elgin Clock [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 10-02-2009, 20:19
popnbrown's Avatar
popnbrown popnbrown is offline
FIRST 5125 HOTH Lead Mentor
AKA: Sravan S
FRC #5125 (Hawks on the Horizon)
Team Role: Mentor
 
Join Date: Feb 2007
Rookie Year: 2007
Location: Illinois
Posts: 367
popnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond repute
Limit Switches

Hey guys,

We're trying to get limit switches working, where if the limit switch is hit, the motor can only turn in the other direction or sit dead, and if the pilot tries to turn the motor in the direction of the limit switch, the motor would just stop.

I have attached the vi for the code and have attached a picture of where the code gets an error. The error occurs in the second Case structure where the limiting values are from 0, 1. The problem is that when the Joystick has a value not within the 0-1 range (somewhere from -1 to 0) it does not turn in the other direction or stop, it keeps jerking and turning in the negative direction.

Just some other information, we're using a Victor wired to PWM 3 on Digital Sidecar at Slot 4, and are using the USB 3 Joystick port to control the motor, which is a CIM. The limit switches are in Digital I/O ports 9 & 10.

I looked at all the different points to see if the values were what I programmed them to be, and it seemed as though they were, which leads me to believe that it's a hardware problem.

Has anyone had a similar problem or knows how to fix the problem?

Really appreciate your help.

Thank you,
Sravan
Attached Thumbnails
Click image for larger version

Name:	limit.JPG
Views:	174
Size:	134.8 KB
ID:	7392  
__________________
I am an employee of FIRST. However, the postings on this site are of my own perspective as a FIRST mentor and volunteer and do not necessarily reflect the views of FIRST.

FIRST Team 5125 Hawks on the Horizon Lead Mentor
FRC Team 4096 Ctrl-Z Former Mentor
FTC Team 5203 #19@! Former Mentor
FRC Team 1403 Cougar Robotics Alumni
Reply With Quote
  #2   Spotlight this post!  
Unread 10-02-2009, 22:39
Luke Pike's Avatar
Luke Pike Luke Pike is offline
Programmer
FRC #1501 (THRUST)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Huntington
Posts: 114
Luke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to all
Re: Limit Switches

I can't see the other cases, so I can't really debug your code. So instead, I wrote an example that should work. It's set up with it's own while loop, so you can add it anywhere outside the Basic Robot Main vi. Feel free to put parts of it somewhere else, or incorporate it with your RobotData.

It's basically a state machine. In the first state you can move the motor both left and right until you hit a limit switch. Then you're limited to going the other direction or stopping if you go the other way. Once you hit the other limit switch, it's vice versa.

I hope this helps you. Check out the lvmastery video on State Machines. I found it to be very helpful. Good luck!
Attached Files
File Type: vi limit switch state machine.vi (57.7 KB, 119 views)
__________________
Twitter Profile

Last edited by Luke Pike : 11-02-2009 at 11:46. Reason: Forgot the 's on it
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Limit switches(in C++) beefy1 Programming 3 24-12-2008 15:27
Limit Switches ChrisR_522 Programming 2 25-01-2008 08:04
limit switches stephenthe1 Programming 28 11-05-2005 16:37
Limit switches Team168 Programming 8 10-02-2003 16:22
Limit Switches/Pots Brett W Technical Discussion 3 28-01-2003 14:25


All times are GMT -5. The time now is 02:51.

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