Robot Interfacing and Control System

The robot will run off a program written in LabView with a USBNI 6009.  Our control/interface designgoal is to create a program and hardware interface to actuate the sixbi-directional electro-magnets that control the on/off and rotation directionof each joint; three 2-position electromagnets which act as a break for eachjoint; one motor that will be used to power the device; and read three sensorsthat describe the joint angles relative to its previous joint. Our sensors aresimple potentiometers with a through-hole continuous rotation design.

The primary electronics hardware used includes the NationalInstruments USB 6009 I/O device, LabView compatible computer, three anglesensors, six spring-loaded locking solenoids, three spring-loaded solenoids anda Harp Interface Control Board which features: two motor driver integratedcircuit chips, four NPN power switching integrated circuit transistors.

The data flow for our set-up can be seen in Figure1.
Figure 1. Device Data Flow and Power Set-upwhich is used to control our device.
USB NI 6009The USB NI 6009 is a multi-purpose input/output device thatcan read or output up to 12 digital ports and generate or read up to fouranalog signals at a time.  This devicehas a severe limitation because it can only read or write at a rate of 150Hzwhich is far to slow to effectively generate a PWM signal.  It is proposed that version 2 of the HARPControl Interface Board be modified to include a microprocessor capable ofreceiving commands from LabView and controlling the robot in one deviceeffectively removing the USB NI 6009 from the data flow.
SolenoidsTwo types of solenoids were used for the robot six arelocking solenoid and three are non-locking they are all configured in the pulloperation. Solenoids are rated by their maximum voltage that can be sustainedindefinitely without over heating in normal conditions.  This means that a 12 volt solenoid will notoverheat if only 12 volts of electricity are passed through the device.  Since our main use of the solenoids will bewith intermittent motion, where power is only applied for short periods oftime, we can get a greater pulling force by using a solenoid with a lowervoltage rating without having to worry about over-heating.
HARP Control Interface BoardThe HARP Control Interface Board is specificallybuilt to interface the USB NI 6009 with our robot this board allows for quickconnections with the sensors, motors, and actuators to the NI device.  The control board receives the 5 voltsdigital signals from LabView and outputs a much higher wattage to the variouscomponents, while simultaneously sending analogue signals from the positionssensors back to the NI device.  Thecontrol board features two L298 Motor Driver chips which have been adapted toenable and reverse the current flow through each of the solenoids that controlthe swing-arm. It also features  fourmedium-power, fast-switching transistors, MJE3055; one that drives the motorand three others that drive the brake solenoids.  All inductive loads have circuit protectionbuilt in to prevent voltage spikes from damaging sensitive components.  

Figure 2. Harp Control Board Schematic
The Control Interface Boardwas designed such that it is not required to use the USB NI 6009 device tocontrol it. Any device capable of outputting twelve +5v digital signals andreading three 0-5V analog signals can fully interface with the HARP roboticleg.  Since the USB NI 6009 digitaloutput ports are only capable of outputting 8.5 milliamps it is not powerfulenough to cause saturation in the L298 and MJE3055 chips to achieve saturationseveral smaller transistors 2N2222’s were used to increase the digital signalshigh enough to fully saturate the larger devices.  Table 1describes the uses for each of the pins for the digital and analog ports.
Table 1. Control Interface Board Pin Out
L298n Dual Motor Driver ICThe L298n integrated circuit builds upon the simple idea ofan H-Bridge circuit which consists of four transistors wired in such a way thatthey allow current to flow through a load, such as a motor, in both directions.  By closing two of the transistors and leavingtwo of them open as seen in Figure 3  thecurrent flows one way and by reversing this configuration the current flows theother way. Caution should be taken with an H-Bridge because closing the wrongtransistor can cause a short circuit. Fortunately the L298n has safeties builtin to prevent this from happening.
Figure 3. Simplified H-Bridge Circuit
The L298n has two separate H-Bridge circuits built in todrive to different load.  For the HARProbot we need three H-Bridges one for each of the swing-arms.  The swing arm needs to be able to achievethree different states; engage clockwise, engaged counter-clockwise, andcentered or unengaged.  Due to theproperties of our locking solenoids running the current one way will cause thesolenoid to pull closed and lock while running current the other way willdisengage the solenoid.  Since solenoidsare much stronger at pulling than pushing, two solenoid per swing-arm will be usedthis allows the swing arm to engage in both directions with pullingforces.  Basic math tells us that 2solenoids per swing-arm means we need 6 H-Bridges and 2 L298n chips only havefour, this leaves us two short.  But in factonly three H-Bridges are required because when the swing-arm engages onedirection we always want one solenoid to disengage and the other to engage thisallows the two solenoids to be wired together in parallel but connected withreverse poles thus one H-Bridge is required for each swing are.  Since the swing arms are locking this meansthat once engaged no current is required to maintain its position.  This is desirable for energy consumption and overheatingconcerns, but once a swing arm is engaged the question of how to center theswing arm without accidentally engaging in the other direction arises.  To solve this we implemented through softwarea short pulse of current opposite of its currently engaged position willdisengage the solenoid without engaging the other side.

 Each motor driver and transistor is connected as aDarlington Pair, since this allows for a very high current gain which isnecessary to power the solenoids.  Picturesof the control board before and after assembly:

