Abstract:
A control method for motor driver includes: outputting a first signal from the controller to the first motor driver; making the first timer start to count for a first time; returning a first feedback signal from the first motor driver to the controller; dividing a value of a first count time of the first timer by two to get a value of a first delay time, wherein the first delay time is defined as the time of transmitting signals from the controller to the first motor driver; adding the value of the first delay time to the value of the first count time of the first timer to get a first sum; and transferring the first sum to the second timer to replace a value of a count time of the second timer.

Description:
BACKGROUND 
       [0001]    1. Technical Field 
         [0002]    Embodiments of the present disclosure relate to a control system and method for motor drivers. 
         [0003]    2. Description of the Related Art 
         [0004]    In computer numerical control systems, a controller controls a plurality of motor drivers which are at different distances from the controller, which causes timing problems. In other words because of the different distances, a command to control some action of the plurality of motor drivers will not be received by the motor drivers at the same time. As a result, errors may occur in computer numerical control systems. 
         [0005]    Therefore, what is needed, is a control system and method for motor drivers which can solve the above problem. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0006]      FIG. 1  is a block diagram of an embodiment of a control system for motor drivers, the control system including a controller, a first motor driver, and a second motor driver. 
           [0007]      FIG. 2  is a flowchart of an embodiment of a control method for controlling the first motor driver. 
           [0008]      FIG. 3  is a flowchart of an embodiment of a control method for controlling the second motor driver. 
           [0009]      FIG. 4  is a flowchart of an embodiment of a method for regulating a first delay time of  FIG. 2 . 
           [0010]      FIG. 5  is a flowchart of an embodiment of a method for regulating a third delay time of  FIG. 3 . 
       
    
    
     DETAILED DESCRIPTION 
       [0011]    Referring to  FIG. 1 , an embodiment of a control system  10  includes a controller  11 , a first motor driver  12 , and a second motor driver  13 . The controller  11  includes a storing unit  110 , a first timer  112 , a first connection port  116 , and a second connection port  114 . The first motor driver  12  includes a first buffer  120 , a second timer  122 , a first connection port  124 , and a second connection port  126 . The second motor driver  13  includes a second buffer  130 , a third timer  132 , a first connection port  134 , and a second connection port  136 . 
         [0012]    The controller  11 , the first motor driver  12 , and the second motor driver  13  communicate with each other via the first and second connection ports. 
         [0013]    In the current embodiment, t 1  is defined as a first start time for the first timer  112 , t 2  is defined as a first stop time for the first timer  112 , t 3  is defined as a second start time for the first timer  112 , and t 4  is defined as a second stop time for the first timer  112 . A_time is defined as an elapsed time between the first start time t 1  and the first stop time t 2  of the first timer  112 . B_time is defined as an elapsed time between the second start time t 3  and the second stop time t 4  of the first timer  112 . C_time is defined as an elapsed time between a first start time and a first stop time of the second timer  122 . D_time is defined as an elapsed time between a first start time and a first stop time of the third timer  132 . 
         [0014]    T 1  is defined as a first delay time of transmitting signals from the controller  11  to the first motor driver  12 . T 2  is defined as a second delay time of transmitting signals from the first motor driver  12  to the second motor driver  13 . The sum of T 1  and T 2  is defined as a third delay time of transmitting signals from the controller  10  to the second motor driver  13 . The value of A_time is two times the value of the first delay time T 1 . The value of B_time is two times the value of the third delay time (T 1 +T 2 ). 
         [0015]      FIG. 2  is a flowchart of a first control method for controlling the first motor driver  12 . Depending on the embodiment, additional blocks may be added, others deleted, and the ordering of the blocks may be changed. 
         [0016]    In block S 1 , the controller  11  outputs a first signal to the first motor driver  12 , and the first timer  112  of the controller  11  starts to time for the first time at the first start time t 1 . 
         [0017]    In block S 2 , the second timer  122  of the first motor driver  12  returns a first feedback signal to the controller  11  when it receives the first signal from the controller  11 . At the same time, the first timer  112  stops timing at t 2 . 
         [0018]    In block S 3 , the controller  11  divides the value of A_time of the first timer  112  by two to get the value of the first delay time T 1 . 
         [0019]    In block S 4 , the value of the first delay time T 1  is stored in the storing unit  110  of the controller  11 . 
         [0020]    In block S 5 , the controller  11  adds the value of the first delay time T 1  to the value of A_time of the first timer  112  to get a first sum (T 1 +A_time), and transfers the first sum (T 1 +A_time) to the second timer  122 . Therefore, a value of C_time of the second timer  122  is equal to the first sum (T 1 +A_time). As a result, the controller  11  can start the first motor driver  12  precisely at a desired time. 
         [0021]      FIG. 3  is a flowchart of a control method for starting the second motor driver  13 . Depending on the embodiment, additional blocks may be added, others deleted, and the ordering of the blocks may be changed. 
         [0022]    In block S 21 , the controller  10  outputs a second signal to the second motor driver  13  via the first motor driver  12 , and the first timer  112  starts to time for the second time from the second start time t 3 . 
         [0023]    In block S 22 , the third timer  132  of the second motor driver  13  returns a second feedback signal to the controller  11  when it receives the second signal from the controller  11 . At the same time, the first timer  112  stops timing at time t 4 . 
         [0024]    In block S 23 , the controller  11  divides the value of B_time of the first timer  112  by two to get the value of the third delay time (T 1 +T 2 ). 
         [0025]    In block S 24 , the value of the third delay time (T 1 +T 2 ) is stored in the storing unit  110  of the controller  11 . 
         [0026]    In block S 25 , the controller  11  adds the value of the third delay time (T 1 +T 2 ) to the value of B_time of the first timer  112  to get a second sum (T 1 +T 2 +B_time), and transfers the second sum (T 1 +T 2 +B_time) to the third timer  132 . Therefore, a value of D_time of the third timer  132  is equal to the second sum (T 1 +T 2 +B_time). As a result, the controller  11  can start the second motor driver  13  precisely at a desired time. 
         [0027]      FIG. 4  is a flowchart of a method for regulating the first delay time of  FIG. 2 . Depending on the embodiment, additional blocks may be added, others deleted, and the ordering of the blocks may be changed. 
         [0028]    In block P 1 , the controller  11  transfers the first sum (T 1 +A_time) to the first buffer  120  of the first motor driver  12 . 
         [0029]    In block P 2 , the controller  11  compares the first sum (T 1 +A_time) with the value of C_time of the second timer  122  to get a first deviation value dt 1 . 
         [0030]    In block P 3 , the controller  11  determines whether the first deviation value dt 1  is equal to 0. If the first deviation value dt 2  is equal to 0, the first delay time T 1  does not need to be regulated. 
         [0031]    In block P 4 , if the first deviation value dt 1  is not equal to 0, the controller  11  replaces the value of the first delay time T 1  with a correct value of the first delay time T 1 . The correct value of the first delay time T 1  is equal to the sum of the original value of the first delay time T 1  and the first deviation value dt 1 . 
         [0032]      FIG. 5  is a flowchart of a method for regulating the third delay time of  FIG. 3 . Depending on the embodiment, additional blocks may be added, others deleted, and the ordering of the blocks may be changed. 
         [0033]    In block P 21 , the controller  11  transfers the second sum (T 1 +T 2 +B_time) to the second buffer  130  of the second motor driver  13 . 
         [0034]    In block P 22 , the controller  1  compares the second sum (T 1 +T 2 +B_time) with the value of D_time of the third timer  132  to get a second deviation value dt 2 . 
         [0035]    In block P 23 , the controller  11  determines whether the second deviation value dt 2  is equal to 0. If the second deviation value dt 2  is equal to 0, the third delay time (T 1 +T 2 ) does not need to be regulated. 
         [0036]    In block P 24 , if the second deviation value dt 2  is not equal to 0, the controller  11  replaces the third delay time (T 1 +T 2 ) with a correct value of the third delay time (T 1 +T 2 ). The correct value of the third delay time (T 1 +T 2 ) is equal to the sum of the original value of the third delay time (T 1 +T 2 ) and the second deviation value dt 2 . 
         [0037]    The foregoing description of the exemplary embodiments of the invention has been presented only for the purposes of illustration and description and is not intended to be exhaustive or to limit the invention to the precise forms disclosed. Many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to explain the principles of the invention and their practical application so as to enable others skilled in the art to utilize the invention and various embodiments and with various modifications as are suited to the particular use contemplated. Alternately embodiments will become apparent to those skilled in the art to which the present invention pertains without departing from its spirit and scope. Accordingly, the scope of the present invention is defined by the appended claims rather than the foregoing description and the exemplary embodiments described therein.