Go to Post I want to help them to get what's made such a difference to me... - Beth Sweet [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 19-02-2011, 21:39
umangv620 umangv620 is offline
Programming Captain
AKA: Umang
FRC #1403 (Cougar Robotics)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2008
Location: New Jersey
Posts: 80
umangv620 will become famous soon enoughumangv620 will become famous soon enough
Need to confirm

I'm making the final adjustments to my code, but I need to confirm a few things before I try them out on the robot.

1) Does using the wait timer prevent all other robot functions from running in teleop until the wait timer is over? I'm talking about the wait timer used in this code, but not in that context.

We have a drive shifter that switches between 2 speeds, and it shifts when the joystick trigger is pressed. The problem is that sometimes, our driver holds the shifter for half a second too long, and it shifts more than once. Can I put the wait timer in my code without it preventing tank drive and other robot features from functioning?

2) We are using a window motor for our arm, but due to gravity + inertia + physics, when we move the arm down, the arm just falls down all the way and smacks into the robot. I believe I have the window motor only moving at .4 speed downwards, but is there any way for to prevent it from falling down so rapidly? At the slightest touch of the joystick, the arm falls down all the way, and it takes a while for the window motor to bring the arm back up.

3) I need to code preset arm locations, that use the window motor and a potentiometer. I was looking at team358's sample code to see how it could be done, and they used PID. Im not very experienced using PID, so I just need clarifications for this. Does the PID automatically know if it has a greater or lower voltage than the desired position, and move accordingly? And for the P part of the PID, does it matter how low the number I make it? Its supposed to lower the error on the motor as the number gets smaller, but is there a consequence to making the P number too small?

4) I don't remember the exact error I was getting, but when we run our code, Driver Station fills up with errors saying that Robot Drive either runs too fast or too slowly for teleop.vi / robot main.vi. When we run our code though, we experience no lag (besides the very occasional communication+robot code loss). If I need to, I'll post the exact error I get tomorrow, but I was just wondering is there a known fix to this? As far as I remember, we have been getting this error since day 1 with a clean FRC 2011 cRIO robot project.

If I remember any more adjustments I have to make and don't understand, I'll update this post.
Any help here would be greatly appreciated.
__________________
Team 1403 Cougar Robotics

2009-2011 Programming Captain

2010
NJ-Regional - Chairmans Award
Reply With Quote
  #2   Spotlight this post!  
Unread 19-02-2011, 21:53
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Need to confirm

The issue with #4 and to answer the question about #1, teleop code shouldn't have a delay in it. You want teleop to return as quickly as possible.

To answer the question, wait delays the sequence or diagram it is in. Because you haven't returned from teleop, the next teleop packet cannot be processed, so it introduces a serious delay in the teleop execution of your robot.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 20-02-2011, 00:05
umangv620 umangv620 is offline
Programming Captain
AKA: Umang
FRC #1403 (Cougar Robotics)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2008
Location: New Jersey
Posts: 80
umangv620 will become famous soon enoughumangv620 will become famous soon enough
Re: Need to confirm

I don't have any wait timers in teleop at the moment, but im still getting the errors in #4.
__________________
Team 1403 Cougar Robotics

2009-2011 Programming Captain

2010
NJ-Regional - Chairmans Award
Reply With Quote
  #4   Spotlight this post!  
Unread 20-02-2011, 00:08
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: Need to confirm

The appropriate answer to #2 is to mechanically support the arm so that gravity is not a large influence on its motion. Either a counterweight or some sort of spring arrangement would work. There is no easy way to deal with it in software, especially with a window motor.

For #3, setting the P constant too low will result in the motor being given so little power that it will stop long before it gets to the set point. The I constant can compensate for this, but it will take some time, and is likely to overshoot badly. What you generally want to do is increase P until you get oscillation, then back it down until you get reliable motion with a reasonably small steady-state error. Then increase I until that error is resolved with a minimum of time and overshoot.
Reply With Quote
  #5   Spotlight this post!  
Unread 20-02-2011, 00:49
Doc Wu's Avatar
Doc Wu Doc Wu is offline
Registered User
AKA: Al Gritzmacher
FRC #1507 (Warlocks)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2003
Location: Lockport NY
Posts: 207
Doc Wu has a brilliant futureDoc Wu has a brilliant futureDoc Wu has a brilliant futureDoc Wu has a brilliant futureDoc Wu has a brilliant futureDoc Wu has a brilliant futureDoc Wu has a brilliant futureDoc Wu has a brilliant futureDoc Wu has a brilliant futureDoc Wu has a brilliant futureDoc Wu has a brilliant future
Re: Need to confirm

Quote:
Originally Posted by umangv620 View Post
4) I don't remember the exact error I was getting, but when we run our code, Driver Station fills up with errors saying that Robot Drive either runs too fast or too slowly for teleop.vi / robot main.vi. When we run our code though, we experience no lag (besides the very occasional communication+robot code loss). If I need to, I'll post the exact error I get tomorrow, but I was just wondering is there a known fix to this? As far as I remember, we have been getting this error since day 1 with a clean FRC 2011 cRIO robot project.
I have been experiencing the same thing with even the default project. Because the default code generates that error, I've just ignored it.

Wish someone would come up with a fix or at least an explanation of this.
__________________
-= Mentor Lockport Warlocks -=- Team 1507 =-
Amateur Radio Callsign: AE2T

2016 Robot Inspector - Fingerlakes, Pittsburgh
2015 Robot Inspector - Pittsburgh, Champs. Judge Observer - Champs
2014 Robot Inspector - Tech Valley, Fingerlakes, Buckeye, Championship
2013 Robot Inspector - Fingerlakes, Buckeye, Championship
2012 Robot Inspector - Fingerlakes, Buckeye, Championship - Website Evaluator - Fingerlakes, Buckeye, Championship
2011 Robot Inspector - Fingerlakes 2011 Safety Advisor - Fingerlakes

Reply With Quote
  #6   Spotlight this post!  
Unread 20-02-2011, 09:18
umangv620 umangv620 is offline
Programming Captain
AKA: Umang
FRC #1403 (Cougar Robotics)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2008
Location: New Jersey
Posts: 80
umangv620 will become famous soon enoughumangv620 will become famous soon enough
Re: Need to confirm

Quote:
Originally Posted by Alan Anderson View Post
The appropriate answer to #2 is to mechanically support the arm so that gravity is not a large influence on its motion. Either a counterweight or some sort of spring arrangement would work. There is no easy way to deal with it in software, especially with a window motor.

For #3, setting the P constant too low will result in the motor being given so little power that it will stop long before it gets to the set point. The I constant can compensate for this, but it will take some time, and is likely to overshoot badly. What you generally want to do is increase P until you get oscillation, then back it down until you get reliable motion with a reasonably small steady-state error. Then increase I until that error is resolved with a minimum of time and overshoot.
If I use buttons and PID to move the arm to a certain position, will it prevent the arm from overshooting downwards? Lets say my arm is all the way up, and I want to put it to a 45 degree angle to drop it. If I use PID to move the motor until the certain voltage is hit (lets say 2.5 V), will it stop at the 45 degree angle, or does it still have the possibility to keep falling downwards due to gravity?
__________________
Team 1403 Cougar Robotics

2009-2011 Programming Captain

2010
NJ-Regional - Chairmans Award
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 20:32.

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