View unanswered posts | View active topics It is currently Sun Aug 31, 2014 2:56 am






Reply to topic  [ 3 posts ] 
BUG: RobotC + EOPD in Long Range mode is broken 
Author Message
Online
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3204
Location: Rotterdam, The Netherlands
Post BUG: RobotC + EOPD in Long Range mode is broken
I'm nothing if not persistent, so here's another bug report.

The HT EOPD sensor has two modes, Short Distance and Long Distance. These modes are activated by configuring the port and a sensorLightInactive and sensorLightActive respectively.
The results I get with the sensor in short distance mode are totally consistent with what I see in NXT-G (see post here: viewtopic.php?p=6378#p6378).

However, when the port is configured as sensorLightActive, the readings are completely off. I did some testing with 3 programs, NXT-G, NXC and finally RobotC. The sensor was placed in the same position each time and the object that was measured against was moved along a delineated underground.
Code:
Dist  NXC  NXT RobotC
1     248  241   821
2     748  740   200
3     878  879    21
4     933  931     0
5     962  962     0
6     980  982     0
7     992  996     0
8    1001 1004     0
9    1007 1010     0
10   1012 1014     0
11   1014 1016     0
12   1015 1018     0
13   1017 1019     0
14   1017 1020     0
15   1019 1021     0

Above are the results of the distance vs raw value tests. These are the programs I used:
The NXC program:
Code:
task main()
{
  int x = 0;
  SetSensorType(IN_1, IN_TYPE_LIGHT_ACTIVE);
  Wait(100);
  SetSensorMode(IN_1, SENSOR_MODE_RAW);
  Wait(100);
  while (true)
  {
   ClearScreen();
   x = SensorRaw(IN_1);
   NumOut(0, LCD_LINE1, x);
   Wait(100);
  }
}


The RobotC program:
Code:
task main() {
  int x = 0;
   SetSensorType(S1, sensorLightActive);
   wait1Msec(100);
   SetSensorMode(S1, modeRaw);
   wait1Msec(100);

  while(true) {
    eraseDisplay();
      x = SensorRaw[S1];
      nxtDisplayTextLine(0, "%4d", x);
      wait1Msec(100);
   }
}

As you can see the programs are pretty much the same. However, the results are not as can be seen from the graph below:
Image

Could one of the developers please respond to this? It is rendering the EOPD sensor unusable in Long Range mode.

Regards,
Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sat Apr 04, 2009 10:26 am
Profile WWW
Rookie

Joined: Sun Dec 05, 2010 11:58 am
Posts: 28
Post Re: BUG: RobotC + EOPD in Long Range mode is broken
Sorry for the bump, but did this ever get resolved? My FTC team would really like to use the EOPD Sensor but we need the long range. We would also like to be able to use it on the multiplexer, but (if I recall correctly) the smux cannot send I2C write commands. We currently (using RobotC 3.54) cannot get the EOPD to activate long range mode while on the multiplexer.


Fri Jan 04, 2013 1:16 pm
Profile
Online
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3204
Location: Rotterdam, The Netherlands
Post Re: BUG: RobotC + EOPD in Long Range mode is broken
If you're using the driver suite, you should be using ROBOTC 3.55B2 and the Driver Suite 3.2. The issue in this thread has nothing to do with the issue you're seeing. The EOPD is not an I2C sensor, so the read-only aspect does not apply here, you can toggle dig0 on the SMUX just like you can on a direct connection.

What issues are you seeing?

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Fri Jan 04, 2013 1:38 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: mightor and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.