OCCRA
Go to Post I love how your suggestion for MCC is one of the most elite robots of the year, and one of the World Champions. I also love that I really can't argue with you. - JVN [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Events   CD-Media   CD-Spy   FRC-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 02-02-2003, 01:11 PM
Team168 Team168 is offline
Registered User
#0168 (Flashbacks)
 
Join Date: Jan 2003
Location: Miami
Posts: 2
Team168 is an unknown quantity at this point
Limit switches

What part of the code do you put limit switches in?
__________________
Adapt, Adjust, Overcome
  #2   Spotlight this post!  
Unread 02-03-2003, 12:47 AM
Greg Ross's Avatar
Greg Ross Greg Ross is offline
Grammar Curmudgeon
AKA: gwross
FRC #0330 (Beach 'Bots)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Hermosa Beach, CA
Posts: 2,244
Greg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond repute
Send a message via AIM to Greg Ross Send a message via Yahoo to Greg Ross
The default program contains code implementing limit switches. The code following "PWM outputs Limited by Limit Switches" is what you're after.
__________________
Greg Ross (The Grammar Curmudgeon formerly known as gwross)
S/W Engineer, Team 330, the Beach 'Bots
<--The Grammar Curmudgeon loves this cartoon.
ôLife should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!" Hunter S. Thompson
"Playing a practical joke means doing something mean and calling it funny." Me
  #3   Spotlight this post!  
Unread 02-03-2003, 01:04 AM
Jay Lundy Jay Lundy is offline
Programmer/Driver 2001-2004
FRC #0254 (The Cheesy Poofs)
Team Role: Alumni
 
Join Date: Jun 2001
Rookie Year: 2001
Location: Berkeley, CA
Posts: 320
Jay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to all
There should be a page in the robot controller manual that tells you what pins are used for what on the digital input port. On the same page it will tell you what variable each input pin is set as in the default program. Then in the program you use that variable, which will either be 0 or 1.
  #4   Spotlight this post!  
Unread 02-05-2003, 06:07 AM
Cobra51 Cobra51 is offline
Registered User
#0116 (Eplison Delta)
 
Join Date: Feb 2002
Location: Herndon VA
Posts: 3
Cobra51 is an unknown quantity at this point
Send a message via AIM to Cobra51
When you say limit switch I asume you are refering to snap action switchs, in that case you can alias them for the rc_sw#.
Since they are digital, they at 1 or 0.
  #5   Spotlight this post!  
Unread 02-09-2003, 10:48 PM
Mythikal's Avatar
Mythikal Mythikal is offline
Registered User
#1104 (TechnoEagles)
 
Join Date: Feb 2003
Location: Axtell, Kansas
Posts: 6
Mythikal is an unknown quantity at this point
Send a message via Yahoo to Mythikal
I don't know... i hooked up 2 limit switches and wired them into rc_sw5 and rc_sw6, so it would stop the forward and back (actually will be up and down) motion when it tipped the switch. they were wired to the right pins, i made sure using a multimeter, yet when i ran pwm3, flipping the switches no more stopped the movement than if they weren't there in the first place. i'm kindof a n00b, so i'm probably making a stupid mistake. any suggestions from anyone??
__________________
> SELECT * FROM users WHERE clue > 0
> 0 rows returned
Hmm.... 0 returned... go figure....


We have enough youth already. What we need is a fountain of SMART.
  #6   Spotlight this post!  
