Home

CoroWare CoroBot Wireless Connectivity

image

Contents

1. PositionChange int ServoIndex double Position event An event issued when the position changes on a motor CurrentChange int ServoIndex double Current event An event issued when the current consumed changes on a servo 16 3 3 Socket Communication In addition to being able to completely use the Phidgets API C also provides a managed implementation of sockets through the System Net Sockets Namespace The Socket class allows developers to perform both synchronous and asynchronous network communication using several protocols such as IP TCP and UDP 8 A socket is an endpoint of a bidirectional communication between two applications One of the applications is the C client socket and the other application is the C server socket In essence describing socket communication is very simple The server socket application binds to a port number on the computer in this case CoroBot and listens for incoming requests from a client socket application In order for the client socket application to connect to the server socket it must know the IP Internet Protocol address or the hostname of the computer where the server socket application 19 running as well as the port number where the server socket is listening Once the server application accepted and established connection with the client application they can proceed to exchange information Figure 12 illustrates the communication via sockets between a
2. Declare the event public event PropertyChangedEventHandler PropertyChanged private double position private bool engaged public double Position L get L return position l set L if Position value L position value Call OnPropertyChanged whenever the property is updated OnPropertyChanged Position l l l public double Velocity get set public double Acceleration get set public double MaxPosition get set public double MinPosition get set public bool Engaged get return engaged set L if Engaged value L engaged value OnPropertyChanged Engaged j j j public Servo 39 default values of each servo Position 0 Velocity 316 Acceleration 182857 MaxPosition 180 MinPosition 0 Engaged false Create the OnPropertyChanged method to raise the event protected void OnPropertyChanged string name PropertyChangedEventHandler handler PropertyChanged if handler null handler this new PropertyChangedEventArgs name 40 Appendix B Broadcast Web Camera with VLC Media Player This section describes a step by step guide on how to stream the robotic arm s web cam using VLC media player 1 Download and install the latest version of VLC media player from 2 Open VLC media player click gt Media gt Open Capture Device Figure 22 Open File cirl o C Open Folder
3. Ctrl F Eo Open Disc C AD s Open Network Stream CHIN E Oren Capture Device K Open advanced Ctrl Shift 0 Open Location from cipboard Ctrl V Open Recent Media j Save Playlist to Eile CHI Convert Save Ctrl h ie Stream CHAS Quit at the end of playlist x Quit Ctrl oQ Figure 22 41 3 Select Microsoft LifeCam in the Video device name section Figure 23 4 Select none in the Audio device name section Figure 23 4 Open Media Figure 23 42 5 Click the pick button located to the right of the play button and select stream Figure 24 w 2x CJ File o Disc ZE Network E Capture Device Capture mode evice Selection Video device name Refresh list Configur e Refresh list figure Advanced options Show more options Figure 24 43 6 The Stream Output window will open click Next Figure 25 A Stream Output This dialog will allow you to stream or convert your media for use locally on your private network or on the Internet You should start by checking that source matches what you want your input to be and then press the Next button to continue Source SOUS dshow T Type dshow Next Destnaton Setup Option Setup Figure 25 44 7 Select MS WMSP in the New destination section as the streaming method Click the
4. Add button Figure 26 a Stream Output Source Destnaton Setup Destinations Add destinations following the streaming methods you need Be sure to check with transcoding that the format is compatible with the method used New destination Display locally Transcoding options IZ Activate Transcoding Profile video H 264 MPS MP4 x x IS Previous Next Option Setup Figure 26 45 8 Enter CoroBot s public IP address in the Address input box Enter 4668 in the Port input box Figure 27 A Stream Output Destnaton Setup Destinations Gre WMSP This module outputs the transcoded stream to a network via the mms protocol Address 127 0 0 1 Port 4668 Transcoding options Ie Activate Transcoding Profile Video H 264 MP3 MP4 a ai Previous Next Option Setup Figure 27 46 9 Select Video WMV WMA ASF as the transcoding option and click Next Figure 28 a Stream Output Source Destnaton Setup Destinations dh WSP F This module outputs the transcoded stream to a network via the mms protocol Address 127 0 0 1 Fort 4568 Transcoding options Ie Activate Transcoding Profile Previous Next Option Setup Figure 28 47 10 Finally click the Stream button to stream the web cam over the network Figure 29 s Stream Output sout Stransco
5. void advServo_Attach object sender AttachEventArgs e Console WriteLine AdvancedServo 0 attached e Device SerialNumber ToString AdvancedServo attached AdvancedServo sender Set the default servo type to the one Phidgets sells foreach AdvancedServoServo motor in attached servos L motor Type ServoServo ServoType HITEC_HS322HD motor SpeedRamping true l configure the initial position of each servo attached servos Q0 Position 145 selectedServoArray 0 Position 145 attached servos 1 Position 110 selectedServoArray 1 Position 110 attached servos 2 Position 180 selectedServoArray 2 Position 180 33 attached servos 3 Position 70 selectedServoArray 3 Position 70 attached servos 4 Position 83 selectedServoArray 4 Position 83 engage the servos each servo will move to its initial position for Gnt1 0 1 lt NUMBER OF SERVOS i L selectedServoArray i Engaged true attached servos i Engaged true l l Detach event handler Display the serial number of the detached servo device static void advServo_Detach object sender DetachEventArgs e Console WriteLine AdvancedServo 0 detached e Device SerialNumber ToString l Error event handler Display the error description to the console static void advServo_Error object sender ErrorEventArgs e Console WriteLine AdvancedServo Error 0 e Description l Position Change even
6. Control Panel E l w iol x File About Robotic Arm Server Configuration Server IP Address H27 0 0 1 Fort Number 5001 Arm Serial Number 170320 Connect Figure 15 Client s Server Configuration Tab 21 w iol x Set Target Positon g N eee Set Acceleration l 182857 7 Select Servo Ml Engaged Servo Data Selected Servo Actual Position Actual Velocity Serial No Curent Version Engaged Number of Servos Figure 16 Robotic Arm Tab 22 The Robotic Arm tab GUI is divided into four quadrants which are essentially two columns and two rows figure 17 File About Robotic Arm Server Configuration e fl Engaged Set Acceleration l 182857 Set Max Position al Velocity 0 ff Serial No 1703270 Curent 0 Version 200 Selected Servo 0 Attached tie Actual Position 0 Name Phidget Advanced Servo Controller 8 motor Set Min Position Engaged true Number of Servos amp Figure 17 Robotic Arm Tab Layout 23 In the first quadrant quadrant 0 a vector graphic representation of the robotic arm which is mounted in CoroBot s top deck is displayed Each servo in the vector graphic is independent of each other This allows the user to easily select a servo by just placing the mouse pointer over it and left clicking Each servo has three states normal mouse hovered and selected Figure 18 a Normal Hover
7. Position 0 Name Phidget Advanced Servo Controller 8 motor Figure 32 52
8. This call does not return the actual physical position of the servo The range of Position 19 bounded by PositionMin PositionMax If the servo 19 not engaged then the position cannot be read The position can still be set while the servo is not engaged Once engaged the servo will snap to position if it 1s not there already 13 This property should be set by the user as part of initialization If not it will report the last value set on the device unless the 1061 has been power cycled Get will return the last value as reported by the device This means sets to this value will take a small amount of time to propagate double PositionMax int ServoIndex get set PositionMax is the upper limit to which Position can be set and is initialized to 233 It can be used to prevent the controller from going beyond a servo s range of motion A PhidgetException will be thrown if this is set above 233 or below PositionMin double PositionMin int ServoIndex get set PositionMin is the lower limit to which Position can be set and is initialized to 22 9921875 It can be used to prevent the controller from going beyond a servo s range of motion A PhidgetException will be thrown if this is set below 22 9921875 or above PositionMax double Current int ServoIndex get Current returns the power consumption in amps for a particular servo The value returned for a disconnected or idle servo will be slightly above zero
9. class phidget base classes and PhidgetException class using Phidgets Needed for the event handling classes using Phidgets Events using System Net namespace Robotic_Arm_Control_Panel lt summary gt Interaction logic for Window1 xaml lt summary gt public partial class Windowl Window AdvancedServo advServo Servo selectedServoArray int NUMBER OF SERVOS 5 The actual number of servos installed int selectedServoIndex 0 AboutWindow aboutWindow public Window1 Advanced Servo object advServo new AdvancedServo Array of 5 servo objects Each element represents 32 l a robotic arm servo selectedServoArray new Servo NUMBER_OF_SERVOS instantiate the 5 servos of the robotic arm for Gnt 1 0 i lt NUMBER OF SERVOS i selectedServoArray i new Servo l Hook the basic event handlers advServo Attach new Phidgets Events AttachEventHandler advServo_Attach advServo Detach new Phidgets Events DetachEventHandler advServo_Detach advServo Error new Phidgets Events ErrorEventHandler advServo_Error hook the phidget specific event handlers advServo PositionChange new Phidgets Events PositionChangeEventHandler advServo_PositionChange advServo VelocityChange new Phidgets Events VelocityChangeEventHandler advServo_VelocityChange InitializeComponent Attach event handler Display serial number of the attached servo device
10. due to noise bool SpeedRamping int ServoIndex get set SpeedRamping enables or disables whether the PhidgetAdvancedServo tries to smoothly control the motion of a particular servo If enabled then the 1061 will progressively send commands based on velocity acceleration and position This property should be set by the user as part of initialization If not it will report the last value set on the device unless the 1061 has been power cycled Get will return the last value as reported by the device This means sets to this value will take a small amount of time to propagate bool Engaged int ServoIndex get set 14 Enables a particular servo to be positioned If this property is false no power is applied to the motors Note that when it is first enabled the servo will snap to position if it is not physically positioned at the same point Engaged is useful for relaxing a servo once it s reached a given position If you are concerned about keeping accurate track of position Engaged should not be disabled until Stopped True This property should be set by the user as part of initialization If not it will report the last value set on the device unless the 1061 has been power cycled Get will return the last value as reported by the device This means sets to this value will take a small amount of time to propagate bool Stopped int ServoIndex get Stopped returns false if the servo is currently in
11. motion It guarantees that the servo is not moving unless you are moving it by hand and that there are no commands in the pipeline to the servo Note that virtually any API calls will cause Stopped to be temporarily false even changing Acceleration or VelocityLimit on a stopped servo Phidget_ServoType ServoType int ServoIndex get set Gets Sets the servo type for an index There is a list of some common servos that have been predefined by Phidgets Inc This sets the PCM range range of motion the PCM to degrees ratios used internally and the maximum velocity This allows the degree based functions to be accurate for a specific type of servo Note that servos are generally not very precise so two servos of the same type may not behave exactly the same Specific servo motors as well as servos not in the list can be independently quantified by the user and set up with the setServoParameters funtion void setServoParameters int ServoIndex double MinUs double MaxUs double Degrees double VelocityMax 15 Events Sets the parameters for a custom servo motor MinUs is the minimum PCM in microseconds MaxUs is the maximum PCM in microseconds Degrees is the degrees of rotation represented by the given PCM range and VelocityMax is the maximum velocity that the servo can maintain in degrees second VelocityChange int ServoIndex double Velocity event An event issued when the velocity changes on a motor
12. remotely change the position and other attributes for each servo of the robotic arm To accomplish this the user must first enter the following information in the Server Configuration tab of the client Figure 15 1 Server IP address The IP address of the remote computer to which the robotic arm is physically connected CoroBot 2 Port Number The port number used during the communication between the client and the server 3 Serial Number The serial number of the robotic arm This number is required before establishing the connection with the server because there could be several robotic arms connected to the server and the client would not know which robotic arm the user wants to control Upon entering this information the user may click the Connect button The client will now try to establish connection to the previously specified server and open a connection with the robotic arm Once the client successfully connected to the server the user will be able to change the position of the robotic arm Because the client is working behind a GUI the code is event driven In other words the client responds to user actions such as mouse clicks key presses and drags of sliders The Robotic Arm tab Figure 16 in the client is where the main interaction between the user and the client application occurs The Robotic Arm tab functionality is described in the following pages 20 lt Robotic Arm
13. sereis nanie Teeminuding of service GisLurice ey Manifest Load Results offect other services thor ose that instance pepini M anane Resource Ciagnustes Search eovabor Ronin Servicus M Developer Resources CoreBok Apartment Sam ple GT TAANE TRANEN 2 B ae About Microsoft Robotica J G GC scipton Pet ihe Canoe tin ihe barner grait Germen CoroBot Battery T otart amthout PP SnPE STS 2 L Creabe Gesoiptian The Canobatattery Serice foe Pre bathere waitage renaning on the Conakict xA F lt CoreBot Camera 2 s Start Wait rman SL S e reata Cesoiptian The CaroBbatlemess Service allows the current imags from the CeraBet s comers to be retrieved CoreBat ClavePack Envirenm ent T caja rdl an eaa S Create Cesoipbont The GessPacsirre ron ent Sereice CoreBot Drive e lt 5tart vathout risnrest gt ba Creabe Resoiptian The Conofatriee Serice prowides an intefa te tre CorsAot mobilite base a m CoroBot Entities lt Start without manete Create Figure 7 The DSS Host Control Panel 7 d COMO Control panpe I pm ir E iE EIO T all Hu 1 Dva Rahe Tandaan fi 247 Logier HD vwisboan LEIG E Gerster Figure 8 CoroBot Control Panel used to remotely drive CoroBot 7 2 Problem Definition The objective of this project is to extend the work of the previous team by adding support to the new robotic arm mounted in CoroBot s top deck The main goal of this project is to be able to remotely cont
14. CoroWare CoroBot Wireless Connectivity Draft 8 Author Victor Fernandez Class CNT 4104 Software Project in Computer Networks Instructor Dr Janusz Zalewski FLORIDA GULF COAST UNIVERSITY 10501 FGCU Boulevard South Fort Myers FL 33965 6565 November 19 2012 1 Introduction This is a new research project which involves CoroBot CoroBot is a four wheeled robot created by Coroware with the goal of minimizing the complexity of robot development CoroBot 19 equipped with a mini ITX motherboard and a PC class CPU One of the most important characteristic about CoroBot is that it has expansive program storage space and CPU capacity to run additional software CoroBot was designed with developers in mind all the hardware devices and CoroBot itself is supported by Microsoft Robotics Developer Studio In addition CoroBot s ample mounting space allows hardware developers to install additional hardware components such as GPS laser range finder environmental sensors and more 1 1 1 CoroBot s Hardware A Microsoft Kinect 3D sensor Figure 1 is mounted in CoroBot s top deck XBOX 360 Figure 1 Kinect 4 A 4 DOF Degrees of Freedom robotic arm Figure 2 is mounted in CoroBot s top deck Figure 2 CoroBot s robotic arm 5 The robotic arm s servos are controlled by a Phidget 1061 Advanced Servo Controller 8 Motor Figure 3 Black Ground White or yellow Data Line Red 5V Figure 3 Phi
15. Phidget provides a really well documented C API which helped me start programing the robotic arm 30 Bibliography 1 R D Inc URL http www robotshop com PDF coroware corobot pamphlet pdf 2 I CoroWare Corobot User Guide URL http www robotshop com PDF corobot user guide pdf 3 Microsoft Microsoft Robotics Developer Studio 4 6 March 2012 URL http www microsoft com en us download details aspx id 2908 1 4 PCWorld Software Microsoft Kinect URL http www pcworld com product 7 14802 kinect html 5 T R MarketPlace CB COROBOT URL http www robotmarketplace com products CB COROBOT html 6 P Inc 1061 User Guide 7 September 2012 URL http www phidgets com wiki images thumb 6 6b 1061_O_Pins jpg 400px 1061_0_Pins jpg 7 X Zhu A Pi eiro CoroWare CoroBot Senior Software Engineering Project FGCU Fort Myers 2012 8 Microsoft Socket Class URL http msdn microsoft com en us library system net sockets socket v vs 100 aspx 31 Appendix A Source Code Window class using System using System Collections Generic using System Linq using System Text using System Windows using System Windows Controls using System Windows Data using System Windows Documents using System Windows Input using System Windows Media using System Windows Media Imaging using System Windows Navigation using System Windows Shapes Needed for the AdvancedServo
16. Phidget Advanced Servo Controller 8 motor under the listed devices to open the AdvancedServo full example program Figure 11 The example program can be used to test and calibrate the robotic arm Ey Phidget Control Panel General WebService PhidgetSBC Library Information Phidget 1 Version 2 1 8 Built Sep 12 2012 11 17 45 Phidget 1 NET Version 2 1 8 118 Locally Attached Devices Double click to launch Ul Devi Phidget Advanced Servo Controller amp motor l Start Phidget Control Panel with Windows Figure 10 Phidget Control Panel 10 gt AdvancedServo full 0 AdvancedServo Control Details Attached im Name Phidget Advanced Servo Controller 8 motor Seral No 170320 Version 200 H Servos e Servo Data Choose Servo fo Type HITEC_HS322HD tst i iY Actual Velocity D0 Actual Position Unknown Current D0 Engaged lZ Speed Ramping IS Stopped Set Target Position K Set Velocity 316 Set Acceleration 182857 14 Set Max position 180 Set Min Position Figure 11 AdvancedServo full example program 3 2 Phidget API After confirming that the robotic arm is functioning properly it is time to start working with the robotic arm As previously mentioned the programming language that will be used to develop both the client and server application is C C is capable of using the full Phidget API The API provides several functio
17. anges the actual position degrees of a servo By default the minimum value supported by this slider is 0 and the maximum value is 180 However the user may change the bounding values of this slider by dragging the Set Max Position or the Set Min Position slider 2 Set Velocity changes the velocity of a servo If the velocity is 0 the servo will not move The minimum value supported by this slider is 0 and the maximum value is 316 3 Set Acceleration changes the acceleration of a servo The minimum value supported by this slider is 22 and the maximum value is 320 000 4 Set Max Position changes the maximum value of the Set Target Position slider The minimum value supported by this slider is 0 and the maximum value is 180 5 Set Min Position changes the minimum value of the Set Target Position slider The minimum value supported by this slider is 0 and the maximum value is 180 26 ON Robotic Arm Control Panel File About Robotic Arm Server Configuration Set Target Position Set Velocity Select Servo w iol x I Engaged fy Set Acceleration _ ___ 182857 Set Max Position CY y Set Min Position Servo Data Selected Servo 0 Actual Position 0 Actual Velocity 0 Current 0 _ Figure 20 Servo Property Sliders Servo Control Details Attached true Name Phidget Advanced Servo Controller 8 motor Serial No 170320 Version 200 Numb
18. client and server application Sends Request IP Address or hostname port Sends Response SS Server Socket Application Client Socket Application listening at a port number Figure 12 Socket Communication 17 Figure 13 shows a detailed flowchart of the client operations Stan Client y Request connection to the server message Display error Y Initialize Phidget object Did server accepted the connection Wait for event from user Finish y Yes y Close phigdet object Close client connection Figure 13 Client operations Send robotic arm data to server 18 Figure 14 shows a detailed flowchart of the server operations Star Server Accept client connection Yes Create Phidget object Is the robotic arm attached to the server No v Wait for the robotic arm to be attached gt connection with the robotic arm Open y Wait for event from a the client Yes y Close connection with the client y Update robotic arm data Figure 14 Server operations 19 4 Implementation The client application has a GUI Graphical User Interface that allows the user to
19. de yoodec WMV2 vb 0 scale 1 acodec wma2 ab 128 channels 2 samplerate 44100 std access mmsh mux asfh dst 127 0 0 1 4668 sout keep Figure 29 48 Appendix C Build Instructions This section describes a step by step guide on how to build and run this project l oS P A e Download Microsoft NET Framework 3 5 or higher http www microsoft com en us download details aspx id 21 Download and install Microsoft Visual Studio 2010 http www microsoft com visualstudio eng downloads d 2010 express Download the Phidget installer which installs the Phidget drivers and libraries for Windows http www phidgets com docs OS_ _ Windows Quick_ Downloads Open Visual Studio 2010 Click File gt Open gt Project Solution gt Select the Robotic Arm Control Panel sIn file Click Build gt Build Solution F6 Click Build gt Build Robotic Arm Control Panel Shift F6 To run the program click Debug gt Start Debugging F5 49 Appendix C User Manual This section demonstrates how to use the Robotic Arm Control Panel application to control the robotic arm 1 Open the Robotic Arm Control Panel application and click the Server Configuration tab Figure 30 2 Enter CoroBot s public IP address in the Server IP Address input box of the Robotic Arm Server section and the Camera Broadcast Server section Leave the rest of the input boxes as they appear in Figure 30 Click the Connect button
20. dget 1061 Advanced Servo Controller 8 Motor 6 CoroBot s upper deck Figure 3 contains the mini ITX form factor motherboard and batteries The current system in the lab is installed with dual boot configuration running Linux and Windows 7 operating system The batteries life span is approximately 2 5 hours and they take around six hours to fully charge 2 Figure 4 Upper Deck 2 The left side of CoroBot contains the Power button and Reset button Each button is labeled accordingly Figure 4 Figure 5 Power and Reset buttons 2 The right side of CoroBot contains the battery charging connector tethered power connector and power selector switch Figure 5 The power selector switch supports three positions Each position is described as follow e Up Operate in tethered power e Center Off e Down Operate using battery power s Tethered Battery Charging B power Connector L Figure 6 Right side of CoroBot 2 To turn on CoroBot follow these steps 1 Ensure the charger switch is in the 1 8 amps configuration 2 Plug the battery charger to an AC outlet Make sure the light flashes red green which indicates that the charger is receiving power 3 Plug the power connector into the battery charging connector 4 Change the power switch to the up position 5 Press the power button left side and wait for the system to boot up 1 2 Software Required The following software is used in this projec
21. ed Selected Figure 18 Servo States Vector art designed by Victor Fernandez In the second quadrant quadrant 1 a vector graphic representation of a monitor is displayed Figure 19 The video stream from the camera that is mounted in the robotic arm will appear inside the monitor The MediaElement object which is part of the NET Framework is used to capture the video stream But in order to capture the video stream from the camera the camera needs to be broadcasted over the network first A step by step guide on how to broadcast the robotic arm s web camera appears in Appendix B Broadcast Web Camera with VLC Media Player S Robotic Arm Control Panel File About Robotic Arm Server Configuration Set Target Position Set Velocity 2 Set Acceleration l 182857 Set Max Position Select Servo i Engaged Servo Data Servo Control Details Selected Servo 0 Attached true Actual Position 0 Name Phidget Advanced Servo Controller 8 motor Actual Velocity 0 Serial No 170370 Curent 0 Version 200 Engaged true Number of Servos amp Figure 19 Monitor Vector w iol x 25 In the third quadrant quadrant 2 five slider controls are present Figure 20 Each slider allows the user to change a property of the selected servo When the client detects that the user changed any of the sliders the corresponding Phidget API method or event is invoked Sliders 1 Set Target Position ch
22. edServoIndex Position selectedServoArray selectedServoIndex Position Invoked when the user changes servos 35 private void ServoComboBox_SelectionChanged object sender SelectionChangedEventArgs e selectedServoIndex sender as ComboBox SelectedIndex roboticArmTab DataContext selectedServoArray selectedServoIndex Console WriteLine selectedServoIndex l private void VectorServo_Click object sender MouseButtonEventArgs e switch sender as Rectangle Name case baseVector if selectedServoIndex 0 ServoComboBox SelectedIndex 0 break case shoulderVector if selectedServoIndex 1 ServoComboBox SelectedIndex 1 break case elbow Y ector if selectedServoIndex 2 ServoComboBox SelectedIndex 2 break case armVector if selectedServoIndex 3 ServoComboBox SelectedIndex 3 break case fingerVector if selectedServoIndex 4 ServoComboBox SelectedIndex 4 break 36 default break Invoked when the engaged check box 1s clicked private void EngagedCheckBox_Checked object sender RoutedEventArgs e L if advServo Attached L selectedServoArray selectedServoIndex Engaged true advServo servos selectedServoIndex Engaged true l l private void EngagedCheckBox_Unchecked object sender RoutedEventArgs e if advServo Attached selectedServoArray selectedServoIndex Engaged fal
23. en at A negative value means it is moving towards a lower position This call does not return the actual physical velocity of the connected motor double VelocityLimit int ServoIndex get set Gets or sets the maximum absolute velocity that the PhidgetAdvancedServo controller will drive the servo If it s changed mid movement the controller will accelerate accordingly If the target position of the controller is near enough then the VelocityLimit may never be reached This property should always be set by the user as part of initialization There is a practical limit on how fast your servo can rotate based on the physical design of the motor The range of VelocityLimit is bounded by VelocityMax VelocityMin Note that when VelocityLimit is set to 0 the servo will not move double VelocityMax int ServoIndex get Constant VelocityMax is the absolute upper limit to which Velocity can be set For the1061 this will always return 6400 double VelocityMin int ServoIndex get Constant VelocityMin is the absolute lower limit to which Velocity can be set For the 1061 this will always return 0 double Position int ServoIndex get set Position is used for both the target and actual position for a particular servo If the servo is currently engaged and a new value is set then the controller will continuously try to move to this position Otherwise this call will return the current position of the servo
24. er of Servos B 27 In the fourth quadrant Figure 21 several controls are present The first control is a combo box which allows the user to select a servo of the robotic arm This combo box provides the same functionality as the robotic arm vector graphic located in first quadrant The second control located below the combo box is a check box that allows the user to change the engaged property of a servo If a servo is not engaged no power is applied to it thus the servo will not react to the changes of the Set Target Position slider When the client application successfully established a connection with the server and a robotic arm is attached the engaged property for all the servos will be set to true Additional data about each servo and the servo controller is displayed below the Engaged check box The Servo Data group displays the following information about the currently selected servo 1 2 3 4 5 its index number Its actual position Its actual velocity The electrical current flowing through the servo The value of the engaged property true or false The Servo Control Details group displays the following information about the Phidget controller 1 2 3 4 5 The value of the attached property true or false Its name Its serial number Its version number The maximum number of servos supported by the controller The 1061 controller always return 8 28 ON Robotic Arm Co
25. in each section ON Robotic Arm Control Panel File About Server IP Andress Seve IP Aooress 177 0 0 1 Zaloer 5001 O Streaming method dum Serial Humber 170008 Port Number Select robotic arm type Combat Robotic Ann _ Lyreemotion Robotic Arm Figure 30 50 3 Click the Robotic Arm tab and select a servo by either left clicking it in the vector graphic or in the Select Servo combo box Figure 31 S Robotic Arm Control Panel File About Robotic Arm Server Configuration Configuration Set Target Position 0 Elbow Set Velocity i Engaged ER Set Acceleration ef 182857 Set Max Position Actual Velocity 0 8 Serial No 170008 Current 0 Version 200 Set Min Position Engaged false E l Number of Servos 8 Selected Servo 0 Attached false Actual Position 0 Name Phidget Advanced Servo Controller 8 motor Figure 31 51 4 Change the property of the selected servo such as its position by moving the corresponding slider Figure 32 S Robotic Arm Control Panel File About Robotic Arm Server Configuration Configuration Set Target Position E 0 Elbow Set Velocity i Engaged h HR Set Acceleration 2 182857 Set Max Position Actual Velocity 0 8 Senal No 170008 Current 0 E ESE Version 200 Set Min Position Engaged false p bo Number of Servos amp Selected Servo 0 Attached false Actual
26. ns and events that enable programmers to control a Phidget The following pages presents the API functions and events applicable for the Phidget 1061 Advanced Servo Controller 8 Motor as they appear in the Phidgets 1061 user guide 6 Functions int Count get Returns the number of servos this PhidgetAdvancedServo can control In the case of the 1061 this will always return 8 This call does not return the number of servos actually connected double Acceleration int ServoIndex get set Acceleration is the maximum change in velocity the PhidgetAdvancedServo uses when speeding up slowing down a servo The range of valid Acceleration is bounded by AccelerationMax AccelerationMin There is a practical limit on how fast your servo can accelerate based on load and the physical design of the motor This property should always be set by the user as part of initialization The value does not initialize to the value last set on the device double AccelerationMax int ServoIndex get Constant AccelerationMax is the upper limit to which Acceleration can be set For the 1061 this will always return 320000 double AccelerationMin int ServoIndex get Constant AccelerationMin is the lower limit to which Acceleration can be set For the 1061 this will always return 19 53125 double Velocity int ServoIndex get 12 Velocity returns the actual velocity that a particular servo is being driv
27. ntrol Panel File About Robotic Arm Server Configuration Set Target Position Set Velocity Select Servo w iol x H Engaged o E Set Acceleration a 182857 Set Max Position CY H Set Min Position Servo Data Selected Servo 0 Actual Position 0 Actual Velocity 0 Curent 0 Figure 21 Fourth Quadrant Servo Control Details Attached false Name Phidget Advanced Servo Controller 8 motor Serial No 170008 Version 200 Number of Servos B 29 Conclusion By using the Phidget API and the NET Framework the Robotic Arm Control Panel client application is able to remotely control the robotic arm that is mounted in CoroBot s top deck The graphical user interface displays a vector graphic representation of the robotic arm which allows the user to easily select a servo of the robotic arm Once a servo is selected the user may change several properties of the servo such as its position In addition the Robotic Arm Control Panel displays the video stream from the robotic arm s web cam that is produced by VLC media player Unfortunately there is a delay of 3 to 5 seconds in the display This project could by expanded by adding the ability to move the robotic arm with a wireless joystick or controller The main difficulty that I faced during the development of this project was that I did not have any documentation or previous experience in how to program a robot Fortunately
28. ralized Software Services host control panel Figure 7 that comes with Microsoft Robotics Developer Studio to create several CoroBot services Three of the CoroBot services can create a simulation environment in Microsoft Visual Simulation Environment to test CoroBot Finally to remotely control the CoroBot the CoroBot OCU Operator Control Unit service was created This service creates the CoroBot Control Panel Figure 8 which enables the user to drive CoroBot from a remote location L G C retera UT c ST A Fjalimi 9 shawn hs dms th 05 sheer fad cnan ita G tR waden E ansk ake ilo 9 aas ER arder L 9 Ssss R guce 1 C 291975 senior S z Microsull ROBOTICS Systane Services Microsoft Robotics Control Panel 8 Here Conka pAn Daciptlon Tie Corneni Baner ien al eve honie service cons eo servio Hnes aling eiin 706 cet of sete service rren Pack sentre name so Wat Pot tp a cehaled dagokan oF ipat Sent 76 Sore dg ine operahan TF siang ong He parooli TT e e Gn Using tie Seared 657 yon can arak Service DEE Y dpn the ist of service apnivects based on Rer descnpiion Re toggling the Du 0100 Services Check Merk yoo can hat the si do seriis CSAs H URP Debug arid Trace Messages cee ioviogs Using De Credle buhan won cod sb d flew GSL EE HI 1 sevim oolionouiy selection n monies te ose for verlo Lie seire a Fue baiti is groved bad dhen no odifiitore service inelovices ca De Ced ecl baing hie Crop bution pes con Lente Y
29. rol the robotic arm as well as see the video stream received from the robotic arm s web cam To accomplish this goal a client and a server application has to be developed using Microsoft NET framework The client application shall allow the user to easily input the new position of the robotic arm Through sockets the client can connect to the server application and send the new position of the robotic arm Once the server application received and processed the new position it will move the robotic arm It is important to mention that the client application must be installed on the computer that will be remotely controlling the robotic arm Likewise the server application must be installed in CoroBot which will act as the server The diagram in Figure 9 illustrates the interaction between the user and CoroBot Wireless Network Le Client Computer Corobot Robot User Figure 9 Diagram demonstrating the interaction between the user and CoroBot 3 Prospective Solution 3 1 Testing the Robotic Arm Before starting to develop the client and server application the robotic arm must be tested to see if it is working correctly In order to test the robotic arm the following steps must be followed 1 Install the Phidget drivers and libraries for Windows 2 Once the Phidget libraries are installed the Phidget icon will appear in the taskbar Double click the icon to open the Phidget Control Panel Figure 10 3 Double click
30. se advServo servos selectedServoIndex Engaged false private void ProgramWindow_MouseWheel object sender Mouse WheelEventArgs e L if e Delta 120 L PositionSlider Value 1 else if e Delta 120 PositionSlider Value 1 l Console WriteLine e Delta l private void ProgramWindow_Closing object sender System ComponentModel CancelEventArgs e Console WriteLine Closing if advServo null if advServo Attached 37 disengage the servos for nt 1 0 1i lt NUMBER OF SERVOS i L advServo servos i Engaged false j j advServo PositionChange new Phidgets Events PositionChangeEventHandler advServo_PositionChange advServo VelocityChange new Phidgets Events VelocityChangeEventHandler advServo_VelocityChange advServo close advServo null j j endregion region Menu Items Event Handlers private void AboutMenultem_Click object sender RoutedEventArgs e L aboutWindow new AboutWindow aboutWindow Show l endregion Servo Class using System using System Collections Generic using System Lingq using System Text using System ComponentModel namespace Robotic_Arm_Control_Panel This class implements INotifyPropertyChanged to support one way and two way bindings 38 such that the UI element updates when the source has been changed dynamically class Servo INotifyPropertyChanged
31. t e Windows 7 operating system e Microsoft Robotics Developer Studio 2008 R3 Microsoft Robotics Developer Studio is a freely available NET based programming environment for building robotics applications It can be used by both professional and non professional developers as well as hobbyists In addition to providing support for Microsoft Visual Studio 2010 Microsoft Robotics Developer Studio 4 provides a Visual Programming Language VPL which allows developers to create applications simply by dragging and dropping components onto a canvas and wiring them together 3 e Microsoft Visual Studio 2010 It is an integrated development enviroment IDE from Microsoft that assists developers in the creation of software e Microsoft NET Framework e Phidgets Drivers and Phidgets C API 6 e VLC media player 1 3 Previous Project The previous team 7 installed and configured several programs that enabled them to remotely control CoroBot in Windows and Linux To remotely control the CoroBot in Windows the following software was installed e Microsoft Windows XP or greater e Microsoft NET libraries 3 5 e Microsoft Visual Studio 2010 Professional e Microsoft Robotics Developer Studio 2008 R3 e Phidgets drivers e A Subversion client Slik Subversion will do Once the required software was installed the team downloaded and compiled CoroWare CoroBot Robotics Developer Studio Project Then they used the DSS Decent
32. t handler Display which servo changed position and its new position value to the console static void advServo_PositionChange object sender PositionChangeEventArgs e L Console WriteLine Motor 0 Actual Position 1 e Index e Position ToString l Velocity Change event handler Display which servo s velocity is changing and its new value to the console static void advServo_VelocityChange object sender VelocityChangeEventArgs e L Console WriteLine Motor 0 Actual Velocity 1 e Index e Velocity ToString l region Window GUI Event Handlers 34 private void ProgramWindow_Loaded object sender RoutedEventArgs e L if advServo null L l l Invoked when the Connect button 1s clicked private void OpenButton_Click object sender RoutedEventArgs e if advServo null try IPAddress serverAddress PAddress Parse ServerIpTextBox Text int port int Parse PortNumberTextBox Text int serialNumber int Parse SerialNumberTextBox Text advServo open serialNumber serverAddress ToString port catch Exception Invoked when the position slider is dragged private void PositionSlider_ValueChanged object sender RoutedPropertyChangedEventArgs lt double gt e Move the selected servo to the specified position if advServo Attached selectedServoArray selectedServoIndex Position Math Truncate PositionShider Value 100 100 advServo servos select

Download Pdf Manuals

image

Related Search

Related Contents

PP 09-2014  Manuel d`utilisation  bargoa - Corning  1. APPAREILS À PULVÉRISATIONS  SCR`T 取イ寸・取扱説明書  Affichage  

Copyright © All rights reserved.
Failed to retrieve file