Abstract:
A robotic system that moves a surgical instrument in response to the actuation of a foot pedal that can be operated by the foot of a surgeon. The robotic system has an end effector that is adapted to hold a surgical instrument such as an endoscope. The end effector is coupled to an articulate arm which can move the endoscope relative to the patient. The articulate arm can be located within a first coordinate system, the end effector may be located in a second coordinate system and the surgical instrument may be located within a third coordinate system. The system includes a computer which controls the movement of the robotic arm in response to input commands received from an input device such as the foot pedal. The controller may perform a software routine that computes the movement of the articulate arm and end effector in response to the input commands. The software routine may utilize transformation functions to transfer movement of the instrument from one coordinate system to another coordinate system. The surgical instrument may be an endoscope that is coupled to a video monitor. The monitor may display an organ of a patient. Movement of the articulate arm allows the surgeon to view different areas of the patient.

Description:
This is a Continuation of application Ser. No. 08/613,866, filed Mar. 11, 1996, which is a Continuation of application Ser. No. 08/072,982, filed Jun. 3, 1993, U.S. Pat. No. 5,524,180, which is a Continuation-in Part of application Ser. No. 08/005,604, filed Jan. 19, 1993, now abandoned, which is a Continuation-in-Part of application Ser. No. 927,801, filed Aug. 10, 1992, now abandoned. 
    
    
     BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention relates to a robotic system for remotely controlling the position of a surgical instrument. 
     2. Description of Related Art 
     Endoscopes typically contain a lens that is coupled to a visual display by a fiber optic cable. Such a system allows the user to remotely view an image in front of the scope. Endoscopes are commonly used in a surgical procedure known as laparoscopy, which involves inserting the endoscope into the patient through a small incision in the abdomen. The endoscope allows the surgeon to internally view the patient without being in a direct line of sight with the object. The use of an endoscope typically reduces the size of the incision needed to perform a surgical procedure. 
     Endoscopes are commonly used to assist the surgeon in removing the gall bladder of a patient. Because the surgeon typically requires both hands to remove a gall bladder, the endoscope must be held and operated by a assistant. During the surgical procedure, the surgeon must frequently instruct the assistant to move the endoscope within the patient. Such a method can be time consuming as the surgeon may have to relay a series of instructions until the assistant has positioned the endoscope in the proper location. Additionally, the assistant may be unable to consistently hold the instrument in a fixed position, resulting in a moving image. This is particularly true for surgical procedures that extend over a long period of time. 
     There is presently a system marketed by Leonard Medical Inc. which mechanically holds an endoscope. The Leonard Medical system is an articulated mechanism which has a plurality of pneumatically powered joints that hold the endoscope in a fixed position. To move the endoscope, the pneumatic powered joints must be initially released into a relaxed condition. The surgeon or assistant then moves the scope and reactivates the pneumatic system. Although the Leonard system holds the endoscope in one position, the system requires the surgeon or assistant to constantly deactivate/activate the pneumatics and manually move the scope. Such a system interrupts the surgery process and increases the time of the surgical procedure. It would be desirable to provide a system that allows the surgeon to directly and efficiently control the movement of an endoscope. 
     SUMMARY OF THE INVENTION 
     The present invention is a robotic system that moves a surgical instrument in response to the actuation of a foot pedal that can be operated by the foot of a surgeon. The robotic system has an end effector that is adapted to hold a surgical instrument such as an endoscope. The end effector is coupled to a robotic arm assembly which can move the endoscope relative to the patient. The system includes a computer which controls the movement of the robotic arm in response to input signals from the foot pedal. 
     The computer computes the amount of incremental movement required to move the end effector in accordance with a set of algorithms. The algorithms transform the input of the foot pedal so that the movement of the endoscope as seen by the surgeon is always in the same direction as the movement of the foot pedal. Thus when the foot pedal is depressed to move the endoscope up or down, the end effector is manipulated so that the scope always moves relative to the image in an up or down direction as viewed by the surgeon. The robotic system is also moved in accordance with an algorithm that insures a consistent orientation of the image viewed by the surgeon. 
     Therefore it is an object of the present invention to provide a system which allows a surgeon to remotely control the position of a surgical instrument. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     The objects and advantages of the present invention will become more readily apparent to those ordinarily skilled in the art after reviewing the following detailed description and accompanying drawings, wherein: 
     FIG. 1 is a side view of a robotic system of the present invention; 
     FIG. 2 is a top view of the robotic system of FIG. 1; 
     FIG. 3 is a top view of an end effector used to hold an endoscope; 
     FIG. 4 is a top view of a foot pedal of the system of FIG. 1; 
     FIG. 5 is a cross-sectional view of the foot pedal of FIG. 4; 
     FIG. 6 is a schematic of a computer of the robotic system shown in FIG. 1; 
     FIG. 7 is a schematic of the endoscope oriented in a second coordinate system; 
     FIG. 8 is a flowchart showing the operation of the system; 
     FIG. 9 is a graph showing the incremental movement of the robotic arm assembly; 
     FIG. 10 is a cross-sectional view of the robotic arm assembly showing actuators coupled to clutch and drive train assemblies; 
     FIG. 11 is a side view of the system showing a protective sterile bag which encapsulates the robotic arm assembly; 
     FIG. 12 is a cross-sectional view of an alternate embodiment of the end effector; 
     FIG. 13 is a perspective view of an alternate embodiment of an end effector which has a worm gear that is operatively coupled to the surgical instrument; 
     FIG. 14 is a perspective view of an alternate embodiment of a robotic system which incorporates the worm gear joint of FIG. 13; 
     FIG. 15 is a schematic of a surgical instrument that defines a third coordinate system located within a fourth fixed coordinate system; 
     FIG. 16 is a schematic of the surgical instrument being moved relative to a pivot point. 
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     Referring to the drawings more particularly by reference numbers, FIGS. 1 and 2 show a robotic system 10 of the present invention. The system 10 is typically used in a sterile operating room where a surgeon (not shown) performs a surgical procedure on a patient 12. The patient 12 is placed on a operating table 14. Attached to the table 14 is a robotic arm assembly 16 which can move a surgical instrument 18 relative to the table 14 and the patient 12. The surgical instrument 18 is typically an endoscope which is inserted into the abdomen of the patient 12. The endoscope 18 enters the patient through cannula, wherein the scope 18 rotate about a cannula pivot point. The endoscope is typically connected to a display screen (not shown) which allows the surgeon to view the organs, etc. of the patient. Although an endoscope is described and shown, it is to be understood that the present invention can be used with other surgical instruments. 
     The system 10 has a computer 20 that is connected to the robotic arm assembly 16 and a foot pedal 22. The foot pedal 22 is located in close proximity to the operating table 14, so that the surgeon can operate the foot pedal 22 while performing a surgical procedure. The system 10 is constructed so that the surgeon can move the surgical instrument 18 by merely depressing the foot pedal 22. The robotic arm assembly 16 includes a linear actuator 24 fixed to the table 14. The linear actuator 24 is connected to a linkage arm assembly 26 and adapted to move the linkage assembly 26 along the z axis of a first coordinate system. As shown in FIG. 2, the first coordinate system also has an x axis and a y axis. The linear actuator 24 preferably has an electric motor which turns a ball screw that moves the output shaft of the actuator. 
     The linkage arm assembly 26 includes a first linkage arm 28 attached to a first rotary actuator 30 and an end effector 32. The first rotary actuator 30 is adapted to rotate the first linkage arm 28 and end effector 32 in a plane perpendicular to the z axis (x-y plane). The first rotary actuator 30 is connected to a second rotary actuator 34 by a second linkage arm 36. The second actuator 34 is adapted to rotate the first actuator 30 in the x-y plane. The second rotary actuator 34 is connected to a third rotary actuator 38 by a third linkage arm 40. The third rotary actuator 38 is connected to the output shaft of the linear actuator 24 and adapted to rotate the second rotary actuator 34 in the x-y plane. The rotary actuators are preferably electric motors with output shafts attached to the respective linkage arms. The actuators 30, 34 and 38 preferably have gear reduction boxes to increase the torque at the linkage arms relative to the electric motors. The electric motors of the actuators 24, 30, 34 and 38 rotate in response to output signals provided by the computer 20. 
     As shown in FIG. 3, the end effector 32 has a clamp 42 which can grasp and hold the endoscope 18. The clamp 42 may be constructed as a wire with a loop that has a diameter smaller than the outside diameter of the scope 18. The clamp 42 allows the scope to be easily attached to and removed from the robotic arm assembly 16. Although a simple wire clamp is shown and described, it is to be understood that the end effector 32 may have any means required to secure the surgical instrument 18. As shown in FIGS. 1 and 2, the junction of the endoscope 18 and the end effector 32 define a second coordinate system which has an x&#39; axis, a y&#39; axis and a z&#39; axis. The junction of the end effector 32 and endoscope 18 also define the origin of a third coordinate system which has a x&#34; axis, a y&#34; axis and a z&#34; axis that is parallel with the longitudinal axis of the endoscope 18. 
     The end effector 32 has a shaft 44 which can be coupled to the first linkage arm 28. The first linkage arm 28 may have a bearing which allows the end effector 32 to rotate about the longitudinal axis of the arm 28. The end effector 32 may be constructed so that the clamp 42 and scope 18 can rotate about the y&#39; axis. The end effector 32 is preferably constructed to be detached from the first linkage arm 28, so that a sterile instrument can be used for each surgical procedure. The robotic system 10 may also have a bag or cover to encapsulate the robotic arm assembly 16 to keep the assembly 16 sterile. 
     The actuators 24, 30, 34 and 38 may each have position sensors 46-52 that are connected to the computer 20. The sensors may be potentiometers that can sense the rotational movement of the electric motors and provide feedback signals to the computer 20. The end effector 32 may also have a first joint position sensor 54 that senses the angular displacement of the effector about the x&#39; axis and a second joint position sensor 55 which senses the angular displace of the scope about the y&#39; axis. 
     FIGS. 4 and 5 show a preferred embodiment of the foot pedal 22. The foot pedal 22 has a housing 56 that supports a first foot switch 58 and a second foot switch 60. The first foot switch 58 has a first pressure transducer 62 and a second pressure transducer 64. The second foot switch 60 has third 66, fourth 68, fifth 70 and sixth 72 pressure transducers. The transducers are each connected to a corresponding operational amplifier that provides a voltage input to the computer 20. The pressure transducers 62-72 are constructed so that the resistance of each transducer decreases as the surgeon increases the pressure on the foot switches. Such a transducer is sold by Interlink Electronics. The decreasing transducer resistance increases the input voltage provided to the computer 20 from the operational amplifier. Each transducer corresponds to a predetermined direction in the third coordinate system. In the preferred embodiment, the first pressure transducer 62 corresponds to moving the endoscope toward the image viewed by the surgeon. The second transducer 64 moves the scope away from the image. The third 66 and fourth 68 transducers move the scope 18 &#34;up&#34; and &#34;down&#34;, respectively, and the fifth 70 and sixth 72 transducers move the scope 18 &#34;left&#34; and &#34;right&#34;, respectively. 
     FIG. 6 shows a schematic of the computer 20. The computer 20 has a multiplexer 74 which is connected to the pressure transducers and the position sensors. In the preferred embodiment, the multiplexer 74 has 12 channels, one channel for each sensor and transducer. The multiplexer 74 is connected to a single analog to digital (A/D) converter 76. 
     The computer also has a processor 78 and memory 80. The A/D converter 76 is constructed so that the converter can provide the processor 78 with a binary string for each voltage level received from the input signals of the system. By way of example, the transducers may provide a voltage ranging between -10 to 10 volts (V) and the converter 76 may output a different 12 bit binary string for each voltage level. An input signal of 1.0 V may correspond to the binary string 000011001010, 2.0 V may correspond to 000111010100 and so forth and so on. 
     The processor 78 is connected to an address decoder 82 and four separate digital to analog (D/A) converters 84. Each D/A converter is connected to an actuator 26, 30, 34 or 38. The D/A converters 84 provide analog output signals to the actuators in response to output signals received from the processor 78. The analog output signals preferably have a sufficient voltage level to energize the electric motors and move the robotic arm assembly. The D/A converters 84 may be constructed so that a binary 1 from the processor produces an analog output signal that drives the motors. In such an embodiment, the motors are energized for as long as the processor provides a binary 1 output signal. The decoder 82 correlates the addresses provided by the processor with a corresponding D/A converter, so that the correct motor(s) is driven. The address decoder 82 also provides an address for the input data from the A/D converter so that the data is associated with the correct input channel. 
     The processor 78 computes the movement of the robotic arm assembly 16 in accordance with the following equations. ##EQU1## where; a2=angle between the third linkage arm and the x axis. 
     a3=angle between the second linkage arm and the longitudinal axis of the third linkage arm. 
     a4=angle between the first linkage arm and the longitudinal axis of the second linkage arm. 
     L1=length of the third linkage arm. 
     L2=length of the second linkage arm. 
     L3=length of the first linkage arm. 
     π=the angle between the first linkage arm and the x&#39; axis of the second coordinate system. 
     x=x coordinate of the end effector in the first coordinate system. 
     y=y coordinate of the end effector in the first coordinate system. 
     To move the end effector to a new location of the x-y plane the processor 78 computes the change in angles a2, a3 and a4, and then provides output signals to move the actuators accordingly. The original angular position of the end effector is provided to the processor 78 by the sensors 46-55. The processor moves the linkage arms an angle that corresponds to the difference between the new location and the original location of the end effector. A differential angle Δa2 corresponds to the amount of angular displacement provided by the third actuator 38, a differential angle Δa3 corresponds to the amount of angular displacement provided by the second actuator 34 and a differential angle Δa4 corresponds to the amount of angular displacement provided by the first actuator 30. 
     To improve the effectiveness of the system 10, the system is constructed so that the movement of the surgical instrument as seen by the surgeon, is always in the same direction as the movement of the foot pedal. Thus when the surgeon presses the foot switch to move the scope up, the scope always appears to move in the up direction. To accomplish this result, the processor 78 converts the desired movement of the end of the endoscope in the third coordinate system to coordinates in the second coordinate system, and then converts the coordinates of the second coordinate system into the coordinates of the first coordinate system. 
     The desired movement of the endoscope is converted from the third coordinate system to the second coordinate system by using the following transformation matrix; ##EQU2## where; Δx&#34;=the desired incremental movement of the scope along the x&#34; axis of the third coordinate system. 
     Δy&#34;=the desired incremental movement of the scope along the y&#34; axis of the third coordinate system. 
     Δz&#34;=the desired incremental movement of the scope along the z&#34; axis of the third coordinate system. 
     a5=the angle between the z&#39; axis and the scope in the y&#39;-z&#39; plane. 
     a6=the angle between the z&#39; axis and the scope in the x&#39;-z&#39; plane. 
     Δx&#39;=the computed incremental movement of the scope along the x&#39; axis of the second coordinate system. 
     Δy&#39;=the computed incremental movement of the scope along the y&#39; axis of the second coordinate system. 
     Δz&#39;=the computed incremental movement of the scope along the z&#39; axis of the second coordinate system. 
     The angles a5 and a6 are provided by the first 54 and second 55 joint position sensors located on the end effector 32. The angles a5 and a6 are shown in FIG. 7. 
     The desired movement of the endoscope is converted from the second coordinate system to the first coordinate system by using the following transformation matrix; ##EQU3## where; Δx&#39;=the computed incremental movement of the scope along the x&#39; axis of the second coordinate system. 
     Δy&#39;=the computed incremental movement of the scope along the y&#39; axis of the second coordinate system. 
     Δz&#39;=the computed incremental movement of the scope along the z&#39; axis of the second coordinate system. 
     π=is the angle between the first linkage arm and the x axis of the first coordinate system. 
     Δx=the computed incremental movement of the scope along the x axis of the first coordinate system. 
     Δy=the computed incremental movement of the scope along the y axis of the first coordinate system. 
     Δz=the computed incremental movement of the scope along the z axis of the first coordinate system. 
     The incremental movements Δx and Δy are inserted into the algorithms (1) described above for computing the angular movements (Δa2, Δa3 and Δa4) of the robotic arm assembly to determine the amount of rotation that is to be provided by each electric motor. The value Δz is used to determine the amount of linear movement provided by the linear actuator 26. 
     After each movement of the endoscope a new π value must be computed to be used in the next incremental movement of the scope. The scope is typically always in the y&#39;-z&#39; plane, therefore the π value only changes when the end effector is moved along the y&#39; axis. The new π angle can be computed with the following equations: ##EQU4## where; d=the length of the endoscope between the end effector and the cannula pivot point. 
     r=the distance along the y&#39; axis between the end effector and the cannula pivot point. 
     m=the incremental movement of the scope. 
     The new π value is computed and stored in the memory of the computer for further computation. 
     FIG. 8 shows a flowchart of a program used to operate the system. The computer 20 initially computes the location of the end effector 32 with the input provided by the sensors 46-55. When the surgeon presses on one of the foot switches, the pedal provides a input signal to the computer. For example, the surgeon may want a closer look at an object in front of the endoscope. The surgeon then presses the top of the first foot switch, depressing the first transducer and providing an input signal to the computer. The input signal is converted into an 12 bit binary string which is received by the processor. The 12 bit string corresponds to a predetermined increment of Δz&#34;. The computer is constantly sampling the foot pedal, wherein each sample corresponds to a predetermined increment in the corresponding axis&#34;. If the surgeon holds down the foot pedal during two sampling periods then the increment to be moved is 2×Δz&#34;. The converter also provides a multiplication factor for each increase in voltage level received from the amplifier of the transducer, so that the increments are increased for each increase in voltage. Thus the surgeon can increase the amount of incremental movement by increasing the pressure on the foot switch. 
     The processor 78 then determines the new coordinates in the third coordinate system. The incremental movements in the third coordinate system (Δx&#34;, Δy&#34; and Δz&#34;) are used to compute the increment movements in the second coordinate system (Δx&#39;, Δy&#39; and Δz&#39;) and the coordinates in the first coordinate system (Δx, Δy and Δz). The incremental movements are then used to determine the change in the angles a2, a3 and a4, and the linear movement of actuator 24. The computer provides output signals to the appropriate electric motors to move the robotic arm assembly to the new position. The new π angle is computed and the process is repeated. The present invention thus allows the surgeon to remotely move a surgical instrument in a manner that directly correlates with the viewing image seen through the endoscope. 
     In the preferred embodiment, the system moves the end effector 32 so that the endoscope is always aligned in the same orientation relative to the patient. This is accomplished by moving the end effector so that the angle a6 is always equal to zero. Thus after each independent movement of the endoscope, the angle a6 is sensed by the sensor 55. If the angle a6 is not equal to zero, the processor moves the end effector in accordance with the following subroutine. 
     If a6 &gt;zero then the end effector is moved an increment equal to: 
     Δπ=π+constant 
     If a6&lt;zero then the end effector is moved an increment equal to: 
     Δπ=π-constant 
     where; 
     Δπ=the incremental angular movement of the end effector. 
     π=the preceding angle π. 
     constant=some predetermined incremental angular movement of the end effector. 
     The processor moves the end effector in accordance with the above described subroutine until the angle a6 is equal to zero. The new π angle is then stored and used for further computation. Maintaining the angle a6 at zero insures that the view seen by the surgeon is in the same orientation for all end effector positions. 
     As shown in FIG. 10, each linkage arm 28, 36 or 80 is preferably coupled to a first helical gear 92. The first helical gear 92 is mated with a second helical gear 94 that is coupled to an actuator 30, 34 or 38 by a clutch 96. The clutches 96 are preferably constructed from magnetic plates that are coupled together when power is supplied to the clutches. When power is terminated, the clutches 96 are disengaged and the actuators are decoupled from the drive shafts such that the linkage arms can be manually moved by the operator. Power is supplied to the clutches 96 through a switch 98 which can be operated by the surgeon. The clutches allow the surgeon to disengage the actuators and manually move the position of the endoscope. 
     As shown in FIG. 6, the system may have a lever actuated input device 100 that is commonly referred to as a &#34;joystick&#34;. The input device 100 can be used in the same manner as the foot pedal, wherein the operator can move the endoscope by moving the lever 102 of the device 100. The device 100 may also have a plurality of memory buttons 104 that can be manipulated by the operator. The memory buttons 104 are coupled to the processor of the computer. The memory buttons 104 include save buttons 106 and recall buttons 108. When the save button 106 is depressed, the coordinates of the end effector in the first coordinate system are saved in a dedicated address(es) of the computer memory. When a recall button 108 is pushed, the processor retrieves the data stored in memory and moves the end effector to the coordinates of the effector when the save button was pushed. 
     The save memory buttons allow the operator to store the coordinates of the end effector in a first position, move the end effector to a second position and then return to the first position with the push of a button. By way of example, the surgeon may take a wide eye view of the patient from a predetermined location and store the coordinates of that location in memory. Subsequently, the surgeon may manipulate the endoscope to enter cavities, etc. which provide a more narrow view. The surgeon can rapidly move back to the wide eye view by merely depressing the recall button of the system. Additionally, the last position of the endoscope before the depression of the recall button can be stored so that the surgeon can again return to this position. 
     As shown in FIG. 9, the system is preferably moved during the recall cycle in a ramping fashion so that there is not any sudden movement of the linkage arm assembly. Instead of a purely linear movement of the actuators to move the end effector from point A to point B, the processor would preferably move the linkage arm assembly in accordance with the following equation. ##EQU5## where; t =time 
     θ 0  =the initial position of the end effector. 
     θ 1  =the final position of the end effector. 
     θ 0  =the velocity of the end effector at position θ 0 . 
     θ 1  =the velocity of the end effector at position θ 1 . 
     By moving each actuator in accordance with the above described algorithm, the linkage arm assembly movement will gradually increase and then gradually decrease as the arm leaves and approaches the original and final positions, respectively. Moving the arm in accordance with the above described equation produces low initial and final arm acceleration values. The gradually increasing and decreasing movement of the arm prevents any abrupt or sudden movement of the arm assembly. 
     As shown in FIG. 11, the robotic arm assembly is preferably encapsulated by a bag 110. The bag 110 isolates the arm assembly 26 so that the arm does not contaminate the sterile field of the operating room. The bag 110 can be constructed from any material suitable to maintain the sterility of the room. The bag 110 may have fastening means such as a hook and loop material or a zipper which allows the bag to be periodically removed and replaced after each operating procedure. 
     FIG. 12 shows an alternate embodiment of an end effector 120. The end effector 120 has a magnet 122 which holds a metal collar 124 that is coupled to the endoscope 18. The collar 124 has a center aperture 126 which receives the endoscope 18 and a pair of arms 128 which together with screw 130 capture the scope 18. The collar 124 is constructed to fit within a channel 132 located in the end effector 120. The magnet 122 is typically strong enough to hold the endoscope during movement of the linkage arm, yet weak enough to allow the operator to pull the collar and scope away from the end effector. 
     FIG. 13 shows a preferred embodiment of an end effector 140 that couples the surgical instrument 142 to a robotic system 144. The end effector 140 has a collar holder 146 which can capture a collar 148 that is attached to the instrument 142. The collar 148 has a lip 150 which is supported by the base of the collar holder 146 when the instrument 142 is coupled to the robotic assembly 144. The collar 148 has a bearing 152 that is fastened to the instrument 142 and which has gear teeth 153 that mesh with a worm gear 154 incorporated into the end effector 140. The worm gear 154 is typically connected to an electric motor (not shown) which can rotate the gear 154 and spin the instrument 142 about its longitudinal axis. 
     The end effector 140 is preferably utilized in a robotic system schematically shown in FIG. 14. The worm gear replaces the first actuator 30 of the robotic system shown in FIG. 1. The passive joints 156 and 158 allow the same degrees of freedom provided by the passive joints depicted in FIG. 3. The joints 156 and 158 are shown separately for purposes of clarity, it being understood that the joints may be physically located within the end effector 140. 
     The surgical instrument is typically coupled to a camera (not shown) and a viewing screen (not shown) such that any spinning of the instrument about its own longitudinal axis will result in a corresponding rotation of the image on the viewing screen. Rotation of the instrument and viewing image may disorient the viewer. It is therefore desirable to maintain the orientation of the viewing image. 
     In the embodiment shown in FIG. 1, the robotic assembly moves the instrument in accordance with a set of algorithms that maintain the angle a6 at a value of zero. This is accomplished by computing a new angle a6 after each movement and then moving the instrument so that a6 is equal to zero. Depending upon the location of the end effector, moving the instrument to zero a6 may require energizing some or all of the actuators, thus necessitating the computation of the angles a2, a3 and a4. Using the worm gear 154 of the end effector 140, the proper orientation of the viewing image can be maintained by merely rotating the worm gear 154 and scope 142 a calculated angle about the longitudinal axis of the instrument 142. 
     As shown in FIG. 15, the endoscope 142 is oriented within a fixed fourth coordinate system that has a z axis that is parallel with the z axis of the first coordinate system shown in FIG. 1. The origin of the fourth coordinate system is the intersection of the instrument and the end effector. For purposes of providing reference points, the instrument is initially in a first position and moved to a second position. The endoscope 142 itself defines the third coordinate system, wherein the z&#34; axis coincides with the longitudinal axis of the instrument 142. To insure proper orientation of the endoscope 142, the worm ygear 154 rotates the instrument 142 about its longitudinal axis an amount Δθ6 to insure that the y&#34; axis is oriented in the most vertical direction within the fixed coordinate system. Δθ6 is computed from the following cross-products. 
     
         Δθ6=zi&#34;×(yo&#34;×yi&#34;) 
    
     where; 
     Δθ6=the angle that the instrument is to be rotated about the z&#34; axis. 
     yo&#34;=is the vector orientation of the y&#34; axis when the instrument is in the first position. 
     yi&#34;=is the vector orientation of the y&#34; axis when the instrument is in the second position. 
     zi&#34;=is the vector orientation of the z&#34; axis when the instrument is in the second position. 
     The vectors of the yi&#34; and zi&#34; axis are computed with the following algorithms. ##EQU6## where; Θ4=is the angle between the instrument and the z axis in the y-z plane. 
     Θ5=is the angle between the instrument and the z axis in the x-z plane. 
     z=is the unit vector of the z axis in the first coordinate system. 
     The angles Θ4 and Θ5 are provided by the joint position sensors coupled to the joints 156 and 158. The vector yo&#34; is computed using the angles Θ4 and Θ5 of the instrument in the original or first position. For the computation of yi&#34; the angles Θ4 and Θ5 of the second position are used in the transformation matrix. After each arm movement yo&#34; is set to yi&#34; and a new yi&#34; vector and corresponding Δθ6 angle are computed and used to re-orient the endoscope. Using the above described algorithms, the worm gear continuously rotates the instrument about its longitudinal axis to insure that the pivotal movement of the endoscope does not cause a corresponding rotation of the viewing image. 
     When the surgical instrument is initially inserted into the patient the exact location of the pivot point of the instrument is unknown. It is desirable to compute the pivot point to determine the amount of robotic movement required to move the lens portion of the scope. Accurate movement of the end effector and the opposite lens portion of the instrument can be provided by knowing the pivot point and the distance between the pivot point and the end effector. The pivot point location can also be used to insure that the base of the instrument is not pushed into the patient, and to prevent the instrument from being pulled out of the patient. 
     The pivot point of the instrument is calculated by initially determining the original position of the intersection of the end effector and the instrument PO, and the unit vector U0 which has the same orientation as the instrument. The position P(x, y, z) values can be derived from the various position sensors of the robotic assembly described above. The unit vector U0 is computed by the transformation matrix: ##EQU7## 
     After each movement of the end effector an angular movement of the instrument Δθ is computed by taking the arcsin of the cross-product of the first and second unit vectors U0 and U1 of the instrument in accordance with the following line equations L0 and L1. 
     
         Δθ=arc sin (|T|) 
    
     
         T=U0×U1 
    
     where; 
     T=a vector which is a cross-product of unit vectors U0 and U1. 
     The unit vector of the new instrument position U1 is again determined using the positions sensors and the transformation matrix described above. If the angle Δθ is greater than a threshold value, then a new pivot point is calculated and U0 is set to U1. As shown in FIG. 16, the first and second instrument orientations can be defined by the line equations L0 and L1: 
     L0: 
     
         x0=Mx0·Z0+Cx0 
    
     
         y0=My0·Z0+Cy0 
    
     L1: 
     
         x1=Mx1·Z1+Cx1 
    
     
         y1=My1·Z1+Cy1 
    
     where; 
     Z0=a Z coordinate along the line L0 relative to the z axis of the first coordinate system. 
     Z1=a Z coordinate along the line L1 relative to the z axis of the first coordinate system. 
     Mx0=a slope of the line L0 as a function of Z0. 
     My0=a slope of the line L0 as a function of Z0. 
     Mx1=a slope of the line L1 as a function of Z1. 
     My1=a slope of the line L1 as a function of Z1. 
     Cx0=a constant which represents the intersection of the line L0 and the x axis of the first coordinate system. 
     Cy0 =a constant which represents the intersection of the line L0 and the y axis of the first coordinate system. 
     Cx1 =a constant which represents the intersection of the L1 and the x axis of the first coordinate system. 
     Cy1 =a constant which represents the intersection of the line L1 and the y axis of the first coordinate system. 
     The slopes are computed using the following algorithms: 
     Mx0=Ux0/Uz0 
     My0=Uy0/Uz0 
     Mx1=Ux1/Uz1 
     My1=Uy1/Uz1 
     Cx0=P0x-Mx1·P0z 
     Cy0=P0y-My1·P0z 
     Cx1=P1x-Mx1·P1z 
     Cy1=P1y-My1·P1z 
     where; 
     U0(x, y and z)=the unit vectors of the instrument in the first position within the first coordinate system. 
     U1(x, y and z)=the unit vectors of the instrument in the second position within the first coordinate system. 
     P0(x, y and z)=the coordinates of the intersection of the end effector and the instrument in the first position within the first coordinate system. 
     P1(x, y and z)=the coordinates of the intersection of the end effector and the instrument in the second position within the first coordinate system. 
     To find an approximate pivot point location, the pivot points of the instrument in the first orientation L0 (pivot point R0) and in the second orientation L1 (pivot point R1) are determined, and the distance half way between the two points R0 and R1 is computed and stored as the pivot point R ave  of the instrument. The pivot point R ave  is determined by using the cross-product vector T. 
     To find the points R0 and R1 the following equalities are set to define a line with the same orientation as the vector T that passes through both L0 and L1. 
     tx=Tx/Tz 
     ty=Ty/Tz 
     where; 
     tx=the slope of a line defined by vector T relative to the z-x plane of the first coordinate system. 
     ty=the slope of a line defined by vector T relative to the z-y plane of the first coordinate system. 
     Tx=the x component of the vector T. 
     Ty=the y component of the vector T. 
     Tz=the z component of the vector T. 
     Picking two points to determine the slopes Tx, Ty and Tz (eg. Tx=x1-x0, Ty=y1-y0 and Tz=z1-z0) and substituting the line equations L0 and L1, provides a solution for the point coordinates for R0(x0, y0, z0) and R1 (x1, y1, z1) as follows. 
     z0=((Mx1-tx)z1+Cx1-Cx0)/(Mx0-tx) 
     z1=((Cy1-Cy0)(Mx0-tx)-(Cx1-Cx0)(My0-ty))/((My0-ty) (Mx1-tx)-(My1-ty)(Mx0-tx)) 
     y0=My0·z0+Cy0 
     y1=My1·z1+Cy1 
     x0=Mx0·z0+Cx0 
     x1=Mx1·z1+Cx1 
     The average distance between the pivot points R0 and R1 is computed with the following equation and stored as the pivot point of the instrument. 
     
         R.sub.ave =((x1+x0)/2,(y1+y0)/2,(z1+z0)/2) 
    
     The pivot point can be continually updated with the above described algorithm routine. Any movement of the pivot point can be compared to a threshold value and a warning signal can be issued or the robotic system can become disengaged if the pivot point moves beyond a set limit. The comparison with a set limit may be useful in determining whether the patient is being moved, or the instrument is being manipulated outside of the patient, situations which may result in injury to the patient or the occupants of the operating room. 
     While certain exemplary embodiments have been described and shown in the accompanying drawings, it is to be understood that such embodiments are merely illustrative of and not restrictive on the broad invention, and that this invention not be limited to the specific constructions and arrangements shown and described, since various other modifications may occur to those ordinarily skilled in the art.