| 1 | |
| 2 | == Mechanical and Electrical Architecture == |
| 3 | |
| 4 | The WAM Arm is modular and comes in three major configurations: 4-DOF (degrees of freedom), 7-DOF with a Wrist, and 7-DOF with Gimbals. Both the 4-DOF and 7-DOF with Wrist configurations have a tool-plate at the end that supports attaching a BarrettHand, Barrett's 6-axis Force/Torque Sensor, and customer-designed tools and sensors. |
| 5 | |
| 6 | NOTE: |
| 7 | There are several different models of the BarrettHand; this guide only deals with the newer BH8-280 model. The base of the BH8-280 is blue, while older models are gold or black. Before plugging a BH8-280 into a WAM, make sure that the WAM's wiring is 280-compatible. (Contact support@barrett.com for information about upgrading an older WAM to be 280-compatible.) |
| 8 | |
| 9 | Both the Hand and the WAM make use of Barrett's proprietary brushless DC motor controllers, known as Pucks. Each Puck is mounted to the back of the motor it controls and contains: |
| 10 | * A magnetic encoder for sensing the angle of the motor shaft |
| 11 | * Power electronics for regulating motor current |
| 12 | * A 32-bit DSP for communications and control |
| 13 | The Puck is very good at performing high-precision current control. Since the current flowing through a motor's windings is proportional to the torque that is applied to the motor shaft, the Pucks allow a user to apply any desired motor torque. |
| 14 | |
| 15 | When paired with the WAM's unique cable transmissions, the Pucks make the robot inherently torque controlled. Traditional transmissions made with gears have either high friction or significant backlash; it is a fundamental design trade-off. Both friction and backlash interfere with the clean transmission of torques between a joint and its motor. The WAM has very low friction and no backlash; as a result, a motor torque is (to a good approximation) proportional to a joint torque. This property is often referred to as “backdrivability”. |
| 16 | |
| 17 | All of the Pucks in a WAM (one on each motor) communicate with a Control PC over CANbus in order to receive torque commands and report motor angles. When running the WAM, customers typically use the PC/104 computer inside the base of the robot as the Control PC. However, if a more powerful computer is needed, it's also possible to use an external computer equipped with a CAN card. |
| 18 | |
| 19 | |
| 20 | == Safety Architecture == |
| 21 | |
| 22 | Since the WAM is intended to interact with humans, safety has always been a key driver in the design. While the WAM is in operation, its behavior is continuously monitored by the Safety Module, a dedicated embedded system housed inside the base of the robot. |
| 23 | |
| 24 | The Safety Module monitors: |
| 25 | * The velocity of the WAM's end point (Velocity fault) |
| 26 | * The velocity of the WAM's elbow (Velocity fault) |
| 27 | * The torques being commanded by the control program (Torque fault) |
| 28 | * The amount of power being drawn/generated by the system as a whole (Voltage fault) |
| 29 | * The health of the control program and Puck motor controllers (Heartbeat fault) |
| 30 | * The state of the E-stop buttons (Other fault) |
| 31 | |
| 32 | If a fault condition is detected, the Safety Module will shut the robot down. The particular fault that occurred will be indicated by a red LED on the WAM's Control and Display Pendants. Specific information about the fault will be shown on the Pendants' 7-segment numeric displays. |
| 33 | |
| 34 | The Safety Module has three states: Active, Idle, and E-stopped. When the WAM is Active, the illuminated green button on the Control Pendant labeled “Activate” will be lit. When the WAM is Idle, the illuminated yellow button on the Control Pendant labeled “Reset/Idle” will be lit. When the WAM is E-stopped, both the “Activate” and “Reset/Idle” button lights will be off. |
| 35 | |
| 36 | In the Active state, the Pucks are allowed to push current through the motors, thus applying system torques. In both of the other states, the WAM is held in a “resistive braking” mode. This mode uses the motors to passively oppose all motion without completely locking the joints in place. The resistive braking mode is designed to promptly stop the robot without damaging the system and without trapping a person who may be pinned by the arm. |
| 37 | |
| 38 | In the Idle state, the Pucks ignore all torque commands and instead perform the resistive breaking function. In the E-stopped state, all power to the Pucks is turned off and the resistive breaking mode is enforced by the Safety Module itself. |
| 39 | |
| 40 | There are two different classes of safety faults. “Soft faults” (such as Torque faults and most Velocity faults) trigger a transition to the Idle state; this strategy is used when the fault is likely due to environmental conditions, controls problems, or certain kinds of bugs in the control program. “Hard faults” (such as Heartbeat faults) trigger a transition to the E-stopped state; this strategy is used when the integrity of the Pucks themselves is in question. A soft fault is less disruptive than a hard fault because the Pucks don't lose track of their corresponding motors' encoder position (their power is not disrupted). In contrast, the WAM must be re-homed following a hard fault. |
| 41 | |
| 42 | |
| 43 | |
| 44 | == Software Architecture == |
| 45 | |
| 46 | In addition to having a CAN card, it is necessary for the Control PC to use a real time operating system. A normal computer operating system does not make any guarantees about when a particular program will be allowed to execute. If the operating system decided, for example, to write a large chunk of data out to the hard disk, it could be 10s or 100s of milliseconds before the program controlling the WAM regained control of the processor. During that entire period, the Pucks would continue to apply the last commanded torque. A person interacting with the robot would feel the arm jerk slightly when the WAM program issued large correctional torques to compensate for the drift that had occurred during the uncontrolled time. Under certain conditions, the robot might even become unstable (though the Safety Module is designed to detect this condition). For proper operation of the WAM, it's very important for the Pucks to receive their torque commands on time. |
| 47 | |
| 48 | Barrett uses the Xenomai real time co-kernel in conjunction with the Ubuntu Linux distribution to form a real time operating system. Essentially, Xenomai allows the programmer to create a thread of execution that has a higher priority than all of Linux. Xenomai is also very careful about how it handles CPU interrupt requests. |
| 49 | |
| 50 | NOTE: |
| 51 | Xenomai integrates very closely with a computer's specific hardware. It is sensitive to implementation details that are irrelevant to normal operating systems. It is often the case that information about these details is not published by computer equipment manufacturers. The implementation may even change across different revisions of the “same” product! It is not always possible to use a given computer to run the WAM. Because of this, Barrett strongly recommends using either the WAM's internal PC/104 or a pre-configured computer supplied by Barrett. |
| 52 | |
| 53 | Unfortunately, this real time functionality comes at a cost: there are many common operations that are not allowed in a real time thread. Forbidden operations include: |
| 54 | * Printing text to the screen |
| 55 | * Writing to a file |
| 56 | * Communicating over a socket (even in non-blocking mode) |
| 57 | * Using the malloc() function in C or C++ |
| 58 | * Using the new operator in C++ |
| 59 | |
| 60 | The requested action will still be performed if one of these features is used in a real time thread, but the thread will automatically drop from “primary mode” into “secondary mode”. A Xenomai thread running in primary mode is a real time thread. A Xenomai thread running in secondary mode behaves like a normal Linux thread; it does not make a real time guarantee. It is important to structure a WAM control program such that the real time sections do not use these forbidden operations. |
| 61 | |
| 62 | Almost all programs that run the WAM share the following structure: |
| 63 | 1. Look on the CANbus to identify the configuration of the WAM and any other products that are present |
| 64 | 1. Initialize the products |
| 65 | 1. Start a real time control thread that does the following tasks once every 2 milliseconds: |
| 66 | 1. Ask the WAM Pucks to report their motor angles |
| 67 | 1. Use the measured motor angles to calculate joint angles |
| 68 | 1. Perform some calculations that result in a set of desired joint torques |
| 69 | 1. Use the desired joint torques to calculate motor torques |
| 70 | 1. Command the WAM Pucks to apply the desired motor torques |
| 71 | 1. Sleep for the remainder of the loop period |
| 72 | 1. In the original (non-real time) thread, produce different WAM behaviors as desired by instructing the control thread to perform different joint torque calculations |
| 73 | |
| 74 | Any number of joint torque calculations are possible, and any behavior that the WAM is capable of can be defined in terms of a joint torque calculation. This is true because, fundamentally, the WAM is only capable of sensing motor angles and applying motor torques. |
| 75 | |
| 76 | The calculation can make use of any information available to the control program, such as joint angles, user input, or data received over the network. However, there is an important caveat to the previous statement: Since the calculation must be done in real time, the data that the calculation relies on must be available in real time. Programmers must be very careful to mediate the exchange of data between the control thread and other non-real time threads in a way that avoids making the control thread wait for data from a non-real time source. |