Go to Post Is it weird we think speed controllers are sexy? - vivek16 [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 17-03-2010, 17:56
Dustin Shadbolt's Avatar
Dustin Shadbolt Dustin Shadbolt is offline
In a server room somewhere...
AKA: Dustin Shadbolt
FRC #1555 (Team PULSE)
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Monticello,Indiana
Posts: 320
Dustin Shadbolt is on a distinguished road
LimitSwitches and Encoder Questions

I have a few questions so I can finish working on some programming issues before tomorrow's Boiler Maker regional.

A) Limit Switches - My team wants to use to limit switches to control our climbing device. Like once one limit switch is pushed the motor can no longer go backwards. I have a basic understanding of limit switches from searching the forums but I don't know how you would incorporate that into the teleop vi. How would go about saying okay once the DIO input is true it prevents the motor from going backwards?

B)Encoder/Autonomous - I was also asked to try to make an autonomous program that goes forward for 4inches and kicks then goes forward 40inches and kick. For one is this possible? If so how would go about getting the encoder data and then setting it to run 4inches > kick > move 40 inches forward > kick > finish.

C) Toggle Button Issue - I have recently coded one of our buttons to toggle open and close one of our solenoids. The issue is it is really random in the way it acts. It will sometimes open sometimes close or it will open multiple times in one push. Yeah not pretty. I coded it just like the one found here (thanks team 358 for the wonderful resources!)

Again sorry for the all questions it's just I'm trying to get a basic idea of how to run all of this and get it done by myself lol. (yay for my first year)
Reply With Quote
  #2   Spotlight this post!  
Unread 17-03-2010, 21:55
bladetech932's Avatar
bladetech932 bladetech932 is offline
Programmer of awesome
AKA: Jon
FRC #0932 (Circuit Chargers)
Team Role: College Student
 
Join Date: May 2009
Rookie Year: 2009
Location: Tulsa
Posts: 242
bladetech932 is on a distinguished road
Re: LimitSwitches and Encoder Questions

A)dio is the condition for a case structure, if true, then it checks the value with a greater than 0 function,then inside with another case structure,if true, value carries through if not, set a constant 0
B)I dont know about the encoders but for autonomous you could use a set speed for example .4 to drive forward for the amount of time it takes to get to the first ball then kick then to the second and kick you can put this in a flat sequence for simplicity and to make sure the correct order is kept
C)if you are using a latching button there is an example provided with this years software it is found in C:\Program Files\National Instruments\LabVIEW 8.6\examples\FRC\Driver Station Inputs\Joystick Button Latching
__________________
Expect the best, Prepare for the worst

Last edited by bladetech932 : 17-03-2010 at 22:12.
Reply With Quote
  #3   Spotlight this post!  
Unread 18-03-2010, 06:11
Dustin Shadbolt's Avatar
Dustin Shadbolt Dustin Shadbolt is offline
In a server room somewhere...
AKA: Dustin Shadbolt
FRC #1555 (Team PULSE)
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Monticello,Indiana
Posts: 320
Dustin Shadbolt is on a distinguished road
Re: LimitSwitches and Encoder Questions

Thanks blade
Reply With Quote
  #4   Spotlight this post!  
Unread 18-03-2010, 11:16
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: LimitSwitches and Encoder Questions

Quote:
Originally Posted by dShad View Post
My team wants to use to limit switches to control our climbing device. Like once one limit switch is pushed the motor can no longer go backwards. I have a basic understanding of limit switches from searching the forums but I don't know how you would incorporate that into the teleop vi. How would go about saying okay once the DIO input is true it prevents the motor from going backwards?
If by "prevent the motor from moving backwards" you mean "stop powering the motor in the backward direction", then the best way is to connect the limit switch directly to the Jaguar (if you are using Jaguar). The Jaguar senses the limit switch and shuts off power. No code required.

~
Reply With Quote
  #5   Spotlight this post!  
Unread 18-03-2010, 11:52
Vikesrock's Avatar
Vikesrock Vikesrock is offline
Team 2175 Founder
AKA: Kevin O'Connor
no team
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2007
Location: Manchester, NH
Posts: 3,305
Vikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond repute
Send a message via AIM to Vikesrock Send a message via MSN to Vikesrock Send a message via Yahoo to Vikesrock
Re: LimitSwitches and Encoder Questions

Quote:
Originally Posted by Ether View Post
If by "prevent the motor from moving backwards" you mean "stop powering the motor in the backward direction", then the best way is to connect the limit switch directly to the Jaguar (if you are using Jaguar). The Jaguar senses the limit switch and shuts off power. No code required.

~


Only do this ^ if you are using CAN!!

http://forums.usfirst.org/showthread.php?t=14956
Also in the manual, but I don't feel like grabbing the rule, it's referenced in the Q&A.
__________________


2007 Wisconsin Regional Highest Rookie Seed & Regional Finalists (Thanks 930 & 2039)
2008 MN Regional Semifinalists (Thanks 2472 & 1756)
2009 Northstar Regional Semifinalists (Thanks 171 & 525)
Reply With Quote
  #6   Spotlight this post!  
Unread 18-03-2010, 12:50
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: LimitSwitches and Encoder Questions

Quote:
Originally Posted by Vikesrock View Post


Only do this ^ if you are using CAN!!

http://forums.usfirst.org/showthread.php?t=14956
Also in the manual, but I don't feel like grabbing the rule, it's referenced in the Q&A.
GDC's response at the link you provided (appended verbatim below) says you MAY use limit switch inputs if you are using CAN, and you CAN NOT use them if you are controlling via PWM.

Either they made a grammar mistake ("can" not instead of "must not" or "shall not" or "are not permitted to"), or they know something about the Jag that is not in the technical documentation. The documentation I have in front of me says nothing about the limit switch functionality being limited to use only with CAN commands.


GDC's response:
Please see Rule <R60-L>. You may use the limit switch inputs to the Jaguar speed controllers IF you are controlling the Jaguar via a CAN-bus connection. You can not use external limit switch inputs to the Jaguars if you are controlling them via PWM inputs


~
Reply With Quote
  #7   Spotlight this post!  
Unread 18-03-2010, 11:22
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: LimitSwitches and Encoder Questions

Quote:
Originally Posted by dShad View Post
B)Encoder/Autonomous - I was also asked to try to make an autonomous program that goes forward for 4inches and kicks then goes forward 40inches and kick. For one is this possible? If so how would go about getting the encoder data and then setting it to run 4inches > kick > move 40 inches forward > kick > finish.
If you are using a relative encoder like the optical one from the KoP, and you are using autonomous independent:

- read and store the encoder count
- set motors to move forward at the desired speed
- poll the encoder count in a loop until it indicates a value that corresponds to a change of position of 4 inches
- kick the ball
- poll the encoder count in a loop until it indicates a value that corresponds to a change of position (from the original saved value) of 44 inches
- kick the ball
- stop the motors


~
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
encoder works, and then it doesn't. jmanela NI LabVIEW 7 27-02-2010 14:21
Encoder Assembly and Code joecap5 FRC Control System 0 08-02-2010 23:56
combo encoder and chain tensioner SteveJanesch Electrical 8 17-12-2009 16:55
Encoder Help with VEX and MPLAB qnetjoe Programming 5 11-03-2007 21:04
Combined Camera and PID/Encoder Code Terry Sherman Programming 1 14-03-2005 17:59


All times are GMT -5. The time now is 22:01.

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