View unanswered posts | View active topics It is currently Tue Aug 21, 2018 5:29 pm






Reply to topic  [ 10 posts ] 
SMUX and IR/Lego Color/Lego Ultrasonic/Gyro 
Author Message
Rookie

Joined: Mon Dec 15, 2014 12:46 am
Posts: 19
Post SMUX and IR/Lego Color/Lego Ultrasonic/Gyro
Hello RobotC Community,

I have been working on utilizing the SMUX and other sensors to help us create new autonomous programs. I have been working on the robot for the past week and have run into several problems most of which I think I have resolved. However before I continue, I'd like to piggyback off of the expert experience here so that I can save an hour or two.

To detail the path I have taken so far, we wanted the layout of the sensors to look like this:
NXT Sensor Ports:
--S1: HiTechnic Motor/Servo Controllers
--S2: Gyro Sensor
--S3: Multiplexer
--S4: Back IR Sensor
Multiplexer:
--1: Lego Color Sensor Left
--2: Lego Color Sensor Right
--3: Front IR Sensor
--4: Lego Ultrasonic


However, we discovered that the Lego Color Sensors seem to not be supported by the SMUX. We also found that the gyro would return values of '0' 75% of the time on the SMUX. This lead us to getting rid of 1 color sensor and moving the gyro and the remaining color sensor to the NXT.

So our robot is currently hooked up with the following sensors:
NXT Sensor Ports:
--S1: HiTechnic Motor/Servo Controllers
--S2: Gyro Sensor
--S3: Multiplexer
--S4: Lego Color Sensor Right
Multiplexer:
--1: -None-
--2: Back IR Sensor
--3: Front IR Sensor
--4: Lego Ultrasonic


I have gotten the IR Sensors to return values, however, I have not implemented the values yet as the gyro and color were the first problems to deal with. So I don't know if the IR values will work as expected yet. I have not tried anything with the Lego Ultrasonic yet. (except setting it up with the SMUX)


Can someone please confirm the following?
1. The Lego Color Sensors are NOT supported by the SMUX
2. The Gyro Sensor is finicky when used on the SMUX (in conjunction with 3 more sensors on the SMUX)
3. The IR Sensors WORK on the SMUX
4. The Lego Ultrasonic will WORK on the SMUX.

Thank you!

_________________
FTC 7104 - The Synergists


Thu Feb 19, 2015 2:31 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1523
Post Re: SMUX and IR/Lego Color/Lego Ultrasonic/Gyro
Synergists wrote:
Can someone please confirm the following?
1. The Lego Color Sensors are NOT supported by the SMUX
2. The Gyro Sensor is finicky when used on the SMUX (in conjunction with 3 more sensors on the SMUX)
3. The IR Sensors WORK on the SMUX
4. The Lego Ultrasonic will WORK on the SMUX.

Thank you!

1. We never tried using Lego color sensors on a SMUX, so can't confirm it either way.
2. We had gyro on SMUX before and didn't have any problem. This year we have it on the NXT directly because the gyro is considered one of the "essential sesnors" on the robot. If for some reason the students forgot to turn the SMUX power ON, we want the essential sensors still working. So we put only non-essential sensors on the SMUX.
3. We have 2 IR seekers on SMUX this year, so they are definitely working.
4. We have 2 sonar sensors on SMUX this year too and have no problem with them.


Thu Feb 19, 2015 4:08 pm
Profile
Rookie

Joined: Mon Dec 15, 2014 12:46 am
Posts: 19
Post Re: SMUX and IR/Lego Color/Lego Ultrasonic/Gyro
Ok, thanks for the feedback!

_________________
FTC 7104 - The Synergists


Thu Feb 19, 2015 8:13 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: SMUX and IR/Lego Color/Lego Ultrasonic/Gyro
The LEGO NXT Color Sensor does NOT work with the HT Sensor MUX. The LEGO NXT Color sensor is a strange animal. It is not I2C and not like a normal analogue sensor. LEGO, in their infinite wisdom, figured it would be much better to make up a new sensor system, that is only used for a single sensor and then not document any of it properly. Go figure. The HT Sensor MUX will work with most, if not all, proper analogue NXT sensors and I2C sensors that don't require writes to them to activate or initiate them.