Figure 4.Backlit of blank Control Board
Figure 5. FullyAssembled Control Board
Angle Sensors
Figure 6. Potentiometer Angle Sensor in five different positions.
Theangle sensors used for this robot are simple variable resistors that change itsinternal resistance based on the angular displacement of the internal knob. Figure5 shows the angle sensor as the internal knob isrotated.  The three metal contacts at thebottom of the sensor are the connector pins. As corresponding to Figure6 the left most contact pin seen in Figure5 is connected to 5 volts the right most pin isconnected to ground.  This leaves themiddle pin which outputs a variable voltage from 0 to 5 volts depending on theinternal knob. The voltage has a direct relationship to angular position whichis described later in Equation1.
Figure 7. Angle Sensor Configuration
Figure 8shows a view of an angle sensor attached to the third joint of the leg is seenin.
Figure 8. An angle sensor attached to jointthree. The connecting lines have been soldered on.
LabView Control ProgramThe control program consistsof three major parts.  Each part handlesa different aspect of the robot which controls the Electromagnets, Motor andcommunications. As can be seen in Figure 5the software controller manages all moving components of our robot.  When the desired angle of a joint differsfrom its actual position the controller will actively engage the drive,disengage the brake, and engage the swing-arm in the correspondingdirection.  The closed loop feed-back isachieved through the use of angle sensors (potentiometers) located at eachjoint, which continuously read the current angle positions and compare it withthe desired angles.
Figure 9. Software/Hardware Controller FlowDiagram
The open-loop speed controller has no feedback control anduses the desired motor speed to generate a specific PWM signal and coupled withthe software controller the driver motor is turned on and off is capable ofrunning at various speeds.
Swing Arm Control
Figure 10.Swing Arm control program
This section of the control program is dedicated todetermining when the leg is within tolerance and controls the breaks and swingarms back within tolerance.  After testingit was determined that the program should attempt to correct a joint when itscurrent position is more than 8 degrees off and will then drive the leg untilit is within 4 degrees of the desired value. We designed the software this way to prevent the swing arm fromdisengaging a joint at the tolerance level which will cause the swing arm torapidly engage and disengage as the sensor receives small fluctuating angleswith an error around 8-9 degrees.
The subVI in this program consists of specific timed behaviorsthat command the robot to correctly engage the swing arm, engage/disengage thebrakes, and re-center the swing arm.

Motor ControlThe motor controller generates a Pulse-Width Modulation,PWM, signal which has a total length of 30 milliseconds per pulse and can varybased on the user input from completely off to full on.  More information on PWM can be found at (Hills, 2005).  This program also shuts the motor off when nojoints are in motion.  It was determinedthat moving one joint only uses about ¼ of the motor’s power.  By expanding this program further we couldremove the user input and have the program dynamically increase the power tothe motor when the load increase i.e. three joints moving vs. one joint.
Figure 11.Drive Motor Controller
Communications Control
Figure 12.Communications control program
This section of the program handles the communicationsbetween the program and the USB NI 6009 device. This portion continuallyupdates the digital I/O port and reads the raw voltage from the sensors andpreforms a conversion from voltage to angle and corrects for offset.  Through testing and information from thesensors data sheets we determined the conversion formula to be:
Equation 1. Voltage to Angle Conversion  
 
For convenience this section also takesthe first angle values read and sets them as the desired angle, this helps keepthe robot stationary when starting the program (this functionality should beremoved when an advanced motion control program is designed).     
Works Cited Open Circuits. (2010, July 25). Retrieved July 10, 2010, from Transistors -- Darlington Connected: http://www.opencircuits.com/Basic_Circuits_and_Circuit_Building_Blocks#Transistors_--_Darlington_connected
Hills, P. (2005, October 03). Speed Controllers. Retrieved July 15, 2010, from http://homepages.which.net/~paul.hills/SpeedControl/SpeedControllersBody.html

Harp Robot
Published:

Harp Robot

A excerpt from the minimization of the number of motors used in a robot while maintaining the dexterity of simultaneous, coordinated and independ Read More

Published: