Lego Mindstorms – Remote Control                        (A tutorial by Technotutorz)

Lego Mindstorms does not have a remote control as standard. It is however possible to develop a system that will enable you to control your NXT remotely without using Bluetooth. This can be a fun activity for anyone, even very young children.

 

It can be done with a standard SONY® playstation 2 controller (or any other PS2 compatible remote control/joystick)) with a PSP-Nx,  a digital interface from www.mindsensors.com. In New Zealand this is distributed by www.robokits.co.nz.

 

The standard parts used for this tutorial were:

1.       Lego Mindstorms NXT 2.0

2.       Wireless joystick – Dream gear Magna Force (www.dreamgear.net) – DGPN-557

3.       Sony PlayStation 2 Controller interface for NXT (PSP-Nx)

 

Robokits will have all the required code on their product software library site. I had the older version of the PSP-Nx and I used an older version of the NXT-G block. The PSP-Nx (v2 and v3) should work with the G-block available on the Robokits site.


 

The following are step by step instructions to help you create your own remote control Mindstorms.

1.       Build up a standard Lego Mindstorm Robot and add the PSP-Nx interface as shown.

                See the PSP-Nx-v3 User Guide.

DSC00006.JPG DSC00011.JPG

                               

1.       Download the appropriate PSP-Nx NXT-G block from http://www.robokits.co.nz/product_software_library or http://www.mindsensors.com/

2.       Open Lego Minstorms NXT 2.0 Software. Go to Tools - > Block Import and Export Wizard.


3.       Browse for the path to the downloaded PSP-Nx  NXT-G block and press import.

                        Make sure you add the new file to the Advanced palette.

 



4.       Close the above window and go to the Advanced Palette and choose PSPNx PS2 Controller.

Now you are ready to start writing your program.

 

5.      

Create the MyBlock code for MoveMotorA and MoveMotorC:

The code uses the Right-Y and Left-Y outputs from the PS2 controller. The values vary from -100 to 100 and are control via the joysticks’ Y-direction. These values are used to set the power on each motor.

·         -100 to -1 -> Backward

·         0 -> Stop

·         1 to 100 -> Forward

 

                MoveMotorA and MoveMotorC are custom MyBlocks.

 

6.       The final code looks as follows.

 

 

You can download the files here.

 

Katana Dunn