CROSS-REFERENCE TO RELATED APPLICATIONS 
       [0001]    This application claims the benefit of priority under 35 U.S.C. §119(a) to German Patent Application DE 10 2014 010 638.1, filed Jul. 17, 2014 (pending), the disclosure of which is hereby incorporated by reference in its entirety. 
       TECHNICAL FIELD 
       [0002]    The present invention relates to a method for controlling a robot, as well as a device and a computer program product to execute such a method. 
       BACKGROUND 
       [0003]    Controlling a robot by determining the distance of a state variable of the robot from a limit, and triggering a safety action when this distance satisfies a prespecified condition, is well-known from practical in-house experience. A STOP 0, for example, can be triggered, i.e. the robot can be shut down by interrupting the power supply, as soon as its Tool Center Point (TCP) exceeds a work space limit or its speed exceeds a permissible speed limit. 
         [0004]    It is also well-known from practical in-house experience, that this can be tested by manually taking the robot to such limits; i.e. manually taking the TCP over the work space limit, or operating with a speed exceeding the speed limit, to test if this triggers the safety action. 
         [0005]    Particularly for more complex limits, such as work space limits that are defined by curved hypersurfaces in the state space of the robot and/or as a function of the state variable itself, however, this type of test is difficult and is notably not very intuitive. 
         [0006]    Besides determining a distance to a prespecified limit, identifying the distances of a current position to a group of saved positions and selecting that saved position, of which the distance to the current position is minimal in a program, is also well-known from our own DE 10 2008 062 623 A1. 
       SUMMARY 
       [0007]    The object of the present invention is to improve the control of a robot. In doing so, in the interest of a more compact presentation, both control in the narrower cybernetic sense, i.e. a specification of control variables independent of acquired actual values (“feedforward control”), and regulation, i.e. a specification of control variables on the basis of prespecified target values and acquired actual values (“feedback control”), are generally referred to as control. 
         [0008]    This object is solved by a method as discussed herein. 
         [0009]    According to one aspect of the present invention, a robot is optionally controlled in one or more, preferably all, poses in a first mode of operation or a second mode of operation, different from the first, in particular by a device configured for this purpose. 
         [0010]    In the present case, a pose is understood in particular to be the position of the robot, definable, in particular defined, by the coordinates, in particular angles, of its joints, or rather the position and/or orientation of its links relative to one another. 
         [0011]    The mode of operation can be switched between the first and second in one model, in particular automatically via a mode of operation selection means of the device, and/or via a user input. Correspondingly, in one model, the robot can optionally be controlled in the first or the second mode of operation in at least one pose; in a further development it can even also be controlled in one or more modes of operation different from it. The selection of the mode of operation can be pose-dependent or pose-independent; the first or second mode of operation can in particular be selected in advance and then any pose can be set. 
         [0012]    In both the first and the second mode of operation a distance of a state variable of the robot from a first limit is determined, in particular via a distance means of the device configured for this purpose, whereby the distance is preferably determined in the same way in the first and second mode of operation. 
         [0013]    A one- or multidimensional state variable in the sense of the present invention can include, in particular be, one or more, preferably three, position coordinates, for example Cartesian, cylindrical or spherical coordinates, and/or one or more, preferably three, orientation coordinates, for example Euler or Cardan angles, of one or more robot-fixed references, in particular of a TCP of the robot, and/or a first and/or higher time derivative thereof. Position and orientation coordinates can also include, in particular be, Denavit-Hartenberg parameters, quaternions or the like. In addition or alternatively, a one- or multidimensional state variable in the sense of the present invention can include, in particular be, in particular one or more, preferably all, joint coordinates of the robot and/or at least a first and/or higher time derivative thereof. 
         [0014]    A distance of a state variable from a limit can be defined or determined in particular via a standard, for example an, in particular weighted, amount or maximum standard. For example, the distance of a three-dimensional position (x, y, z) from a linear limit defined by y=z=0 can be similarly defined via the amount standard □(y 2 +z 2 ) or via the maximum norm max{y, z}. 
         [0015]    In one model the limit is oriented and the distance is vectored or signed, so that a state variable exhibits a positive or negative distance when it lies on the one or other side of the oriented limit. In this way the distance of a three-dimensional position (x, y, z) from a planar limit defined by x=0 can be defined by the component x and is correspondingly positive or negative, when the position lies above or below the limit. In this manner, in one model, a permissible approach of the robot to the limit can simply and/or reliably be differentiated from an impermissible encroachment into a prohibited range defined by the limit. 
         [0016]    In the first mode of operation, a safety response is triggered when the distance satisfies a first condition, in particular exceeds or falls below a specified first limit value. 
         [0017]    The safety response can in particular include, in particular be, a shutdown of the robot, in particular by one or more, preferably mechanical, brakes and/or one or more, preferably all, drives of the robot, and/or a separation of one or more, preferably all, drives of the robot from the power supply, in particular prior to or after shutdown. Accordingly, the safety response can include a so-called STOP 0, i.e. a shutdown of the robot via mechanical brakes and separation of all the drives of the robot from a power supply prior to shut down; a so-called STOP 1, i.e. a shutdown of the robot via its drives and separation of the drives from a power supply after shut down; or a so-called STOP 2, i.e. a shutdown of the robot via its drives without separation of the drives from a power supply after shutdown, in particular be such a STOP. The safety response is preferably triggered and/or executed, in particular redundantly, preferably in a variety of ways, using secure technology. 
         [0018]    In the second mode of operation the robot can be moved by manually applying a guiding force to the robot. For this purpose the robot can be, or can be made to be, gravity-compensated, in particular preferably in a per se known manner, so that it follows a manually applied guiding force and at least essentially maintains its new pose when this guiding force ceases. The robot can likewise be, or can be made to be, impedance-controlled, in particular preferably in a per se known manner, so that it follows a manually applied guiding force and at least essentially returns to its previous or a specified pose when this guiding force ceases. Preferably the robot can be moved by manual application of a guiding force on the robot, by means of a force control or a corresponding soft position control. 
         [0019]    The robot can be movable by manual application of a guiding force on the robot in the first mode of operation as well, in particular in the same manner as in the second mode of operation. In a different model the robot is moved program-controlled automatedly in the first mode of operation; it can in particular run a specified path, or set a specified pose, in particular several times in succession. 
         [0020]    In the second mode of operation, however, in contrast to the first mode of operation, the safety response is not triggered in the same pose or poses, because the distance satisfies the first condition, in particular not (already) triggered when, or rather as soon as, the distance satisfies the first condition. In other words, satisfying the condition, which is enough to trigger the safety response in the first mode of operation, is not enough to trigger the safety response in the second mode of operation. Instead, when the distance satisfies the first condition, a positioning force is motorically applied to the robot in dependence on the distance, so as to reduce the distance when the robot is unobstructed. 
         [0021]    In accordance with this aspect, safety monitoring for the first mode of operation, which triggers the safety response in the first mode of operation when the distance satisfies the first condition, for example the TCP exceeds a specified work space limit or its speed exceeds a specified speed limit, can thus be tested in the second mode of operation by intentional manual exceedance of these limits, without triggering the safety response. 
         [0022]    Instead, in this case, a positioning force is motorically applied to the robot in dependence on the distance that seeks to reduce the distance, or is such that it reduces the distance when the robot is unobstructed. In other words, virtual constraints embodied by the first limit push the robot, encroaching beyond the first limit into a prohibited range, back. The operator, who is manually guiding the robot across the limit, thus haptically experiences the resistance of this positioning force pushing back toward the limit. 
         [0023]    Safety monitoring or specified first limits can thus be tested and/or experienced intuitively, in particular, in a manner of speaking, haptically sensed and/or detected with the robot. 
         [0024]    In one model, the positioning force in the second mode of operation is only applied to the robot when the distance satisfies the first condition, so that it cannot be haptically experienced through the positioning force until the first limit is reached or exceeded. In another model, the positioning force in the second mode of operation is also applied to the robot when the distance satisfies the first condition. Under certain circumstances, however, it is also applied when the distance does not yet satisfy the first condition, so that it can already be haptically experienced through the positioning force prior to reaching, or rather when approaching, the first limit. 
         [0025]    The positioning force can in particular be, or be made to be, directed to the first limit. In one model it is dependent on the distance and/or a first and/or higher time derivative thereof, in particular proportional to it, and/or limited to a maximum value. 
         [0026]    In addition to the positioning force in one model, an, in particular optic, acoustic and/or haptic, signal, in particular a vibration, is emitted in the second mode of operation when the distance satisfies the first condition. This can provide additional and/or more sensitive or precise feedback with regard to reaching the first limit. In one model, a vibration can be emitted by a vibrotactile element, in particular for manual application of the guiding force, and/or an input device to input control instructions, or a corresponding changing or pulsating control of the drives of the robots. 
         [0027]    In one model, a signal-technical and/or physical output of a distance means to determine the distance is connected in the first mode of operation with a safety means to trigger the safety response, and in the second mode of operation alternatively with a signal means to emit the signal. The same determination of the distance, executed in the first mode of operation to trigger the safety response, can thus be reliably, signal-technically and/or physically, tested in the second mode of operation. 
         [0028]    In one model, a first safety response is triggered in the first mode of operation, when a first distance of a first state variable from a first limit satisfies a first condition, and in the second mode of operation
       in a further development the first safety response, and in another further development a second safety response different from the first safety response is triggered, when   in a further development the first distance and in another further development a second distance different from the first distance   in a further development of the first state variable and in another further development a second state variable of the robot different from the first state variable   from a second limit different from the first limit   in a further development satisfies the first condition and in another further development satisfies a second condition different from the first condition,
 
