LabVIEW for LEGO MINDSTORMS and LabVIEW for Education

cancel
Showing results for 
Search instead for 
Did you mean: 

HiTechnic IRSeekerV2 VI

Solved!
Go to solution

Hello again!

 

Does anyone worked with this VI ?? I cannot read any value from the sensor when executing it. Obviously, the VI is placed inside a While loop structure to get values continously.

 

Thanks for your help!

Francisco José Gómez López
Software Engineer
0 Kudos
Message 1 of 11
(8,244 Views)

Hi Francisco,

 

     Could you pleasse post the VI or provide some link to download it? I'd like to have a look at its block diagram. Thanks in advance.

 

Regards,

David Oña
0 Kudos
Message 2 of 11
(8,235 Views)

Hi David,

 

You can download this VI from here: http://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action&key=NSK1042

I use it inside a while loop structure and with a constant input and some indicators. I run the new VI in a debug mode, executing a NXT[USB] instance of the VI

Francisco José Gómez López
Software Engineer
0 Kudos
Message 3 of 11
(8,226 Views)

We use them all of the time.  The code from HiTechnic is for the older NXT toolkit.  For the new LabView 2009 NXT module, The sensor is supported natively.

It is under NXTIO-additional Sensors.  It works fine.

 

I usually have a case structure set up for T/F on the detected output, and use the direction output for Steering.  Works fine.

 

For the older toolkit, copy the sensor under the vi.lib/addons directory.  It will appear under the function pallet.

 

Good luck

0 Kudos
Message 4 of 11
(8,211 Views)

Hi again!

 

I've found the native VI for the HiTechnique sensor, but I have problems with the output values for sensor stenghts. The VI i've just created for using the native VI doesn't show any value from the sensor, so the robot keep on steering all the time. The VI shows the this outputs disabled.

 

Do you have any example of how to use this VI?

 

Thanks!

Francisco José Gómez López
Software Engineer
0 Kudos
Message 5 of 11
(8,186 Views)

Well, it was my fault actually, because I didn't connect the appropriate port number. But still, I can't read the strengths values ...

Francisco José Gómez López
Software Engineer
0 Kudos
Message 6 of 11
(8,178 Views)

The only trick that I know is that since the outputs are a cluster, you need to split them before using.  The direction output is an interger, and the detected output is a T/F

 

My normal class demo is

 

While loop -> IR Seaker -> Case (T/F wired to detected)

 

Case False is Spin

 

Case True is (Direction-5)*3 wired into the stering input of the Stering Motor VI. 

 

It will chase the IR ball OK.  Better math on the steering works better,

 

I hope that helps

0 Kudos
Message 7 of 11
(8,175 Views)

Yeah! Now it works, following your steps. I supose that the (Distance-5)*3 is the "power" input to the steering value. And I supose that I can multiply this (Distance-5) per any value, right?

 

Thanks for your help!

Francisco José Gómez López
Software Engineer
0 Kudos
Message 8 of 11
(8,172 Views)
Solution
Accepted by topic author fran_jo

On the Motor Steering VI (Located under NXTIO-Complete-Motors) you pass in a steering input and a power.  Steering of 0 makes the motors go straight(It uses the rotation encorders to adjust power)  Positive turns one way, and negative turns the other.  A steering input of +/-100 will spin in place.

 

And yes, the multiplier is determined experimentally.  Ideally I would like to use a power law (2^difference) but I have not made that work.

 

If you really want control, you can set up a 9 way case statement and customize each case. 

 

Good luck and glad I could help.

0 Kudos
Message 9 of 11
(8,167 Views)

AP from NJ,

 

Since the code from HiTechnic is also for the toolkit, do you know how to use HiTechnic Color Sensor with LabVIEW 2009 NXT module?

 

 

Many thanks,

John

0 Kudos
Message 10 of 11
(7,881 Views)