= 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 Feb 20, 2015 2:15 am
Profile WWW
Rookie

Joined: Mon Dec 15, 2014 12:46 am
Posts: 19
Post Re: SMUX and IR/Lego Color/Lego Ultrasonic/Gyro
Thanks Xander!

That's weird, a whole new sensor system! If we make it to SR, we might look into the HT Color Sensors.Thanks!

_________________
FTC 7104 - The Synergists


Fri Feb 20, 2015 3:07 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: SMUX and IR/Lego Color/Lego Ultrasonic/Gyro
The HT Color Sensor is far superior to the LEGO Color Sensor.

= 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 Feb 20, 2015 4:14 pm
Profile WWW
Expert
User avatar

Joined: Sun Aug 19, 2007 2:43 pm
Posts: 156
Location: New Jersey
Post Re: SMUX and IR/Lego Color/Lego Ultrasonic/Gyro
mightor wrote:
The HT Color Sensor is far superior to the LEGO Color Sensor.

= Xander


Could you clarify as how that is superior. I suspect nxt color is much slower.. I just tested it on the EV3 with RobotC 4.30:

Code:
void getXRGB (tSensors port,  long *red, long *green, long *blue)
{
   SensorType[port] = sensorColorNxtGREEN;   
   SensorMode[port] =    modeNXTColor_Raw;
   delay(350);
   *green = SensorValue[port];
   
   SensorType[port] = sensorColorNxtRED;
   SensorMode[port] =    modeNXTColor_Raw;
   delay(350);
   *red = SensorValue[port];
   
   SensorType[port] = sensorColorNxtBLUE;   
   SensorMode[port] =    modeNXTColor_Raw;
    delay(350);
   *blue = SensorValue[port];
   
}


350 msec to switch.. yike!!! I tried 300, no luck. It was simply too short. That makes the color sensor almost unusable if i do need R,G,B values .

How much faster with HiTechnic?

I tried with EV3 color, it takes about 20msec inbetween refresh in order to getColorRGB(...) to get me good values.

_________________
==Elizabeth Mabrey


Mon Mar 02, 2015 3:43 pm
Profile WWW
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: SMUX and IR/Lego Color/Lego Ultrasonic/Gyro
There is currently no way to get the RGB data from the LEGO NXT Color sensor in one go, the functionality was not implemented. I tried to fabricate a work-around for you, but the firmware is not accepting the unimplemented mode. I had hoped to be able to use some low-level functionality to fetch the datasets through other means, alas, t'was not to be.

The LEGO Color Sensor is in fact MUCH faster than the HT one, but it can only detect about 6 colours. The HT one can detect 17 of them. Philo did a nice comparison on his page: http://www.philohome.com/colcomp/cc.htm

I saw your mail to Tim :)

= 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]


Mon Mar 02, 2015 4:17 pm
Profile WWW
Expert
User avatar

Joined: Sun Aug 19, 2007 2:43 pm
Posts: 156
Location: New Jersey
Post Re: SMUX and IR/Lego Color/Lego Ultrasonic/Gyro
6 colors.. yes if the kids just uses the cooked data. I am showing them the knowledge of RGB (0xff, 0xff, 0xff), and gets as robust values as possible by analyzing the 255, 255, 255 ranges.

This is rather urgent just because they are going for the RCJ /USA in April. NXT kids will just have to put that RGB probing in the background for the time being... not ideal, but will have to do. Or, try the Hitechnic one.. just that they all have already had 2 nxt color sensors ...I am trying to help them saving money there. :-)

The biggest issue is the green. The game rule does not provide a range of Green shade... just say green!!!! I can get a typical green tape from Lowes, and read black.. but with RGB, they can tell it is actually still green.

_________________
==Elizabeth Mabrey


Mon Mar 02, 2015 4:29 pm
Profile WWW
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: SMUX and IR/Lego Color/Lego Ultrasonic/Gyro
If you use the HT one, you can use my driver suite to get the RGB values :)

= 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]


Mon Mar 02, 2015 4:35 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 10 posts ] 

Who is online

Users browsing this forum: No registered users 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.