It took me a whole day to assemble it according to Lego's documentation. As soon as you power up and run Alpha Rex, you might be disappointed by its slow and clumpsy walking movements (we have impressions from Terminator, iRobot...). Anyway, playing the Mindstorm robot set is more than just assembly>download program>press run, there are quite a lot to learn from the design and programming, and below are some of my observations during the assembly/test process:
The assembly instructions could be found inside the NXT software interface, or can be downloaded from Lego Education web site, under the 'NXT Models' tab. The first time when I came across those steps which requires axles, I did not know which one its number refers to, later I found that this was specified at the back cover of the printed manual that came with the Minstorm set.
There are a lot to learn in the walking mechanism of Alpha Rex. Its legs seems to be most complicated in the building process. The purpose of the two motors (namely B and C motors, according to their connection to the output port of NXT) is to control the stride and tilt of both legs.
At first glance, one might misunderstood as if one motor for left leg and another one for the right. Thanks to Jeff Owrey's article "Alpha Rex Avoiding Obstacles" on bNXT which explains the theory on how the toddler-like robot walks: B motor for stride and C motor for tilt. As only one motor is used for both legs, when one leg is moving forward, the other will move backward simultaneously, and vice versa.
As a result, if only the B motor is powered, both feet will touch ground at the same time and it will not walk properly, the C motor then come to rescue, it shifts the weight to one foot and reduce the loading of the other foot which is striding.
In order to walk forward, the robot has to tilt to the left, stride its right foot forward, tilt to the right and then stride its left foot forward, and then repeat the whole cycle. If you look closely on the 'foot' portion, when the leg tilt to the left, the right foot is slightly off the ground. This allows the 'raised' foot to stride forward with less friction, which is the main purpose of the tilt action. Actually, the current design of Alpha Rex does not allow too much raising of the foot from ground, you will still see its outer part a bit touching the ground.
To turn around, say, towards the left, the robot has to tilt the leg to right, stride forward the left foot, tilt back to center and then stride backward the left foot. The actual rotation happens at the last action, where the body is center tilt and both feet strides in opposite direction. This process has to be done several times as only a fraction of turning happens in each cycle.
It is also interesting to see that the current mechanism tilt the body to left when the legs tilt right, as opposed to what we expect (tilting the whole robot to one side). The body is pivoted in the NXT block bottom center and pulled by the linkage on both sides which is connected to the gears of C motor.
In my opinion, this arrangment looks stylish when walking but technically not correct. So, I modified it a bit by connecting the ball joint rods to leg directly. As a result, the Alpha Rex shift its body weight to right when the C motor cause the leg to tilt right. I can see that the striding foot raises more off the ground.
It could be difficult to observe the walking motion when the robot is moving around, the method I used is to switch off the robot and insert an axle part in the motor axis (see picture), then manually rotate it and see how it works. According to Jeff Owrey's article, the motor rotates 270 degrees reverse direction (an arrow pointing downwards means motor reverse rotation) when moving from right to center, another 270 degrees when center to left... etc. You can verify the rotation direction in the help section of NXT software, under the 'motor block' topic.
Another way to observe the legs motion is to reduce the power of the motors, so they rotate slowly and you can study the motions more easily.
When using Jeff Owrey's program to test the walking cycle, it is important to 'center' the walking mechanism before start running. This is because the current robot has no means to reset itself to an initial condition and it does not know where it start from. Without initializing the mechanism, you may end up having the robot walking in a weird way or even in the opposite direction.
To initialize it manually, use the key to rotate the B motor until both feet aligns, which is the center position, and make sure that when you rotate it, hold the NXT body with one hand so that both feet hangs freely from the floor. In the same way, you may have to adjust the C motor manually to center the tilt. For the A motor, you can turn the motor with fingers and center it.
If the robot walks backwards after centering, you will need to turn the B motor with the key one cycle (e.g. turn it until the foot comes back to the same position again).
When assembling the legs, I found a small part which is required in the left leg, it seems that the rubber part is for adding fiction to the leg, but I wonder why the instruction told us to put on left leg only, if you know the reason, please tell me.
Next, we look at the A motor, it powers the rotation of the ultrasonic sensor and both arms. The ultrasonic sensor panned between left and right to check for obstacles. The arms swing by rocking the linkages connected to the gears.
To swing more naturally (one swing forwards while the other backwards), connect the black short linkage in opposite direction. Arms swinging are for visual pleasing only, it is of no functional purpose.
I programmed the Alpha Rex using the subroutines from Jeff Owrey's toddler walking program. The following feature is implemented:
- Robot walk and detect obstacle at the same time (not very accurate, but I would prefer it walking continuously instead of periodic start stop).
- If obstacle within a certain distance is detected, it walks backwards and turn 90 degs, which direction it turns is randomly generated.
- The light sensor is used to detect low ambient light, if light level is low, it will also walk backwards and turn so as to avoid running into dark corners (or under table). I have mounted the light sensor pointing upwards to detect light.
- The touch sensor is used to toggle start/stop, it starts the walking process after one press, and when press again (or it bumps into something), it will start the go back and turn process.
- The sound sensor feedback 3 levels of output, for ambient (quiet) level, the robot keeps exploring the surrounding, at a noisy level, such as turn up your Hi Fi's speaker volume, it will dance, when the sound level is further increased, it will stop all actions.
The program can be downloaded here, for those blocks that required Jeff Owrey's routine, you can download from bNXT site. Disclaimer: The program may have bugs and Meow the mechanic is not resposible for any damage or injury for using it.
Limitations on the Alpha Rex robot / NXT hardware and software:
- Need a rechargable battery pack and transformer. The NXT draw a lot of power and even those high power batteries run out of power quickly, and is very inconvinient to dismount those mechanism on the back of Alpha Rex to replace batteries. If I have the rechargable battery pack and transformer, I can charge it by pluggin a wire instead of disassemble those things.
- The mechanism in the feet are so closely packed so that they are rubbing each other while walking, something I do not feel comfortable.
- The legs are still touching the floor when strides, so, it is not capable to climb an inclined plane.
- As the whole robot is made of plastic Lego technic parts, it is not very rigid, loose parts, backlash and friction between foot and floor introduce errors and thus reduce its accuracies while walking (not walking straight lines).
- As we mainly use the ultrasonic sensor for obstacle detection, any obstacle lower than the height of the sensor is not detected, the robot may tumble upon such objects.
- While using the NXT visual programming enviornment (NXT-G), I frequently came upon the error "Insane Object at BDHP...." when saving, to avoid corrupting the file, I save each time after I make a change, in case the error comes out again, I revert back to the previous saved file. This is very inconvinient, hope that the bug can be fixed soon. There are some fix you can found here when dealing with NXT-G bugs: http://forums.nxtasy.org/index.php?s=8a853ebd28ca1a2af5b188b9590c9afe&showtopic=178&st=0
- The NXT-G becomes very slow when more blocks are added to the program, this may due to using Flash vector graphics in the interface. Sometimes it just hangs there for a minute (CPU 100% utilization). I hope this can be improved, or I have to look for some other programming environment like Microsoft Robotics Studio. It waste a lot of time waiting, and I think responsiveness is more important then just looking fancy.