in particular without the positioning force being motorically applied to the robot in dependence on the distance, to reduce the distance when the robot is unobstructed.
       
 
         [0034]    Additionally or alternatively in one model, a first safety response is triggered in the first mode of operation, when a first distance of a first state variable from a first limit satisfies a first condition, and in the second mode of operation
       in a further development the first safety response, and in another further development a second safety response different from the first safety response is triggered, when   in a further development the first distance and in another further development a second distance different from the first distance   in a further development of the first state variable and in another further development a second state variable of the robot different from the first state variable   in a further development of the first limit and in another further development of a second limit different from the first limit   satisfies a second condition different from the first condition in particular without the positioning force being motorically applied to the robot in dependence on the distance, to reduce the distance when the robot is unobstructed.       
 
         [0040]    If, for example, the first state variable is a current Cartesian position (x, y, z) of the TCP; the first limit is a specified planar work space limit G: x=0; the first distance d is the sign-oriented difference between this position and this work space limit; the first condition is that this first distance is greater or equal to zero (d □0); and the first safety response is a STOP 1, then in a model in the second mode of operation
       in a further development a STOP 1 (the first safety response) and in another further development a STOP 0 or STOP 2 (a second safety response different from the first safety response) is triggered, when   the sign-oriented component x (the first distance d) of the first state variable (x, y, z)   from a second limit different from the first limit, for example G′: x=1,   satisfies the first condition (d □0).       
 
         [0045]    Therefore, in this example in the second mode of operation, instead of a STOP 1 when the limit x=0 is exceeded, a STOP 0, 1 or 2 can be executed when the TCP exceeds a different limit. 
         [0046]    Similarly in the above example in the second mode of operation
       in a further development a STOP 1 (the first safety response) and in another further development a STOP 0 or STOP 2 (a second safety response different from the first safety response) can be triggered, when   a sign-oriented difference (the first distance d) between a Cartesian speed v actual  of the TCP (a second state variable of the robot different from the first state variable) and a permissible maximum speed v actual  (a second limit different from the first limit) satisfies the first condition (d □0).       
 
         [0049]    Therefore, in this example in the second mode of operation, instead of a STOP 1 when the limit x=0 is exceeded, a STOP 0, 1 or 2 can be executed when the TCP exceeds a permissible maximum speed. 
         [0050]    Similarly in the above example in the second mode of operation
       in a further development a STOP 1 (the first safety response) and in another further development a STOP 0 or STOP 2 (a second safety response different from the first safety response) can be triggered, when   the maximum d′=max{y, z} of a deviation of a component (a second distance different from the first distanced) of the current Cartesian position (x, y, z) of the TCP (of the first state variable) from a second limit (y=z=0) different from the first limit satisfies a second condition d′&gt;d max  different from the first condition.       
 
         [0053]    Therefore, in this example in the second mode of operation, instead of a STOP 1 when the limit x=0 is exceeded, a STOP 0, 1 or 2 can be executed when the TCP exceeds a different limit. 
         [0054]    Similarly in the above example in the second mode of operation
       in a further development a STOP 1 (the first safety response) and in another further development a STOP 0 or STOP 2 (a second safety response different from the first safety response) can be triggered,   when the first distance d of the first state variable (x, y, z) from the first limit G: x=0   satisfies a second condition different from the first condition, for example       
 
         [0000]    
       
         
           
             
               
                 ∫ 
                 t 
               
                
               
                 
                    
                   
                     ( 
                     τ 
                     ) 
                   
                 
                  
                 
                     
                 
                  
                 
                    
                   τ 
                 
               
             
             &gt; 
             
               
                 d 
                 0 
               
               . 
             
           
         
       
     
         [0058]    Therefore, in this example in the second mode of operation, instead of a STOP 1 when the limit x=0 is exceeded, a STOP 0, 1 or 2 can be executed when an integral of the difference d between the position and the work space limit over the time t exceeds a specified limit d 0 . 
         [0059]    By triggering a safety response in the second mode of operation without motorically applying the positioning force on the robot in dependence on the distance, so as to reduce the distance when the robot is unobstructed, the safety monitoring, so to speak, overrules the haptic interaction in the second mode of operation if required. In other words, the positioning force in dependence on the distance, so as to reduce the distance when the robot is unobstructed, is only applied in the second mode of operation, if or as long as the first condition is satisfied AND a second condition different from it is not satisfied. 
         [0060]    In one model, the first limit and/or a limit to which a distance is determined in the second mode of operation depend on a state variable, in particular the state variable, the distance of which to this limit is determined. The specification of advantageous position-, direction-, orientation- and/or speed-dependent limits in a model is therefore made possible. 
         [0061]    In one model, the first limit and/or a limit to which a distance is determined in the second mode of operation is defined by two or more hypersurfaces, in particular one or more pairs of two parallel or non-parallel hypersurfaces, and/or by one or more curved hypersurfaces in a state space of the robot. A curved hypersurface advantageously allows a more precise and/or numerically more easily manageable consideration of more complex limits. A curved hypersurface is preferably simulated by so-called NURBS. 
         [0062]    In one model, in the second mode of operation, the robot is moved, in particular intentionally, by manual application of a guiding force on the robot in such a way that the distance of the state variable of the robot from the first limit satisfies the first condition. 
         [0063]    According to another aspect of the present invention, which can preferably be combined with the previously described aspect, a distance of a state variable of the robot from two or more, different from one another, specified references in a state space of the robot is determined in a mode of operation when the robot is moved by manual application of a guiding force on the robot, in particular by a device designed for this purpose, the smallest of these distances is determined, and a positioning force is motorically applied to the robot so as to minimize the smallest of the distances when the robot is unobstructed, or rather seeks to minimize the determined smallest distance or rather is such that it minimizes this determined smallest distance when the robot is unobstructed. 
         [0064]    The mode of operation can in particular be the previously described first or second mode of operation or it can also be another different mode of operation. 
         [0065]    Correspondingly, in one model, in particular via the mode of operation selection means of the device, this mode of operation can be switched to automatically and/or via a user input. 
         [0066]    The state variable can in particular be one of the previously described state variables, in particular therefore one or more position and/or orientation coordinates of the TCP, joint coordinates, or the like. The distance can in particular be one of the previously described distances, in particular an amount or maximum standard, or the like. In one model the distance is not signed, and is in particular always positive. In particular, if distances can also exhibit negative values, in one model the smallest of these distances in terms of the amount is determined and a positioning force is motorically applied to the robot, so as to minimize this smallest distance in terms of the amount when the robot is unobstructed. 
         [0067]    In one model, the state space of the robot is the space, or rather the quantity, of all possible values of the state variable, for example the Cartesian work space or the space of possible joint coordinates. In another model, the state space of the robot is a specified proper subset of the space, or rather the quantity of all possible values of the state variable. By specifying a radius around the current TCP position, for example, the user can specify a (hyper) sphere as a state space, so that the system searches only in this state space which has been limited by a specification or an input in the manner described here. Correspondingly, in one model, the state space is variably specifiable or specified, in particular by a user. 
         [0068]    According this aspect the robot is taken to the next of several specified references. This can in particular simplify the locating, and thus the reading, of the previously described limits. Correspondingly, a reference in the sense of this aspect can in particular be a limit in accordance with the previously described aspect. In particular, it can similarly simplify the locating of saved poses, program points and the like. Likewise, it can in particular simplify the locating of not directly saved intermediate points on tracks specified by saved points, surfaces and the like. Correspondingly, a reference in the sense of this aspect can generally be in particular a specified, in particular saved, value or value range, in particular a line, (hyper) surface or a (hyper) volume, of the state variable or the state space. For example, a saved TCP position is a value in the work space of the robot, an (intermediate) point on a saved track of the TCP, a value range or a line in the work space and a limit in accordance with the previously described aspect, in particular a (hyper) surface in the work space. 
         [0069]    Correspondingly, in one model, the specified references in the state space of the robot include positions of a robot-fixed reference, in particular a TCP, and/or poses of the robot, in particular a specified track of the robot, and/or, in particular virtual, structures, in particular walls and/or coordinate systems, in the state space of the robot. 
         [0070]    In one model the reference in the state space of the robot, which exhibits the determined smallest distance, is displayed, in particular by highlighting a corresponding program instruction in a saved program of the robot. As in DE 10 2008 062 623 A1 mentioned at the outset, to which reference was made in the interest of completeness, and the content of which is expressly included in the present disclosure, the user can thus advantageously more easily test and/or change a saved program. 
         [0071]    In one model the robot is controlled flexibly, in particular in a force-regulated and/or gravity-compensated manner, so as to be movable by manual application of a guiding force to the robot, preferably as already described above with reference to the previous aspect. The positioning force can in particular be applied by an impedance control, the desired or target value of which is that reference in the state space of the robot, for which the smallest value is, or has been, determined. In other words, via the impedance control, preferably in a per se known manner, a virtual spring is, or can be, tensioned between the current, or actual, pose of the robot and the reference, for which the smallest distance is, or has been, determined. The unobstructed robot is taken to this reference by the impedance control and thus minimizes the distance. 
         [0072]    A means in the sense of the present invention can be hardware- and/or software-technically configured, in particular an, in particular digital, processing unit, in particular microprocessor unit (CPU), preferably data- or signal-linked with a memory and/or bus system, and/or exhibit one or more programs or program modules. The CPU can be configured to execute commands, which are implemented as a program stored in a memory system, acquire input signals from a data bus and/or deliver output signals to a data bus. A memory system can exhibit one or more, in particular different, storage media, in particular optical, magnetic, solid-state and/or other non-volatile media. The program can be structured in such a way that it embodies, or is able to execute, the processes described here, so that the CPU can execute the steps of such processes and thereby in particular control the actuator. 
     
    
     
       BRIEF DESCRIPTION OF THE FIGURES 
         [0073]    Additional advantages and features result from the dependent claims and the design examples. For this purpose, the figures show, in part schematically: 
           [0074]      FIG. 1  is a schematic illustration of a section of a state space of a robot to illustrate a method according to one model of the present invention. 
           [0075]      FIG. 2  is a schematic illustration of the procedure of a method according to one model of the present invention. 
           [0076]      FIG. 3  is a schematic illustration of a section of a control device to implement the method. 
       
    
    
     DETAILED DESCRIPTION 
       [0077]      FIG. 1 ,  2  show a section of a state space of a robot to illustrate a method according to one model of the present invention, or its procedure, executed by a device partially indicated in  FIG. 3 . The two previously described aspects are illustrated together by way of an example; they can, however, also be implemented independently. 
         [0078]    First, a first mode of operation M 1  or a different second mode of operation M 2  is selected in a step S 10 , for example via a user&#39;s input. In a subsequent step S 20 , a device  40 , hardware and software technically configured to execute the method described here and partially indicated in  FIG. 3 , checks if the second mode of operation (S 20 : “Y”) is selected; in a subsequent step S 30  it checks if the first mode of operation (S 30 : “Y”) is selected. If the neither of the two modes of operation is selected (S 20 : “N”, S 30 : “N”), the process reverts back to step S 20 . 
         [0079]    The robot is movable by manual application of a guiding force on the robot at least in the second mode of operation M 2 , for example in an impedance-regulated manner as illustrated in the following, or controlled in a gravity-compensated manner. In the first mode of operation, on the other hand, the robot is moved automatedly in a program-controlled manner. 
         [0080]    If the first mode of operation M 1  is selected (S 30 : “Y”), a distance d of a state variable of the robot from a first limit is determined in a subsequent step S 40 . 
         [0081]    In the two-dimensional example, simplified so as to be a better representation, the state variable x consists of two Cartesian position coordinates x i , x j  of the TCP of a robot (not shown). To illustrate, in  FIG. 1 , two different values x 1  and x 2  for this state variable, i.e. two different TCP positions x 1 , x 2  are marked in the state space {x i , x j }. 
         [0082]    In order to be a better representation, the first limit G is defined in a simplified manner by G 1 : x i =0 and G 2 : x j =0, and is indicated in  FIG. 1  with a dotted line. The limit is oriented in such a way, that TCP positions with positive coordinate values, such as in particular the example position x 1 , exhibit a negative distance d&lt;0, while TCP positions with at least one negative coordinate value, such as in particular the example position x 2  exhibit a positive distance d&gt;0. 
         [0083]    In the first mode of operation M 1 , in a subsequent step S 50 , the device  40  checks if this distance d satisfies a first condition, which is then satisfied in the design example, when the TCP exceeds the limit G, or the signed distance d is greater than zero (d&gt;0). 
         [0084]    If the distance d satisfies the first condition (S 50 : “Y”), a safety response is triggered, in the design example a STOP 1. Otherwise (S 50 : “N”), the process reverts back to step S 20 . In other words, a STOP 1 is triggered in the first mode of operation M 1 , as soon as the TCP exceeds the limit G. 
         [0085]    If the second mode of operation M 2  is selected (S 20 : “Y”), the distance d from the first limit G is determined in a subsequent step S 70 , in the same manner as in the first mode of operation M 1 . Correspondingly, the steps S 40  and S 70  can also be replaced with a common step from step S 20 . In particular, an output of a distance means  10  of the control device  40  of the robot, as indicated in  FIG. 3 , can be connected in the first mode of operation M 1  with a safety means  30  of the control device  40  to trigger the safety response STOP 1, and in the second mode of operation M 2  with a signal means  20  of the control device to emit a signal S. 
         [0086]    A subsequent step S 80  in the second mode of operation M 2  checks if the distance d satisfies a second condition d&gt;D, different from the first condition d&gt;0, with a specified constant D&gt;0. In the simplified design example, this corresponds to the test if the distance of the TCP position from a second limit different from the first limit G, indicated in  FIG. 1  with a double dot dashed line, satisfies the condition d&gt;0. 
         [0087]    If the test in step S 80  shows that the TCP exceeds the second limit, or the distance to the first limit G is greater than the specified constant D (S 80 : “Y”), a STOP 0 is initiated in a step S 90  as a safety response different from the safety response in the first mode of operation. Therefore, safety monitoring can occur in the second mode of operation as well. 
         [0088]    If the test in step S 80  shows that the TCP does not exceed the second limit, or the distance to the first limit G is not greater than the specified constant D (S 80 : “N”), a step S 100  checks if the distance d satisfies the first condition, which is also tested in step S 50  in the first mode of operation M 1  and is satisfied if the TCP exceeds the limit G or the signed distance d is greater than zero (d&gt;0). 
         [0089]    If the distance d in the second mode of operation M 2  satisfies only the first condition (S 100 : “Y”) no safety response is triggered. Thus the safety response STOP 1 in the second mode of operation M 2  is triggered not for this reason or if, because or as soon as the distance d satisfies the first condition. Therefore, as previously illustrated, the triggering of a safety response, in the design example a STOP 0, also while the first condition is satisfied, is not ruled out. The decisive factor in this regard is that the fulfillment of the first condition is not enough to trigger the safety response of the first mode of operation; in the design example, however, it is geometrically necessary. 
         [0090]    Instead, in a step S 110 , a positioning force F is motorically applied to the robot in dependence on the distance d, so as to reduce the distance d when the robot is unobstructed, if the distance d satisfies the condition d&gt;0 (S 100 : “Y”). For this purpose, as indicated in  FIG. 1 , the positioning force F is directed to the limit G. It is proportional to the distance (F=k□d) and limited by the maximum value F max . In one variation it can also additionally or alternatively be proportional to a temporal change □d/□t. 
         [0091]    As a result, when the limit G is exceeded in the second mode of operation M 2 , the safety response STOP 1 is not triggered as in the first mode of operation M 1 , but instead the user, who moves the robot by manual application of a positioning force, is haptically given feedback in the form of a restoring force that increases up to the maximum value F max  with increasing advancement through a prohibited range defined by the limit G. 
         [0092]    In addition the optic, acoustic and/or haptic signal S, for example a vibration, is emitted in step S 110 . 
         [0093]    To test the safety monitoring of the first mode of operation for exceedance of the first limit G, the user accordingly moves the robot in the second mode of operation M 2  by manual application of a guiding force on the robot in such a way, that the distance d of the state variable x of the robot from this limit G satisfies the first condition d&gt;0 and haptically senses the limit through the resulting applied restoring force F. He is also notified of it by the signal S. Since the output of the distance means  10 , connected in the first mode of operation M 1  with the safety means  30  to initiate the STOP 1, is connected in the second mode of operation M 2  with the signal means  20  to emit the signal S (see  FIG. 3 ), the signal S is emitted along with the restoring force F instead of the STOP 1. The user can therefore test the safety monitoring both signal-technically and physically as well. 
         [0094]    On the other hand, if the STOP 0 is triggered in step S 90  in the second mode of operation, no positioning force is applied. In this respect this safety response, so to speak, overrules the haptic feedback of the exceedance of the limit G. 
         [0095]    If the distance d in the second mode of operation M 2  does not satisfy the first condition (S 100 : “N”) either, no restoring positioning force back to the limit G is applied in a step S 120 , or this force F is set to zero. 
         [0096]    In a subsequent step S 200 , in the second mode of operation M 2 , the distances of the state variable x of the robot to, different from one another, specified references in the state space of the robot are determined. 
         [0097]    In the design example, simplified so as to be a better representation, a circular track B of the TCP of the robot, defined by two points y n  and y n+1 , is indicated by a dot dashed line to illustrate this. In step S 200 , the distance d, of the current state variable x 1  to the specified reference y n , the distance d n+1  of the current state variable x 1  to the specified reference y n+1  as well the distance d (n,n+1)  of the current state variable x 1  to the specified reference B, in the design example the distance to point y (n,n+1)  of the circular track B closest to the current TCP position x 1 , are then determined. 
         [0098]    By processing the steps S 210  to S 280 , to be discussed in the following, the smallest distance d min  of the distances is then determined, and a positioning force f, indicated in  FIG. 1 , is motorically applied to the robot so as to minimize the smallest distance d min  when the robot is unobstructed. 
         [0099]    To begin, in an initializing step S 210 , a counter n is set to 1, a variable d min  for the to date smallest ascertained distance with the determined distance d 1  to a first of the specified references y 1  is pre-allocated and an, in the simplified design example two-dimensional, vector variable for the positioning force f to be applied is pre-allocated a value that is proportional to the difference vector between the current TCP position x 1  and the first reference y 1 . 
         [0100]    In a subsequent step S 220  the counter n is increased by 1, and in a following step S 230  a check to verify that all references have been processed is conducted. 
         [0101]    If this is not the case (S 230 : “N”), in a step S 240 , the distance d n  of the reference y n  corresponding to this counter n is checked to see if it is smaller than the to date ascertained smallest distance d min . 
         [0102]    If this is the case (S 240 : “Y”), in a step S 250 , this distance d n  is set as the new smallest distance d min  and the vector variable for the positioning force f to be applied is assigned a value that is proportional to the difference vector between the current TCP position x 1  and this reference y n  corresponding to the counter n. 
         [0103]    If, however, the distance d n  of the reference y n  corresponding to the counter n is not smaller than the to date ascertained smallest distance d min  (S 240 : “N”), or if d min  and f have been reassigned in step S 250 , the distance d (n,n+1)  of the track B between the track point y n  corresponding to this counter n and the following track point y n+1  is checked in a step S 260  whether it is smaller than the to date ascertained smallest distance d min . 
         [0104]    If this is the case (S 260 : “Y”), in a step S 270 , this distance d (n,n+1)  is set as the new smallest distance d min  and the vector variable for the positioning force f to be applied is assigned a value that is proportional to the difference vector between the current TCP position x 1  and the track point y (n,n+1)  between y n  and y n+1  that is closest to the current TCP position. 
         [0105]    The process then returns to step S 220  and increments the counter n. 
         [0106]    If all references, in the design example all track points and the track defined by them, have been processed (S 230 : “Y”), the positioning force f, determined in this way, is motorically applied to the robot. In addition, the reference in the state space of the robot that exhibits the smallest distance is displayed (not shown). 
         [0107]    The TCP is hereby, as indicated in  FIG. 1 , taken to the reference that is closest to its current position x 1  in an impedance-controlled manner; in the design example to the closest track point y (n,n+1) . 
         [0108]    In particular the robot track B can thus easily and intuitively be checked haptically. The specified track points y 1 , . . . , y n , y n+1 , . . . in particular can easily be determined directly, if the steps S 260 , S 270  are omitted in the design example, i.e. only the specified track points, instead of also the track, are used as references. Likewise, in addition or alternatively, a virtual structure in the form of the previously described limit G can also be used as a reference and the TCP can be taken to it in a force controlled manner, so as to subsequently exceed it and thus test the safety monitoring. In this context it should be noted that the limit G represents a plane hypersurface or wall in the state space {x i , x j }. 
         [0109]    Even though examples have been discussed in the foregoing description, it should be noted that a large number of variations are possible. 
         [0110]    In particular, as illustrated above, instead of the initiation of the safety response STOP 1 on the one hand, and the application of a positioning force f driving to the closest reference y (n,n+1)  on the other hand, the two aspects of the application of the positioning force F restoring to the limit G can also be realized independently. In this regard, in the design example of  FIG. 2 , in particular steps S 10  to S 120 , which concern the aspect of the application of the positioning force driving back to the limit instead of the initiation of the safety response, or steps S 200  to S 280 , which concern the aspect of the application of a positioning force driving to the closest reference, can be omitted. 
         [0111]    While the present invention has been illustrated by the description of specific embodiments thereof, and while the embodiments have been described in considerable detail, it is not intended to restrict or in any way limit the scope of the appended claims to such detail. The various features discussed herein may be used alone or in any combination. Additional advantages and modifications will readily appear to those skilled in the art. The invention in its broader aspects is therefore not limited to the specific details, representative apparatus and methods and illustrative examples shown and described. Accordingly, departures may be made from such details without departing from the scope or spirit of the general inventive concept. 
       LIST OF REFERENCE SIGNS 
       [0000]    
       
           10  Distance means 
           20  Signal means 
           30  Safety means 
           40  (Control) Device 
         x 1 ; x 2  TCP Position 
         y n ; y n+1  Specified track point 
         y (n, n+1)  Closest track point 
         B Track 
         d (min)  (smallest) distance 
         D Specified constant 
         G 1 , G 2  First limit 
         F; f Positioning force 
         M 1  First mode of operation 
         M 2  Second mode of operation 
         S Signal
A method for controlling a robot in at least one pose of the robot wherein the robot can be operated in either a first mode of operation or a second mode of operation. In the second mode of operation the robot can be moved by manually applying a guiding force to the robot. The method includes determining a distance of a state variable of the robot from a first limit and then triggering a safety response when the distance satisfies a first condition and the robot is operating in the first mode of operation. When the robot is operating in the second mode of operation and the distance satisfies the first condition, the method includes not triggering the safety response, and motorically applying a positioning force to the robot in dependence on the determined distance so that the distance can be reduced when the robot is unobstructed.