Go to Post I wonder how many games we could come up with that are not the one for FRC 2008. - AndrewN [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 28-03-2012, 15:02
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
FRC #4901 (Garnet Squadron)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Columbia, SC
Posts: 1,126
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: Check My Autonomous Code

Quote:
Originally Posted by jhellr13 View Post
Alright. I'll change that stuff later in the day. Sort of in a rush right now, but I attached my new code from last night.
Keep me informed. I'm wanting to get it working for you.
__________________
Garnet Squadron
FRC 4901
Controls Mentor
@rnazaretian

Previous mentor and student from Team Fusion, FRC 364
Reply With Quote
  #2   Spotlight this post!  
Unread 28-03-2012, 15:35
jhellr13 jhellr13 is offline
Registered User
FRC #4272
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: US
Posts: 187
jhellr13 is an unknown quantity at this point
Re: Check My Autonomous Code

Quote:
Originally Posted by RyanN View Post
Keep me informed. I'm wanting to get it working for you.
I just looked over the code again. I left the logic you were talking about the same as I feel safer keeping it the way I've always done limit switches since I know it works. I'm not doubting your suggestions, I would just like to keep it the way it is.

The new code is in my previous response in the zip attachment.
Reply With Quote
  #3   Spotlight this post!  
Unread 28-03-2012, 18:16
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
FRC #4901 (Garnet Squadron)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Columbia, SC
Posts: 1,126
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: Check My Autonomous Code

Well, I'm going to tell you right now, it's will not work. I cannot explain it any further. Maybe someone else can look at your code and help you. I've done all I can do.
__________________
Garnet Squadron
FRC 4901
Controls Mentor
@rnazaretian

Previous mentor and student from Team Fusion, FRC 364
Reply With Quote
  #4   Spotlight this post!  
Unread 28-03-2012, 18:23
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 989
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: Check My Autonomous Code

Quote:
Originally Posted by RyanN View Post
Well, I'm going to tell you right now, it's will not work. I cannot explain it any further. Maybe someone else can look at your code and help you. I've done all I can do.
Ryan is correct.

I highly recommend looking through Ryan's images above, step by step to see why your logic doesn't work the way you want it to (in addition to the fact that the code for the bottom mode isn't in a loop).
Reply With Quote
  #5   Spotlight this post!  
Unread 28-03-2012, 18:29
jhellr13 jhellr13 is offline
Registered User
FRC #4272
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: US
Posts: 187
jhellr13 is an unknown quantity at this point
Re: Check My Autonomous Code

Quote:
Originally Posted by RufflesRidge View Post
Ryan is correct.

I highly recommend looking through Ryan's images above, step by step to see why your logic doesn't work the way you want it to (in addition to the fact that the code for the bottom mode isn't in a loop).
I'm gonna say it again. The logic I have in there for my limit switch for my bridge is 100% correct. It will work exactly as I need it to work. I've used that code before in teleop and it has worked. I have received this bit of code straight from http://team358.org/files/programming...2009-/LabVIEW/

Look for limit switch example. It works.

All I'm trying to do is get the robot to move the distance to the bridge using the encoders. Stop when the distance has been met, then lower the bridge arm down until the limit switch is hit.
I'm a second year programmer who has never had experience with autonomous. Last year I never even got to it as I started programming in week 4(Conversation for a different thread). I will easily admit I'm not too confident in writing the bottom code, and that is why I came here.

All I'm asking for is some help. My competition begins tomorrow, and I would love if I could get this to work.
Come on and help me out
Reply With Quote
  #6   Spotlight this post!  
Unread 28-03-2012, 18:40
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 989
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: Check My Autonomous Code

Quote:
Originally Posted by jhellr13 View Post
I'm gonna say it again. The logic I have in there for my limit switch for my bridge is 100% correct. It will work exactly as I need it to work. I've used that code before in teleop and it has worked. I have received this bit of code straight from http://team358.org/files/programming...2009-/LabVIEW/

Look for limit switch example. It works.
The limit switch example on that page works great; however, it does not match your code.

I highly recommend you be ready to disable the robot when testing that code to avoid breaking the arm and that you seek out an experienced LabVIEW team and/or the CSA at your event to help you out.
Reply With Quote
  #7   Spotlight this post!  
Unread 28-03-2012, 18:48
jhellr13 jhellr13 is offline
Registered User
FRC #4272
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: US
Posts: 187
jhellr13 is an unknown quantity at this point
Re: Check My Autonomous Code

Quote:
Originally Posted by RufflesRidge View Post
The limit switch example on that page works great; however, it does not match your code.

I highly recommend you be ready to disable the robot when testing that code to avoid breaking the arm and that you seek out an experienced LabVIEW team and/or the CSA at your event to help you out.
The example and my code are the same...Just checked. The only difference is that the example takes the value from the joystick while my code has a constant of 1.


Is there anything I can do to get the robot to at least move the distance by encoders?

If you want, I can set it up for you to remote into my computer and work on my code in real-time rather than having to keep going back and forth on here. PM if you want to.
Reply With Quote
  #8   Spotlight this post!  
Unread 28-03-2012, 19:57
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
FRC #4901 (Garnet Squadron)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Columbia, SC
Posts: 1,126
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: Check My Autonomous Code

From http://team358.org/files/programming...2009-/LabVIEW/


Check out the comment below that code. "limit switch on the forward motor direction"

What this example does is allows you to move the motor in either direction, but it tests for a special case for when the joystick is pushed forward (forward values are inverted, and give you a negative value instead of a positive). If the driver is holding the joystick forward, it will allow the motor to go up until the point where the limit switch is hit. The driver has the ability to drive the other direction (reverse) all day long, as the limit switch is disabled, and will not disable the motor value.

Q: So why is the False end of the Select connected to the joystick?
A: The False of the the select is connected to the joystick to control the motor speed.

Q: What is the default state for the Select?
A: The default state is False, where the motor value is directly connected to the joystick.

Q: What causes the Select to switch to the True case to turn the motor off?
A: Having the joystick pushed forward (where the value is less than 0) AND when the limit switch is depressed will cause the Select to switch to the True case, passing a 0 motor value, ultimately turning the motor off.

As RufflesRidge mentioned, this is only a small part of your problem, but this is the problem that will cause you to rip an appendage off of your robot via programming. Trust me, the mechanical guys will not be happy.

You need some while loops, and timers would be useful to maintain a good connection to the field.

Please get out of the mindset that your code works perfectly in teleop. In fact, I bet it does work perfectly, but you are using a joystick to control the motor instead of a constant value. Another problem is that you are probably going to turn the motor in the wrong direction if you think the code will work. You might want a -1 in there instead of a 1, which would make your code work, but why go through the extra effort of checking if a constant (constant meaning that it won't change, ever) goes negative?

Being able to copy someone else's code is one thing but being able to actually understand what the code is doing is another.

You have multiple issues, and I haven't seen one addressed since last night. I'd be happy to help you out if you want, but you'll have to just trust me on everything that I say. Send me a PM.
__________________
Garnet Squadron
FRC 4901
Controls Mentor
@rnazaretian

Previous mentor and student from Team Fusion, FRC 364

Last edited by RyanN : 28-03-2012 at 20:02.
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 10:54.

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