Go to Post Dave has said that straight out. Well, straight by dave standards. - phrontist [more]
Home
Go Back   Chief Delphi > Other > FIRST Tech Challenge
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 18 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 14-12-2014, 17:37
FRC Team CC FRC Team CC is offline
Registered User
FRC #6560 (Charging Champions)
 
Join Date: Sep 2014
Rookie Year: 2012
Location: Southern California
Posts: 102
FRC Team CC is an unknown quantity at this point
Exclamation [FTC]: IR Beacon Problem

Hello,

We are currently having trouble with our HiTechnic IR Beacon. Our program, adapted from an FTC document, detects the direction and signal strength of the beacon. The direction has a range of 1-9, with range 0 if the beacon is not found. The strength is between 0-255. When we tested the program before, everything went fine. Yesterday though, one of our team members dropped the beacon. Today when we tested it, the reading fluctuated. The direction would be at 7, then 0, then 7, then 0... the signal strength would fluctuate from 0-255. We believe this because the beacon is not emitting the IR signal constantly, but in 1 second bursts.

A video of this is posted below; code is as follows:
Code:
#pragma config(Sensor, S1,     HTIRS2,              sensorI2CCustom)

// RoboSeek.c - This program uses the HiTechnic IR Seeker V2
// sensor to follow an IR source.  This program requires the
// HTIRS2-driver.h driver provided with RobotC.
//

// You can copy the "drivers" subdirectory and place it
// in the same directory as this source file. if you do,
// you can use the following #include statement to specify
// the path to the driver.
//#include "drivers/HTIRS2-driver.h"

// if you use the "drivers/HTIRS2-driver.h" line,
// then you should comment out the following line.
#include "hitechnic-irseeker-v2.h"

// main task
task main ()
{
  int _dirAC = 0;
	int acS1, acS2, acS3, acS4, acS5 = 0;

	int maxSig = 0;    // the max signal strength from the seeker.
	int val = 0;       // the translated directional value.

	// we are going to set DSP mode to 1200 Hz.
  tHTIRS2DSPMode _mode = DSP_1200;

  // attempt to set to DSP mode.
  if (HTIRS2setDSPMode(HTIRS2, _mode) == 0)
  {
    // unsuccessful at setting the mode.
    // display error message.
    eraseDisplay();
    nxtDisplayCenteredTextLine(0, "ERROR!");
    nxtDisplayCenteredTextLine(2, "Init failed!");
    nxtDisplayCenteredTextLine(3, "Connect sensor");
    nxtDisplayCenteredTextLine(4, "to Port 1.");

    // make a noise to get their attention.
    PlaySound(soundBeepBeep);

    // wait so user can read message, then leave main task.
    wait10Msec(300);
    return;
  }

  eraseDisplay();

  // loop continuously and read from the sensor.
  while(true)
  {
    // read the current modulated signal direction
    _dirAC = HTIRS2readACDir(HTIRS2);
    if (_dirAC < 0)
    {
      // error! - write to debug stream and then break.
      writeDebugStreamLine("Read dir ERROR!");
      break;
    }

    // Get the AC signal strength values.
    if (!HTIRS2readAllACStrength(HTIRS2, acS1, acS2, acS3, acS4, acS5 ))
    {
      // error! - write to debug stream and then break.
      writeDebugStreamLine("Read sig ERROR!");
      break;
    }  else {
      // find the max signal strength of all detectors.
      maxSig = (acS1 > acS2) ? acS1 : acS2;
      maxSig = (maxSig > acS3) ? maxSig : acS3;
      maxSig = (maxSig > acS4) ? maxSig : acS4;
      maxSig = (maxSig > acS5) ? maxSig : acS5;
    }

    // display info
    nxtDisplayCenteredBigTextLine(1, "Dir=%d", _dirAC);
    nxtDisplayCenteredBigTextLine(4, "Sig=%d", maxSig);

    // figure out which direction to go...
    // a value of zero means the signal is not found.
    // 1 corresponds to the far left (approx. 8 o'clock position).
    // 5 corresponds to straight ahead.
    // 9 corresponds to far right.

    // first translate directional index so 0 is straight ahead.
    val = _dirAC - 5;

    // calculate left and right motor speeds.
    motor[motorC] = 50 + 30 * val;
    motor[motorB] = 50 - 30 * val;

    // wait a little before resuming.
    wait10Msec(2);
  }
}
What can we do to fix the problem? Is the IR beacon damaged?

Regards,

The Charging Champions
Attached Thumbnails
Click image for larger version

Name:	bloggif_548e0947e6311.gif
Views:	47
Size:	1.61 MB
ID:	17587  
Reply With Quote
  #2   Spotlight this post!  
Unread 15-12-2014, 00:55
atucker4072's Avatar
atucker4072 atucker4072 is offline
Andrew Tucker
AKA: Andrew Tucker
FTC #4968 (Rapid Robotics)
Team Role: Mentor
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Glenwood Springs, Co
Posts: 152
atucker4072 has a spectacular aura aboutatucker4072 has a spectacular aura aboutatucker4072 has a spectacular aura about
Re: [FTC]: IR Beacon Problem

I'm not too familiar with the new beacons but the red light is flashing and it might be a low battery. I volunteered at an event yesterday and the beacon that the used was the same one and I don't remember the light flashing.
Reply With Quote
  #3   Spotlight this post!  
Unread 15-12-2014, 01:26
ehochstein's Avatar
ehochstein ehochstein is offline
Coach, Volunteer & Mentor
AKA: Evan Hochstein
FTC #5943 (ESGM)
Team Role: Coach
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Bloomington, Minnesota
Posts: 932
ehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant future
Re: [FTC]: IR Beacon Problem

Take your cell phone camera and point it at the IR emitters on the beacon. Do you see the lights on your cell phone screen? If not, replace the batteries, in fact you should probably just replace the batteries.
__________________
Minnesota FIRST Senior Mentor | 2013-?

Stratasys Applications Engineering Technician | 2016-?

2009 Regional Win – 2470 @ 10k Lakes (Thanks 2826 and 1714)
2013 WFFA Recipient – 2470 @ 10K Lakes
2016 Ri3D: 'Snow Problem Reveal

The opinions expressed above are the personal opinions of the author and do not necessarily represent the views and opinions of any organization the author is affiliated with.
Reply With Quote
  #4   Spotlight this post!  
Unread 15-12-2014, 03:18
BenDSterling's Avatar
BenDSterling BenDSterling is offline
Alumni, Mentor, Volunteer
FRC #6325 (Reset Robotics)
Team Role: Mentor
 
Join Date: Apr 2014
Rookie Year: 2011
Location: Georgia
Posts: 118
BenDSterling will become famous soon enough
Re: [FTC]: IR Beacon Problem

It is most likely a battery issue. Those are common signs of low/dead batteries. To check it you can use a camera or phone and aim the camera at the IR beacon. The camera/phone can see IR light and it will look like the IR bulbs are lightinh up. If you don't see this then try replacing the batteries. Best of luck!
__________________
Lead Mentor: FRC Team Reset Robotics (#6325)
Mentor: FTC Teams #9686 & #10396
Head of AV for Georgia FIRST Robotics
FTC South Super Regional planning committee member
Reply With Quote
  #5   Spotlight this post!  
Unread 26-12-2014, 23:06
FRC Team CC FRC Team CC is offline
Registered User
FRC #6560 (Charging Champions)
 
Join Date: Sep 2014
Rookie Year: 2012
Location: Southern California
Posts: 102
FRC Team CC is an unknown quantity at this point
Re: [FTC]: IR Beacon Problem

Thanks! Replacing the battery worked!
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 16:55.

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