Unread 02-10-2003, 01:27 AM
Greg Ross's Avatar
Greg Ross Greg Ross is offline
Grammar Curmudgeon
AKA: gwross
FRC #0330 (Beach 'Bots)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Hermosa Beach, CA
Posts: 2,244
Greg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond repute
Send a message via AIM to Greg Ross Send a message via Yahoo to Greg Ross
Quote:
Originally posted by Mythikal
I don't know... i hooked up 2 limit switches and wired them into rc_sw5 and rc_sw6, so it would stop the forward and back (actually will be up and down) motion when it tipped the switch. they were wired to the right pins, i made sure using a multimeter, yet when i ran pwm3, flipping the switches no more stopped the movement than if they weren't there in the first place. i'm kindof a n00b, so i'm probably making a stupid mistake. any suggestions from anyone??
What evidence do you have that your switches are connected correctly? The only evidence I've heard says they aren't correct.
You should have two wires going from each switch to the digital input port on the RC. For this application you will want to have one of the wires connected to the "normally open" (NO) terminal of the switch, and the other wire to the common (COM) terminal. According to the table on page 10 of the Full-Size Robot Controller Reference Guide, switch 5's NO should be wired to pin 4 of the digital input port, and switch 6's to pin 5. The COM terminals of each switch must be connected to a ground pin (3, 6, 9, 12, 13, 14, 17, 20 or 23) on the input port.
__________________
Greg Ross (The Grammar Curmudgeon formerly known as gwross)
S/W Engineer, Team 330, the Beach 'Bots
<--The Grammar Curmudgeon loves this cartoon.
ôLife should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!" Hunter S. Thompson
"Playing a practical joke means doing something mean and calling it funny." Me
  #7   Spotlight this post!  
Unread 02-10-2003, 08:16 AM
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: 7,842
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
if you want to verify that the switches are working, use a debug statement in your code. Something to the effect of:

debug "rc_swA ", BIN rc_swA, " rc_swB ", BIN rc_swB, CR

then you can see whether the 5th and 6th bit positions of rc_swA change when you press the switch. If different bits change, then you hooked up the common correctly, but not the switch input. If no bits change, then you either have a dead switch (you can check with a multimeter) or you wired to either two grounds or two switch inputs.

If everything works correctly, then the problem is with your code, and you would have post it.

Assuming that you are still using the default code, you actually need to use the "Normally Closed" terminal.
Code:
if rc_sw5 = 0 then next1:
	p3_y = p3_y MAX 127
next1:
When a switch is closed, it reads a 1. so, to stop the motor, you need it to read a 0, which means pressing the limit switch when it is normally closed. If you want to use the normally open terminal, you would need to modify the default code and change the if rc_sw5 = 0 to if rc_sw5 = 1

Does that make sense?
  #8   Spotlight this post!  
Unread 02-10-2003, 08:34 AM
Lloyd Burns Lloyd Burns is offline
Registered User
FRC #1246 (Agincourt Robotics)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Toronto
Posts: 292
Lloyd Burns is an unknown quantity at this point
The best evidence that the connections are correct is a statement in your program

DEBUG cls, bin8 rc_swA,cr

When you run the program, activating a switch should change the appropriate 0 to a 1.

Even if you are not a complete noobie, one source of frustration is the DB-25, with its invisible numbers beside each pin. The end with pin 1 is on the right with the longer row of 13 pins up, looking at the solder cups - I just rewired two connectors I'd connected in error

If you are wiring micro switches, the common connection is on the bottom, and the side (one of the two smallest faces) has NC and NO connections.

If you are wiring photosensors, make sure you connect the BrowN wire to +12V not the +5V available in the connector, and the BlUe wire to ground.
  #9   Spotlight this post!  
Unread 02-10-2003, 03:22 PM
Mythikal's Avatar
Mythikal Mythikal is offline
Registered User
#1104 (TechnoEagles)
 
Join Date: Feb 2003
Location: Axtell, Kansas
Posts: 6
Mythikal is an unknown quantity at this point
Send a message via Yahoo to Mythikal
Alright.... what i'm doing is having the motor stop when it hits the limit switch... when it hits the switch, it completes the connection, and it sends a "1" signal to the RC Controller.... correct? anyways.. i'm still messing with it. i'll look at the numbers on the pins to be sure, and i'll print this all off to try it and get back to you later on... thanks for the help
~Mythikal, Team 1104
__________________
> SELECT * FROM users WHERE clue > 0
> 0 rows returned
Hmm.... 0 returned... go figure....


We have enough youth already. What we need is a fountain of SMART.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
$3500 limit - Who does not have questions Raul Rules/Strategy 5 01-12-2003 10:31 AM
Team selector switches on ISAAC Lloyd Burns Robotics Education and Curriculum 0 12-17-2002 07:32 AM
More than 2 aux switches in 1 port f22flyboy Programming 2 11-01-2002 01:44 PM
I need help with the reed switches!!!!!!! archiver 2001 2 06-23-2002 11:40 PM
Need help with custom switches archiver 2001 3 06-23-2002 11:35 PM


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

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi