Page 742 - Mechatronics with Experiments
P. 742

728   MECHATRONICS
                                                                                               , t
                                                                                           , t
                              where a, d are acceleration and deceleration values, v is the top speed, t acc dec run  are
                              the time periods for acceleration, deceleration, and constant speed run phases of the index
                              motion (Figure 3.13). Let us assume that the index time period is equally divided between
                              acceleration, constant speed run, and deceleration time periods,
                                                                      1
                                                       t acc  = t run  = t dec  =  ⋅ t index     (10.6)
                                                                      3
                              Let t  = 3.0 s. The motor rotation to make the 1.0 in move is 1.0in ⋅ 5rev∕in = 5rev. It
                                  index
                              can be shown that the total traveled distance is
                                                       1                1
                                                   x =   ⋅ v ⋅ t acc  + v ⋅ t run  +  ⋅ v ⋅ t dec  (10.7)
                                                       2                2
                                                       (               )
                                                        1 1    1   1 1
                                                     =    ⋅  +  +   ⋅   ⋅ v ⋅ t index            (10.8)
                                                        2 3    3   2 3
                                                       2
                                                     =   ⋅ v ⋅ t index                           (10.9)
                                                       3
                                                       3  x
                                                   v =                                          (10.10)
                                                       2 t index
                                                       3 1.0in
                                                     =                                          (10.11)
                                                       2 3.0s
                                                     = 0.5in∕s                                  (10.12)
                                   The pseudo code to define these motion sequences may look as follows. The exact
                              syntax of the motion control software will depend on the particular motion controller.
                               % Assume we have two functions “MoveAt(...)” and “MoveFor
                                 (....) ” to generate the desired motion.
                               % If these motion command (trajectory) generator functions
                                 are defined in C/C++, they can be overloaded to accept
                               % different argument list.
                               %
                               %
                               %  Calculate or set parameters
                                    Home_Speed_1 = 2.5      % [rev/sec]
                                    Home_Speed_2 = 0.25     % [rev/sec]
                                    Home_Sensor =    1      % I/O channel number for the home
                                                              sensor
                                    Jog_Speed =     1.0     % [rev/sec]
                                    Jog_Stop   = 2          % I/O channel to indicate to stop
                                                              motion.
                                    Stop_Rate =     10.0    % [rev]/[secˆ2]
                                    Index_Value = 5.0       % [rev]
                                    t_acc    =  1.0         % [sec]
                                    t_run    =  1.0         % [sec]
                                    t_dec    =  1.0         % [sec]


                               % Home motion
                                    MoveAt (Home_Speed_1)
                                    Wait until Home_Sensor = ON
                                    MoveAt (Zero_Speed, Stop_Rate)
                                    Wait for 1.0 sec
                                    MoveFor(Index_Value)
                                    Wait for 1.0 sec
                                    MoveAt (Home_Speed_2)
   737   738   739   740   741   742   743   744   745   746   747