Nxt 4 axis robot 3000


Main part program - balancing task Here is the main part of the NXC program. It contains only the basis functions for a Segway bot: It runs about cycles per second.

Body angel In line 12 the body angel is calculated just by adding the Gyro value to all the previous Gyro values.

If you wish to use small NXT wheels part no: Friction compensation An other value you can change is the friction compensation in line You may need to reduce this value a bit. In the video above I use a value of When you decrease the friction compensation to 42 the bot will become more instable and moves further for- and backward: If you decrease the friction value to 38 it will fall: If you increase the friction value to 46 the bot is much more stable: But if you increase the value to 52 it move to quick for- and backward and it will fall: The optimum value of my bot seems to be You can download the program without PSP remote control here: The controller has two analog joysticks and 16 buttons, using this interface, values of all 16 buttons and joysticks can be read by the NXT over the wireless link.

It reads out and displays the joystick values. It runs until the finshes its last statement in line The whole task takes about 35 ms. To control the NXTway-gyro bot I use the left joystick. The X-axe value line 25 and 35 controls the sidewards direction. The NXTway-gyro bot turns by moving the wheels in opposite directions line 19a and 19b , depending of the variable 't'. This shouldn't change the body angel and therefor the wheel position measured in line 13 depends on both wheels.

This is because the NXT processor must process two tasks at the same time. It is important that the balacing task runs cycles per second no matter what. The variable t1 determine the number of ms delay line 20j. Notice that in the orginal program nxtway-gyro. Don't forget to download the PSP-Nx-lib. Here is a video with my NXTway-gyro performing on a tilt surface: You can see that the bot has no problem to run over slope table. I suggest you to try it out! Tiny Duino Tiny Lily.

Adapters Hardware Adapters Mechanical Adapters. Ethernet Wi-Fi Bluetooth Duo. Now you can make robots that know which way is up! It also measures tilt along each axis. Great for experimenting with acceleration forces in cars, on amusement rides, even on swing sets. This sensor will also tell you if your robot is level so you can build self-leveling robots and much more.

The NXT Acceleration Sensor contains a three axis accelerometer that measures acceleration in three axes, x, y and z. The acceleration measurement for each axis is refreshed approximately times per second. The Acceleration Sensor can also be used to measure tilt in three axes. This is possible because gravity is perceived as acceleration. When the sensor is stationary and in the normal horizontal position, the x and y axis will be near zero, because they are horizontal, while the z axis will be near , which represents one g.

If you tilt the sensor then gravity will also be detected on the other axis and the value for the z axis will go down.