Eva Linear Rail Documentation
Theory of Operation
The Eva Linear Rail combines an Automata Eva robot arm with a 2m linear rail to allow for a much larger combined work area. From the end user perspective all control is done through the Eva arm and it’s API, using a modified version of the ArmBot class. The regular ArmBot class wraps the Eva API for ease of use, adding in the relevant kinematics. The modified version adds functions to home the rail, and send the rail to an absolute position along its travel, with a view to this eventually being integrated into the kinematics, creating a single unified area of operation.
The Eva’s I/O ports are used to communicate with the motor control system for the rail. The Eva has 4 each of digital inputs and output, and 2 each of analog inputs and outputs on its base. There is no serial communications or any other protocol available for use on the IO ports, they can only be toggled on and off, and the speed of the API limits the maximum toggle rate to about 3Hz. This makes it impractical to directly control the stepper driver from the outputs on the arm. Instead the I/O from the arm connects to the Eva Interface Board, which in turn then controls the stepper driver.
This system gives us a range of movement from 0mm to 1953mm in 0.5mm steps on the linear rail, plus the range of movement of the arm itself. In practice the travel of the rail is limited to 1800mm due to the physical constraints of the rail.
Safety
The Eva arm is a cobot class robot, meaning it is designed to work alongside humans. It is equipped with a collision detection system, which, when enabled, will disable the robot and lock the joints if anything impedes its movement. The Eva arm also includes an emergency stop button to be used to stop the arm if a problem occurs. These combined provide adequate safety for the arm itself, but the addition of the linear rail poses some additional risk. The primary risk from the linear rail is getting body parts, hair, loose clothing etc. trapped in the ball screw mechanism while it is in motion, which could lead to injury. There is also a potential crushing risk if anything is caught when the gantry reaches the end of its travel at either end of the rail. To control this risk, the sides of the rail will be enclosed with acrylic side panels, and the top will be covered with a concertina, which should prevent anything from interacting with the motion system while active. While the coverings may need to be removed during servicing, the motion system should never be activated without the covers in place. Additionally the Eva’s emergency stop button has been replaced with one with an additional pole to toggle the motor driver’s disable input when the stop is active. This will allow the rail to be quickly stopped in an emergency situation at the same time as the arm. Unlike the arm, which will not enable if there is a problem with the emergency stop, or its wiring, the stepper motor driver will continue to work even if the emergency stop is not connected, as the disable input on the driver is not specifically designed for safety. It is therefore crucial that the operation of the emergency stop is checked before each session of use, and the emergency stop should be located in a way to minimise potential damage to the cabling and the button itself. The side panels and concertina should also be regularly checked.
If the emergency stop has been activated, the system should be powered down before releasing the emergency stop. Once the stop has been released, the system can be powered up again.
Reconfiguration
The linear rail is mounted to the frame in such a way it can be repositioned. There are six brackets on the side of the rail closest to the wall that attach it to the frame. Loosen the bolts on these brackets, and you should be able to slide the entire rail closer to or further from the wall. It helps to have two people to push at either end of the rail. To make sure the rail is straight with respect to the wall, you should measure the distance from the side of the rail to the edge of the frame at both ends and ensure they match.
With the rail at it’s furthest position away from the wall, it should be possible to reconfigure the frame to lay the shelving horizontally to form a floor rather than a wall. This reconfiguration will require disassembly and reassembly, and is beyond the scope of this page.
Programming Interface
Additional methods have been added to the ArmBot class to facilitate controlling the rail. The new methods are as follows:
initialize_rail()
Takes no arguments and returns nothing. Sets up the I/O on the arm ready to communicate with the rail controller. Is called by the class' __init__ method along with the other init methods.
home_rail()
Takes no arguments and returns nothing. Tells the rail controller to home the rail. Must be called at least once before standard movement can commence.
set_rail_position(position, blocking=True)
Takes a position in mm, and optionally a boolean to define the blocking behaviour of the function. Returns nothing.
Moves the rail to the specified position. By default this is a blocking action which waits for a signal from the rail controller that motion has finished before continuing execution. This can be disabled by setting blocking to false. Any commands sent to the rail controller while motion is in progress will be ignored, so it is the programmers responsibility to account for this if blocking has been disabled.
readIO(port, pinType)
Wraps the gpio_get function from the Eva’s API. Takes the port ID and type as arguments, where valid IDs are:
'a0', 'a1', 'd0', 'd1', 'd2', 'd3', 'ee_d0', 'ee_d1', 'ee_a0’ or 'ee_a1',
and type is either ‘input’ or ‘output’. The IDs are off by one compared to the web interface, as the web interface starts at 1, whereas the API starts at 0. Returns the value of the port, boolean for digital ports, float for analog ports. A bug in the Eva API means that a value will only be returned if the specified port has changed state at least once since the arm has booted, otherwise it returns a KeyError.
setIO(port, value)
Wraps the gpio_set function from the Eva's API. Takes the port ID and value as arguments. The value should be a boolean for digital outputs or a float for analog outputs.
I/O
As there is limited I/O on the arm we are using the two analog outputs to communicate the requested distance. This is split into a coarse and a fine adjustment. These analog voltage values are read by the Arduino in the interface board, and the requested distance is calculated from the read values. The Arduino ADC reads from 0 to 5V. For both the coarse and fine values this voltage range has been split into 63 equal sized voltage bands that are each 0.078125V wide. The analog output from the Eva aims for the centre point of each band to allow for a small amount of noise. For the coarse value, each band represents a step of 31mm, and for the fine value each band is a step of 0.5mm, with the lowest band for both representing 0mm. This means that the full range of fine bands is equal to a single band of the coarse range. Once the correct increments have been determined, the coarse and fine distances are added together resulting in the final requested distance. Further details on how this works can be found in the Arduino code comments.
The digital I/O is used for control signalling between the arm and the interface board. The connections are as follows:
EVA I/O | Interface Board I/O | Function |
---|---|---|
Outputs | Inputs |
|
a0 | Fine | Fine position voltage control |
a1 | Coarse | Coarse position voltage control |
d0 | INPUT D | Unused |
d1 | INPUT C | Eva Ready |
d2 | INPUT B | Trigger Home |
d3 | INPUT A | Trigger Motion |
Inputs | Outputs |
|
d0 | OUTPUT A | Motion in progress |
d1 | OUTPUT B | Homing in progress |
d2 | OUTPUT C | Jog mode enabled |
d3 | OUTPUT D | Unused |
All digital connections are active high.
The “Eva Ready” signal is raised when the arm has finished initialising. It should remain high the entire time the rail is in use. The interface board will remain idle and not accept any commands unless the ready signal is high.
The “Trigger Home” and “Trigger Motion” signals are used to trigger homing and movement respectively. They only need to pulse high briefly to be registered by the interface board. The interface board boots into an unhomed state; it is unaware of its position until the rail has been homed. This means that the homing procedure must be triggered at least once before regular movement can commence. The homing procedure moves the rail towards the 0mm position at a fixed speed, until it hits the photointerruptor limit switch, indicating it has reached the end of its travel. The rail then backs off slightly, and repeats at a slower speed to ensure accuracy. The “Homing in progress” signal will be high throughout the entire process, and will go low once the rail is homed. Once the rail has been properly homed, you can then give it movement commands. When the “Trigger Motion” signal is pulsed, the values of the coarse and fine inputs are read by the Arduino, the distance requested is calculated, and the rail moves to that position. The “Motion in progress” signal will be high throughout.
While in regular operation the red LED signifies that a move is in progress, and the green LED signifies that homing is in progress.
Jog Mode
It may sometimes be desirable to move the rail manually without needing to write a Python program. To facilitate this you can use the buttons on the interface board to enter “Jog Mode”, which allows you to use the buttons to manually move the rail back and forth. To enter “Jog Mode” briefly hold down both buttons. The green LED will light to indicate you have entered fine jog mode. You can now use the red and blue buttons to jog the rail back and forth by 0.5mm, allowing for fine adjustment. Pushing both buttons at the same time again moves you into coarse jog mode, signified by the red LED. In this mode you can jog the rail by 31mm increments, allowing for larger movements. Pushing both buttons again will return you to idle. While in jog mode the interface board will ignore all commands from the arm. You can move without the “Eva Ready” signal being high, without needing to home the rail, and you can move past the soft-endstops programmed into the interface board. This makes to possible to recover the arm if it has somehow gone past the limit switch, but also makes it possible to crash the arm if you are not careful.