View Single Post
  #8   Spotlight this post!  
Unread 22-02-2005, 17:01
Chris Hibner's Avatar Unsung FIRST Hero
Chris Hibner Chris Hibner is offline
Eschewing Obfuscation Since 1990
AKA: Lars Kamen's Roadie
FRC #0051 (Wings of Fire)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1997
Location: Canton, MI
Posts: 1,488
Chris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond repute
Re: Spotty Radio Communications!

Have you tried recreating the problem using a tether cable? This should tell you if it is a radio problem or not.

What is controlling the valve? Is it actuated automatically via some routine in your code, or is it controlled when one of the drivers presses a switch?

If it is a switch control through the OI, you might consider adding a debounce to the switch. In other words, make your code require X number of consecutive samples before it changes the relay state. For instance:

Code:
    // debounce closing the claw
    if (!closeClaw)
    {
        if (closeClawSwitch == ON)
        {
              closeClawDebCount++;
        }
        else
        {
              closeClawDebCount = 0;
        }
        if (closeClawDebCount >= DEBOUNCE_LIMIT)
        {
            closeClawDebCount = 0;
            closeClaw = TRUE;
        }
    }
    // Debounce opening the claw
    if (closeClaw)
    {
        if (openClawSwitch == ON)
        {
            openClawDebCount++;
        }
        else
        {
            openClawDebCount = 0;
        }
        if (openClawDebCount >= DEBOUNCE_LIMIT)
        {
            openClawDebCount = 0;
            closeClaw = FALSE;
        }
    }
Where the variable closeClaw controls the digital IO pin connected to the spike that controls your Festo valve.
__________________
-
An ounce of perception is worth a pound of obscure.

Last edited by Chris Hibner : 22-02-2005 at 17:04.