Alpha Rex Rbt Program

LinPlug Alpha AU 2.2.2v is a very tractable and powerful program which features an easy to learn subtractive design with special attention being paid to recreating the warmth and feel typically found in early-1980s analog synthesizers.The Alpha. Alpha Rex Robot Type: Humanoid - What this robot can do: Alpha Rex performs tasks that only the most sophisticated robots can do. Walk on two legs like a real person! With built in rotation sensors on the two Servo Motors powering his legs, and an Ultrasonic Sensor nabling Alpha Rex to see, you can program Alpha Rex to go where you want with.

Alpha Rex Rbt Program Login

Introduction

The Alpha Rex comprises probably the most complex of the RoboCenter series of robots, both from the mechanical design perspective and the software programming perspective. The following discussion will concentrate on software programming of the Alpha Rex. The program described below illustrates two advanced programming techniques: state machines and abstraction. A state machine design handles basic movements such as tilting side to side and striding the robot's feet forward and backward. Abstraction handles combining the basic movements into more complex movements, such as walking forward and turning right and left.

The inspiration for this program comes mainly from sources other than the Mindstorms RoboCenter software examples for the Alpha Rex. The RoboCenter examples perform basic movements such as walking forward and turning. However the examples are rather inadequate when it comes to combining basic movements into more complex movements, such as having your Alpha Rex move in a figure eight pattern. Furthermore, including such functionality as having the Alpha Rex walk around avoiding obstacles behooves the application of more advanced programming techniques.

The following sections describe these techniques in much more detail. The final section, following the description of these techniques, presents the development of a complete program for avoiding obstacles.

Basic Movements - State Machine Approach

The Alpha Rex mechanical design falls into a category referred to by robotics hobbyists as a toddler biped. Generally speaking a toddler robot uses only two servos for movement, like the Alpha Rex. One servo shifts the robot's weight from one foot to the other foot. The other servo moves the feet backward and forward. Efficiency and economy in programming dictates that these basic movements link together seamlessly to provide more complex movements, such as walking forward, or turning right. Seamless movement, from a programming perspective, requires that movements do not depend on other movements.

Seamless movement means that a composite movement, such as tilting left and moving the right foot forward, may be combined together without the programmer needing to concern themselves with the details of servo position, direction of rotation, and amount of rotation. The composite movement routines, described below, make use of two basic building blocks: a routine for tilting the robot side to side, and a routine to move the robot's feet back and forth.

For a complete discussion on how these two movements can be combined into composite movements see pages 33-37, 56-57, and 65-66 of the Parallax manualAdvanced Robotics with the Toddler, by Bill Wong and Ken Gracey. The reader is pointed to the above reference for a detailed understanding of toddler movements, and since the Alpha Rex is a toddler type robot these considerations apply. I highly recommend reading the above pages before continuing with the rest of this discussion.

Dottail.zip - This zip contains a simple NXC program written by Carl Sturmer which uses arrays and drawing routines. It draws a dot with a tail on the NXT screen. I think it is pretty cool. Alpharexnxc.zip - This zip contains a really great program written for the NXT Alpha Rex robot in NXC. Graham Hawkins (grahamhawkins@yahoo.##spam##off. Alpha Rex Program Rbt Download Free Apps On My Iphone Nxt Program Alpha Rex download free, software. Find all the latest LEGO MINDSTORMS downloads including software, apps, firmware updates, user guides, building instructions, developer kits and wallpapers. Manufacturing defense products for over 20 years and machining firearms parts since 2005—the Arex Rex Zero 1 pistol is a breakthrough from a proven name in European defense manufacturing Evolving from the tool department of the former Iskra company in Slovenia, Arex is naturally adept at the fine craftsmanship necessary to produce high.

Tilting from Side to Side

Alpha Rex Rbt Program Application

The C motor (plugged into port C) moves the robot from side to side. Unlike the RoboCenter example, the following subroutine uses the C motor as a servo (as opposed to a simple motor). Using a motor as a servo means that the primary function of the motor is to move, or actuate a lever arm over a limited distance (or travel). Moving a limited distance means that the motor does not rotate an unlimited amount, rather the motor rotates only that amount necessary to move the lever, or connected mechanical component the required amount. In the case of the Alpha Rex the components are the robot's two legs, which have two degrees of freedom in the way they can move: shifting the weight of the robot from one leg to the other, and moving one leg forward at the same time moving the other leg backward. The rotation sensors built into the NXT motors allow them to work very nicely as servo motors.

Tilting the Alpha Rex side to side may be broken down into nine separate cases defining the C motor action necessary to implement a basic movement. The following table lists these cases, or states. The first column provides a numerical identifier that the software can use to identify each possible state. The second column gives the movement from the previous position to the new position, such as the robot moving from tilting to the right to tilting to the left. The last two columns describe the required C motor action to perform the movement in the second column. You will note included in the table certain trivial movements, such as moving center to center. These are essentially 'do nothing' states that may occur because a previous movement left us in the state in which we already desire to be.

Table 1
StateMovementNumber of
Rotations
Direction of
Rotation
0Center to Centernonenone
1Right to Center0.75
2Left to Center0.75
3Center to Right0.75
4Right to Rightnonenone
5Left to Right1.5
6Center to Left0.75
7Right to Left1.5
8Left to Leftnonenone

The tilt subroutine makes use of a single state variable to contain the previous position state of the robot: left, right, or center. Table 2 associates each of three possible tilt movements and tilt states (previous position) with a unique identifier number.

Table 2
ID#MovementPrevious Position
0Tilt back to the center positionCenter
1Tilt to the robot's right sideRight tilt
2Tilt to the robot's left sideLeft tilt

Thus the most previous position may be represented by a number 0, 1, or 2. And the new movement we are about to perform by a number 0, 1, or 2. Hence we may use a simple formula for determining the state in table 1 above: State ID equals three times the new movement plus the previous position, or

StateID = 3 * NM + PP
where StateID is the State ID in table 1,
NM, the new movement, and
PP, the pervious position

For example, if the previous position is “center” and we want to tilt left, then

StateID = 3 * 2 + 0 = 6

Looking at table 1, the associated movement (in the same row) as StateID 6 is 'center to left', as expected.

The NXT-G code shown below implements the tilt subroutine. The code uses a state variable 'Tilt_Previous' to maintain the previous tilt position of the robot. A switch statement handles all the cases in table 1. The subroutine has only one input parameter: one of the numbers from the first column of table 2. Hence, when using this subroutine as a My Block we only need to know what tilt position we wish the robot to assume: left, center, or right. We do not need to know anything about the servo positions or how to move them. This abstraction removes these details from the programmer who uses the tilt subroutine in a higher level program.

Striding Forward and Backwards

The B motor (plugged into port B) moves the Alpha Rex feet forward and backward. The development of the striding subroutine follows very closely the development of the tilting subroutine described above. Similar to tilting the robot side to side, moving the robot's feet backward and forward may be broken down into nine separate cases as shown in table 3.

The first column gives the State ID used by the software. The second column gives the movement of the robot's feet. To understand the movement column, think of the movement as saying which foot in front has to move to a new position. For example, 'right to center' means that the right foot has to move from in front to the center position directly below the robot. 'Left to right' means that the left foot has to move from in front to the rear of the robot. 'Right to left' means that the right foot has to move from in front to the rear of the robot. Keep in mind that the feet move concurrently. That is, when the right foot moves forward, to the front of the robot, the left foot moves, simultaneously, to the rear of the robot. The last two columns describe the required B motor action to perform the movement in the second column.

Table 3
StateMovementNumber of
Rotations
Direction of
Rotation
0Center to Centernonenone
1Right to Center0.75
2Left to Center0.75
3Center to Right0.75
4Right to Rightnonenone
5Left to Right1.5
6Center to Left0.75
7Right to Left1.5
8Left to Leftnonenone

Similar to the tilt subroutine, the stride subroutine makes use of a single state variable to contain the previous stride state of the robot: left foot forward, right foot forward, or both feet in the center position. Table 3 associates each of three possible stride movements and stride positions with a unique number.

Table 4
ID#New MovementPrevious Position
0Both feet to the center positionFeet centered
1Right foot to forward position, left backRight foot forward, left back
2Left foot to forward position, right backLeft foot forward, right back

Similar to the tilt subroutine, we may use a simple formula for determining the state in table 3 above: State ID equals three times the new movement plus the previous position, or

Rex
StateID = 3 * NM + PP
where StateID is the state ID in table 3,
NM, the new movement, and
PP, the previous movement

The NXT-G code shown below is very similar to the tilt subroutine. The code uses a state variable 'Stride_Previous' to maintain the previous stride position of the robot. A switch statement handles all the cases in table 3. The subroutine has only one input parameter: one of the numbers from the first column of table 4. Hence, when using this subroutine as a My Block we only need to know what stride position we wish the robot to assume: left foot forward, both feet centered, or right foot forward.

Composite Movements

Walking forward and backward, turning from left to right and right to left may be accomplished by simply combining together tilt and stride My Blocks in the correct sequence. For example, to walk forward we must accomplish the following: tilt left, move right foot forward, tilt right, move left foot forward. Conversely we may walk forward by: tilting right, moving the left foot forward, tilting left, and moving the right foot forward. The NXT-G code for walking forward is shown below.

Turning the Alpha Rex involves an added principle: friction. That is, the robot does not so much turn as it pivots. It pivots by centering its weight over both feet (center tilt position) and moving one foot forward and the other backward. For example, if the right foot moves from the forward position to rear position (concurrently the left foot moves forward), the robot will pivot to the left.

Scanning for obstacles

The Alpha Rex uses motor A to both move the robot's arms up and down (rather functionally useless) and for panning the ultra-sonic (US) sensor back and forth. The NXT-G subroutine shown below rotates the US sensor to the left and takes a reading, then it rotates the US sensor to the right and takes a reading. The readings are stored in two variables: one for the left reading and one for the right reading. The main program uses these readings to determine what to do when the US sensor 'sees' an obstacle in front of the Alpha Rex. You may note that the NXT-G code inserts a pause between the motor block and the read US sensor block. This pause allows the mechanical movement of the US sensor to stabilize before the sensor gets read, thus increasing the reliability of the reading.

Avoiding obstacles

Alpha rex rbt program reviews

The NXT-G code shown below ties all the ideas and code previously discussed into a practical program for the Alpha Rex. The code below comprises the main routine programmed into the Alpha Rex. In software parlance the main routine sometimes gets referred to as the 'executive routine' or the program 'entry point', because this where the program first starts when executed.

The program works by first executing the 'AR_US_Scan' My Block. The execution of this block stores the reading from the US sensor, taken when pointed to the left, in the variable US_Reading_L. Conversely, the reading from the right gets stored in US_Reading_R. The main routine then checks to see if either reading indicates that the robot sees an obstacle closer than 15 inches. If so, then the program compares the two readings to determine whether the robot has seen the obstacle to its left or right side. If the robot sees the obstacle to its right, then it turns left to avoid the obstacle. Conversely if the robot sees the obstacle to its left, then it turns right to avoid the obstacle. If the robot does not see an obstacle on either side, then it walks forward.

The AR_US_Scan My Block and the movement My Blocks indeed hide a great deal of painstaking complexity from the programmer creating the code for the main routine. He does not need to know the details of how the sensor works or takes its reading. He does not need to know the details of how to make the robot walk or turn. He only needs to drop the appropriate My Block in the correct position. By now you should be able to see the power of abstraction in software design. Abstraction eliminates the need to know the details and makes the code very simple and straight forward.

Alpha Rex Rbt Program Near Me


(click on image for enlarged view

Tip: If the robot moves exactly opposite from the manner that you expect, then manually rotate the relevant motor shaft 180 degrees. Also, before running the program, make sure that the robot's feet are positioned dead center below the robot. You may have to adjust both motor C and motor B drive shafts.

References

  • Advanced Robotics with the Toddler, by Bill Wong and Ken Gracey

Source Code Files

Alpha Rex Rbt Program Reviews