Difference between revisions of "AXY:Element Coordination/Multi Dimensional Tracking Algorithm (Position)"

From SoftMC-Wiki
Jump to: navigation, search
(Initial Setup and testing)
 
(40 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
This algorithm is used for multi-dimensional '''robot based''' MF tracking.<br>
 
This algorithm is used for multi-dimensional '''robot based''' MF tracking.<br>
 
In this document position-tracking is presented.<br>
 
In this document position-tracking is presented.<br>
 +
Position is considered to be a 3-dimensional vector with its derivatives (velocity, acceleration, jerk): <math>\vec p </math>  , <math>\vec v</math> , <math>\vec a</math><br>
 +
 +
<math>\vec p  = (x,y,z)</math><br>
 +
 
The algorithm consist of a state machine with the following states:<br>
 
The algorithm consist of a state machine with the following states:<br>
  
Line 14: Line 18:
 
* Check if master velocity or acceleration exceeds max master frame's values if yes return an error
 
* Check if master velocity or acceleration exceeds max master frame's values if yes return an error
  
* <math>\overrightarrow {tack} := \overrightarrow {master}</math>
+
* <math>\overrightarrow {tack} := \overrightarrow {master}</math> ''copying all derivatives''
  
 
* ''reset:'' '''flopstime = flops = 0'''
 
* ''reset:'' '''flopstime = flops = 0'''
Line 23: Line 27:
 
<table style="float:right" border = "1">
 
<table style="float:right" border = "1">
 
<tr><td>
 
<tr><td>
Value of [[Axystems:MC-Basic:movingFrame.ACCELERATIONMAXTRAN|AccMaxTran]] (or [[Axystems:MC-Basic:movingFrame.ACCELERATIONMAXROT|AccMaxRot]]) is used of checking of acceleration limit.
+
Value of [[MC-Basic:movingFrame.ACCELERATIONMAXTRAN|AccMaxTran]] is used of checking of acceleration limit.
 
</td></tr>
 
</td></tr>
 
<tr><td>
 
<tr><td>
Value of [[Axystems:MC-Basic:movingFrame.VELOCITYMAXTRAN|VelMaxTran]] (or [[Axystems:MC-Basic:movingFrame.VELOCITYMAXROT|VelMaxRot]]) is used of checking of velocity limit.
+
Value of [[MC-Basic:movingFrame.VELOCITYMAXTRANS|VelMaxTran]] is used of checking of velocity limit.
 
</td></tr>
 
</td></tr>
 
</table>
 
</table>
Line 40: Line 44:
 
<table style="float:right" border = "1">
 
<table style="float:right" border = "1">
 
<tr><td>
 
<tr><td>
<math>{sync_{jrk}}</math> defined as a scaled value [[Axystems:MC-Basic:robot.JERKSYNCTRAN|SyncJerkRot]] or [[Axystems:MC-Basic:robot.JERKSYNCROT|SyncJerkRot]]
+
<math>{sync_{jrk}}</math> defined as   [[MC-Basic:robot.JERKSYNCTRAN|SyncJerkTran]]
 
</td></tr>
 
</td></tr>
 
<tr><td>
 
<tr><td>
<math>{sync_{acc}}</math> defined as a scaled value [[Axystems:MC-Basic:robot.ACCELERATIONSYNCTRAN|SyncAcclerationRot]] or [[Axystems:MC-Basic:robot.ACCELERATIONSYNCROT|SyncAcclerationRot]]
+
<math>{sync_{acc}}</math> defined as   [[MC-Basic:robot.ACCELERATIONSYNCTRAN|SyncAcclerationTran]]
 
</td></tr>
 
</td></tr>
 
</table>
 
</table>
Line 49: Line 53:
  
 
''This is an estimation of time needed to reach the target. It is not an exact formula<br>
 
''This is an estimation of time needed to reach the target. It is not an exact formula<br>
if the velocity difference is positive, it means the robot velocity is lower then conveyors<br>
+
''if the slave velocity is lower then master's we need more time: once to get to a higher velocity then the masters and once <br>
therefore we need more time once to get to a higher velocity then the conveyers and once <br>
+
''to get from that (higher) velocity to the masters - therefore the multiplication by 2''<br>
to get from that (higher) velocity to conveyers - therefore the multiplication by 2''<br>
 
  
 
<br>
 
<br>
<math>time_{toreach} = \sqrt{\frac {K*|{vel_{diff}}|} {sync_{jrk}} }  + \sqrt{\frac{4*|{pos_{diff}}|}{sync_{acc}}}</math><br>
+
<math>time_{toreach} = \sqrt{\frac {K*|{\overrightarrow {vel}_{diff}}|} {sync_{jrk}} }  + \sqrt{\frac{4*|{\overrightarrow {pos}_{diff}}|}{sync_{acc}}}</math><br>
 
<br>
 
<br>
  
''where'' <math> K = \begin{cases} 4,  & \mbox{if }vel_{diff} > 0 \\2, & \mbox{if }vel_{diff} \le 0 \end{cases}</math> <br>
+
''where'' <math> K = \begin{cases} 4,  & \mbox{if }|\overrightarrow  {master}_{vel}| > |\overrightarrow {track}_{vel}| \\2, & \mbox{if }| \overrightarrow {master}_{vel}| \le |\overrightarrow {track}_{vel}| \end{cases}</math> <br>
  
  
 
<table style="float:right" border = "1">
 
<table style="float:right" border = "1">
 
<tr><td>
 
<tr><td>
DampingFactor -  user defined by: [[Axystems:MC-Basic:movingFrame.DAMPINGFACTOR|MF.DAMPINGFACTOR]]
+
DampingFactor -  user defined by: [[MC-Basic:movingFrame.DAMPINGFACTOR|MF.DAMPINGFACTOR]]
 
</td></tr>
 
</td></tr>
 
</table>
 
</table>
Line 76: Line 79:
 
=== Prediction of the Rendezvous-Point ===
 
=== Prediction of the Rendezvous-Point ===
 
''The predicted position of the rendezvous (minus T, if it will happen in this sample!)''<br>
 
''The predicted position of the rendezvous (minus T, if it will happen in this sample!)''<br>
<math>pred_{pos}</math>:&nbsp; ''position prediction assuming constant acceleration''<br>
+
<math>\overrightarrow {pred}_{pos}</math>:&nbsp; ''position prediction assuming constant acceleration''<br>
<math>pred_{diff}</math>:&nbsp;''Predicted position difference''<br>
+
<math>\overrightarrow {pred}_{diff}</math>:&nbsp;''Predicted position difference''<br>
<math>pred_{vel}</math>:&nbsp;'' velocity prediction''<br>
+
<math>\overrightarrow {pred}_{vel}</math>:&nbsp;'' velocity prediction''<br>
  
  
 
<math>t = (time_{toreach}-T)</math><br>
 
<math>t = (time_{toreach}-T)</math><br>
<math>pred_{pos} = master_{pos} + t*master_{vel} + t^2*master_{acc}/2</math><br>                   
+
<math>\overrightarrow {pred}_{pos} = \overrightarrow {master}_{pos} + t*\overrightarrow {master}_{vel} + t^2*\overrightarrow {master}_{acc}/2</math><br>                   
<math>pred_{diff} = pred_{pos} - track_{pos}</math><br>
+
<math>\overrightarrow {pred}_{diff} = \overrightarrow {pred}_{pos} - \overrightarrow {track}_{pos}</math><br>
<math>pred_{vel} = master_{vel} + t*master_{acc}</math><br>
+
<math>\overrightarrow {pred}_{vel} = \overrightarrow {master}_{vel} + t*\overrightarrow {master}_{acc}</math><br>
  
  
  
 
'' Assuming the acceleration will be zero:''<br>
 
'' Assuming the acceleration will be zero:''<br>
<math>pred_{acc} = 0</math><br>
+
<math>\overrightarrow {pred}_{acc} = 0</math><br>
 
   
 
   
  
 
'' Polynomial coefficients of 5-degree polynom connecting the current p,v,a to the randevous p,v,a''<br>
 
'' Polynomial coefficients of 5-degree polynom connecting the current p,v,a to the randevous p,v,a''<br>
<math>a0 = track_{pos} </math> - ''not used, directly written into code''<br>
+
<math>\overrightarrow a0 = \overrightarrow {track}_{pos} </math> - ''not used, directly written into code''<br>
<math>a1 = track_{vel}</math> - ''not used, directly written into code''<br>
+
<math>\overrightarrow a1 = \overrightarrow {track}_{vel}</math> - ''not used, directly written into code''<br>
<math>a2 = 0.5*track_{acc}</math> - ''not used, directly written into code''<br>
+
<math>\overrightarrow a2 = 0.5*\overrightarrow {track}_{acc}</math> - ''not used, directly written into code''<br>
<math>a3 = (0.5*(pred_{acc}-3*track_{acc})~+~(10*pred_{diff}/time_{toreach}</math><math>-~6*track_{vel}~-~4*pred_{vel})/time_{toreach})/time_{toreach}</math><br>
+
<math>\overrightarrow a3 = (0.5*(\overrightarrow {pred}_{acc}-3*\overrightarrow {track}_{acc})~+~(10*\overrightarrow {pred}_{diff}/time_{toreach}</math><math>-~6*\overrightarrow {track}_{vel}~-~4*\overrightarrow {pred}_{vel})/time_{toreach})/time_{toreach}</math><br>
<math>a4 = (((5*pred_{diff}/time_{toreach}~-~(pred_{vel}+4*track_{vel}))/time_{toreach}</math><math>- 1.5*track_{acc})/time_{toreach}~-~2*a3)/time_{toreach}</math><br>
+
<math>\overrightarrow a4 = (((5*\overrightarrow {pred}_{diff}/time_{toreach}~-~(\overrightarrow {pred}_{vel}+4*track_{vel}))/time_{toreach}</math><math>- 1.5*\overrightarrow {track}_{acc})/time_{toreach}~-~2*\overrightarrow a3)/time_{toreach}</math><br>
<math>a5 = ((((pred_{diff}/time_{toreach}~-~track_{vel})/time_{toreach}</math><math>-0.5*track_{acc})/time_{toreach}~-~a3)/time_{toreach}~-~a4)/time_{toreach}</math><br>
+
<math>\overrightarrow a5 = ((((\overrightarrow {pred}_{diff}/time_{toreach}~-~\overrightarrow {track}_{vel})/time_{toreach}</math><math>-0.5*\overrightarrow {track}_{acc})/time_{toreach}~-~\overrightarrow a3)/time_{toreach}~-~\overrightarrow a4)/time_{toreach}</math><br>
  
=== Next SamplePosition ===
+
=== Next Sample Position ===
 
''The position  at the next sample will be:''<br>
 
''The position  at the next sample will be:''<br>
''Initial increment  (full displacement):&nbsp;''<math>dp    = a5*T^5 + a4*T^4 + a3*T^3 + 0.5*track_{acc}*T^2 + track_{vel}*T</math><br>
+
''Initial increment  (full displacement):&nbsp;''<math>\overrightarrow {dp}     = \overrightarrow a5*T^5 + \overrightarrow a4*T^4 + \overrightarrow a3*T^3 + 0.5*\overrightarrow {track}_{acc}*T^2 + \overrightarrow {track}_{vel}*T</math><br>
  
'' The accleration and jerk increments could be computed in this way also.''<br>
+
'' The acceleration and jerk increments could be computed in this way also.''<br>
'' But they are computed as average values for the time of sample duration, this approach doeas fit more to ''<br>
+
'' But they are computed as average values for the time of sample duration, this approach does fit more to ''<br>
'' the tools we are using to test this feature, (BMDS...) as they all compute accleration & jerk by numeric differentiation''<br>
+
'' the tools we are using to test this feature, as they all compute acceleration & jerk by numeric differentiation''<br>
 
'' inside one sample.''<br>
 
'' inside one sample.''<br>
 
'' The side effect of all this is that we can have a change in jerk/acc sign inside one sample and the average value we are using ''<br>
 
'' The side effect of all this is that we can have a change in jerk/acc sign inside one sample and the average value we are using ''<br>
'' ddp,dddp could have an opposite sign, so we are seeing effects like jerk or accleeration is limited from a "wrong side" i.e. instead''<br>
+
'' ddp,dddp could have an opposite sign, so we are seeing effects like jerk or acceleration is limited from a "wrong side" i.e. instead''<br>
'' using jmax -jmax is used. There is not much we can do against it, using exact jerk/acc values (from polynom) returns than wrong avergae values ''<br>
+
'' using jmax -jmax is used. There is not much we can do against it, using exact jerk/acc values (from polynom) returns than wrong average values ''<br>
'' we observe as jerk/acc exceed over theri max values. So the avergae value approach is not perefect but gives results within the given limits.''<br>
+
'' we observe as jerk/acc exceed over their max values. So the average value approach is not perfect but gives results within the given limits.''<br>
  
  
Line 126: Line 129:
 
<table style="float:right" border = "1">
 
<table style="float:right" border = "1">
 
<tr><td>
 
<tr><td>
sync_vel defined as a scaled value [[Axystems:MC-Basic:robot.VELOCITYSYNCTRAN|VelSyncTran]] or [[Axystems:MC-Basic:robot.VELOCITYSYNCROT|VelSyncRot]]
+
sync_vel defined as [[MC-Basic:robot.VELOCITYSYNCTRAN|VelSyncTran]]
 
</td></tr>
 
</td></tr>
 
<tr><td>
 
<tr><td>
sync_acc defined as a scaled value [[Axystems:MC-Basic:robot.ACCELERATIONSYNCTRAN|AccSyncTran]] or [[Axystems:MC-Basic:robot.ACCELERATIONSYNCROT|AccSyncRot]]
+
sync_acc defined as [[MC-Basic:robot.ACCELERATIONSYNCTRAN|AccSyncTran]]
 
</td></tr>
 
</td></tr>
 
<tr><td>
 
<tr><td>
sync_jrk defined as a scaled value [[Axystems:MC-Basic:robot.JERKSYNCTRAN|JrkSyncTran]] or [[Axystems:MC-Basic:robot.JERKSYNCROT|JrkSyncRot]]
+
sync_jrk defined as [[MC-Basic:robot.JERKSYNCTRAN|JrkSyncTran]]
 
</td></tr>
 
</td></tr>
 
<tr><td>
 
<tr><td>
Line 141: Line 144:
  
  
<math> dp = \begin{cases} sync_{velT} ,  & \mbox{if } dp > sync_{velT} \\ limit = true \\ -sync_{velT}, & \mbox{if }dp < -sync_{velT} \\ limit = true\end{cases}</math>  
+
<math> \overrightarrow {dp} = \begin{cases} sync_{velT} \cdot \overrightarrow {dp^*} ,  & \mbox{if } |\overrightarrow {dp}| > sync_{velT} \\ limit = true \\ \overrightarrow {dp} , & \mbox{if } |\overrightarrow {dp}| \le sync_{velT}\end{cases}</math>  
 +
 
 +
 
 +
where <math> \vec a^* = \vec a /|\vec a| </math> i.e. unit vector
  
 
==== Setting Initial velocity delta====
 
==== Setting Initial velocity delta====
<math>ddp  = dp - dp_0</math> <br>
+
<math>\overrightarrow {ddp} = \overrightarrow {dp} - \overrightarrow {dp_0}</math> <br>
  
  
<math> ddp = \begin{cases} sync_{accT2} ,  & \mbox{if } ddp > sync_{accT2} \\ dp = sync_{accT2} + dp_0 \\limit = true \\ -sync_{accT2},
+
<math> \overrightarrow {ddp} = \begin{cases} sync_{acc}T^2\cdot \overrightarrow {ddp^*} ,  & \mbox{if } |\overrightarrow {ddp}| > sync_{acc}T^2 \\ \overrightarrow {dp} = sync_{acc}T^2\cdot \overrightarrow {ddp^*} + \overrightarrow {dp_0} \\limit = true \\ \overrightarrow {ddp},
  & \mbox{if }ddp < -sync_{accT2} \\dp = -sync_{accT2} + dp_0  \\ limit = true\end{cases}</math>
+
  & \mbox{if }|\overrightarrow {ddp}| \le sync_{acc}T^2 \end{cases}</math>
  
 
==== Setting Initial acceleration delta====
 
==== Setting Initial acceleration delta====
<math>dddp = ddp - ddp_0</math><br>
+
<math>\overrightarrow {dddp= \overrightarrow {ddp} - \overrightarrow {ddp_0}</math> <br>
  
  
 
+
<math> \overrightarrow {dddp} = \begin{cases} sync_{jrk}T^3\cdot \overrightarrow {dddp^*} ,  & \mbox{if } |\overrightarrow {dddp}| > sync_{jrk}T3 \\ \overrightarrow {ddp} = sync_{jrk}T^3 \cdot \overrightarrow {dddp^*}  + \overrightarrow {ddp_0} \\\overrightarrow {dp} = \overrightarrow {ddp} + \overrightarrow {dp_0}\\limit = true \\ \overrightarrow {dddp},
<math> dddp = \begin{cases} sync_{jrkT3} ,  & \mbox{if } dddp > sync_{jrkT3} \\ ddp = sync_{jrkT3} + ddp_0 \\dp = ddp + dp_{0}\\limit = true \\ -sync_{jrkT3},
+
  & \mbox{if }|\overrightarrow {dddp}| \le sync_{jrk}T^3 \end{cases}</math>
  & \mbox{if }dddp < -sync_{jrkT3} \\ddp = -sync_{jrkT3} + ddp_0 \\dp = ddp + dp_{0} \\ limit = true\end{cases}</math>
 
  
 
==== New position is: ====
 
==== New position is: ====
Line 163: Line 168:
 
==== If the filter was activated then: ====
 
==== If the filter was activated then: ====
 
'' if the velocity,accleration or jerk is limited ('''limit = true''') then the velocity computed using polynomials does''<br>
 
'' if the velocity,accleration or jerk is limited ('''limit = true''') then the velocity computed using polynomials does''<br>
<math> track_{vel}  = dp/T  </math><br>
+
<math> \overrightarrow {track}_{vel}  = \overrightarrow {dp}/T  </math><br>
<math> track_{acc}  = ddp/T^2</math><br>
+
<math> \overrightarrow {track}_{acc}  = \overrightarrow {ddp}/T^2</math><br>
  
 
<br>
 
<br>
Line 170: Line 175:
 
'' approach is much better - means more stable''<br>
 
'' approach is much better - means more stable''<br>
  
<math> track_{vel}  = 5*a5*T^4  + 4*a4)*T^3  + 3*a3*T^2  + track_{acc}*T + track_{vel}</math><br>
+
<math> \overrightarrow {track}_{vel}  = 5*\overrightarrow a5*T^4  + 4*\overrightarrow a4*T^3  + 3*\overrightarrow a3*T^2  + \overrightarrow {track}_{acc}*T + \overrightarrow {track}_{vel}</math><br>
<math> track_{acc}  = 20*a5*T^3 + 12*a4*T^2  + 6*a3*T  + track_{acc}</math><br>
+
<math> \overrightarrow {track}_{acc}  = 20*\overrightarrow a5*T^3 + 12*\overrightarrow a4*T^2  + 6*\overrightarrow a3*T  + \overrightarrow {track}_{acc}</math><br>
  
 
====keep the old values for next sample====
 
====keep the old values for next sample====
<pre>
+
<math>\overrightarrow {ddp}_0 = \overrightarrow {ddp}</math> <br>
ddp0 = ddp;
+
<math>\overrightarrow {dp}_0 = \overrightarrow {dp}</math> <br>
dp0 = dp;
 
</pre>
 
  
 
====System is synchronized if NEW delta's are under certesian thresholds:====
 
====System is synchronized if NEW delta's are under certesian thresholds:====
<math>dv_0 = dv</math>; - ''keep the previous dv''<br>
+
<math>\overrightarrow {dv}_0 = \overrightarrow {dv}</math>; - ''keep the previous dv''<br>
<math>dv = master_{vel} - track_{vel}</math><br>
+
<math>dv = \overrightarrow {master}_{vel} - \overrightarrow {track}_{vel}</math><br>
  
  
 
<table style="float:right" border = "1">
 
<table style="float:right" border = "1">
 
<tr><td>
 
<tr><td>
syncGain defined by the user with: [[Axystems:MC-Basic:movingFrame.FILTERFACTOR|MF.FilterFactor]]
+
syncGain defined by the user with: [[MC-Basic:movingFrame.FILTERFACTOR|MF.FilterFactor]]
 
</td></tr>
 
</td></tr>
 
</table>
 
</table>
Line 192: Line 195:
  
  
===== Successful tracking completion =====
+
==== Successful tracking completion ====
  
'''<u>if((fabs(dv) <= syncGain * sync_accT) && (fabs(master_pos - track_pos) <= syncGain * sync_accT2))</u> ''' <br>
+
'''if''' &nbsp; <math>(|\overrightarrow {dv}| \le syncGain * sync_{acc} T)</math> &nbsp;'''and''' &nbsp;<math>(|\overrightarrow {master}_{pos} - \overrightarrow {track}_{pos}| \le syncGain * sync_{acc} T^2)</math> <br>
 
'' Synchronization'' <br>
 
'' Synchronization'' <br>
'' Take the middle for an additional smoothing:''
+
'' Take the middle for an additional smoothing:''<br>
 +
<math>\overrightarrow {track}_{pos}   = 0.5*(\overrightarrow {track}_{pos} + \overrightarrow {master}_{pos})</math><br>
 +
<math>\overrightarrow {track}_{vel}   = 0.5*(\overrightarrow {track}_{vel} + \overrightarrow {master}_{vel})</math><br>
 
<pre>
 
<pre>
track_pos   = 0.5*(track_pos + master_pos);
 
track_vel   = 0.5*(track_vel + master_vel);
 
 
ResetFilter(); // Reset the filter
 
ResetFilter(); // Reset the filter
 
state.tracking    =    MOT_MASTER_SYNC; // System synchronized<br>
 
state.tracking    =    MOT_MASTER_SYNC; // System synchronized<br>
Line 211: Line 214:
 
</pre>
 
</pre>
  
===== Over-Oscillation Check =====
+
==== Over-Oscillation Check ====
  
 
<table style="float:right" border = "1">
 
<table style="float:right" border = "1">
 
<tr><td>
 
<tr><td>
maxFlops defined by the user with: [[Axystems:MC-Basic:movingFrame.MAXFLOPS|MF.MaxFlops]]
+
maxFlops defined by the user with: [[MC-Basic:movingFrame.MAXFLOPS|MF.MaxFlops]]
 
</td></tr>
 
</td></tr>
 
</table>
 
</table>
Line 231: Line 234:
 
== State: Stopping (de-synchronization process) ==
 
== State: Stopping (de-synchronization process) ==
  
 +
<pre>
 
flopstime = flops = 0;
 
flopstime = flops = 0;
 +
</pre>
 +
 
* De-Syncing profile, follow the given profile, ignore the real source
 
* De-Syncing profile, follow the given profile, ignore the real source
 +
 +
 +
* determine the curvature parameters path:
 +
 +
 +
<math>\overrightarrow {desync}_{start} </math> , <math>\overrightarrow {desync}_{normal} </math>, <math>\overrightarrow {desync}_{center} </math><br>
 +
 +
or linear movement:
 +
 +
<math>\overrightarrow {desync}_{direction} </math>
 +
 +
 +
* initialize stopping profile with current values of curvature angle:
 +
 +
desync.pos = <math>\alpha </math><br>
 +
desync.vel = <math>\dot \alpha </math><br>
 +
desync.acc = <math>\ddot \alpha </math><br>
 +
 +
See: [[AXY:Element_Coordination/Multi_Dimensional_Tracking_Algorithm_(Position)/Theoretical_Background|Theoretical_Background]]
 +
 +
 +
* initialize the profiler for stopping - computing the stopping (deceleration path) ad set as new target position for the profiler.
 +
 +
* during stopping:
 +
 
<pre>
 
<pre>
 
desync.Profile();
 
desync.Profile();
track_pos = track_pos_0+master_direction*desync.path.curr_pos; 
+
</pre>
track_vel = master_direction*desync.path.vel;
+
 
track_acc = master_direction*desync.path.acc;
+
 
 +
<math>\overrightarrow p = \overrightarrow {desync}_{start} \cdot cos(\alpha(t))  + \overrightarrow {desync}_{normal} \cdot sin(\alpha(t))  + \overrightarrow {desync}_{center} </math><br>
 +
 
 +
or in case of linear motion:
 +
 
 +
<math>\overrightarrow p = \overrightarrow {desync}_{direction} \cdot l(t) + \overrightarrow {track}_{pos} </math>
 +
 
 +
 
 +
<pre>
 
if(desync.path.Status.stop) // if stopped,change the state to OFF
 
if(desync.path.Status.stop) // if stopped,change the state to OFF
 
SetState(MOT_MASTER_OFF);
 
SetState(MOT_MASTER_OFF);
 
</pre>
 
</pre>
  
 
+
[[Category:Motion:MovingFrame]]
[[Category:Axystems:Motion:MovingFrame]]
 

Latest revision as of 09:18, 22 May 2014

Multi Dimensional Tracking Algorithm

This algorithm is used for multi-dimensional robot based MF tracking.
In this document position-tracking is presented.
Position is considered to be a 3-dimensional vector with its derivatives (velocity, acceleration, jerk): , ,


The algorithm consist of a state machine with the following states:

  1. Tracking process
  2. Full Synchronization follow the master
  3. Stopping (de-synchronization process)

State: Full Synchronization follow the master

  • Check if master velocity or acceleration exceeds max master frame's values if yes return an error
  • copying all derivatives
  • reset: flopstime = flops = 0

State: Tracking process

Initial Setup and testing

Value of AccMaxTran is used of checking of acceleration limit.

Value of VelMaxTran is used of checking of velocity limit.

  • Check if master velocity or acceleration exceeds max master frame's values if yes return an error
  • Compute differences:

   pure delta-position
   pure delta-velocity

Time-to-Reach initial estimation

defined as SyncJerkTran

defined as SyncAcclerationTran


This is an estimation of time needed to reach the target. It is not an exact formula
if the slave velocity is lower then master's we need more time: once to get to a higher velocity then the masters and once
to get from that (higher) velocity to the masters - therefore the multiplication by 2




where


DampingFactor - user defined by: MF.DAMPINGFACTOR

Additionaly we mutliply by a prediction factor - to decrease acc/jerk
(rounding to integer number of samples):

time_to_reach *= DampingFactor
time_to_reach = T*int(time_to_reach/T+1) 

Prediction of the Rendezvous-Point

The predicted position of the rendezvous (minus T, if it will happen in this sample!)
position prediction assuming constant acceleration
Predicted position difference
velocity prediction







Assuming the acceleration will be zero:


Polynomial coefficients of 5-degree polynom connecting the current p,v,a to the randevous p,v,a
- not used, directly written into code
- not used, directly written into code
- not used, directly written into code



Next Sample Position

The position at the next sample will be:
Initial increment (full displacement): 

The acceleration and jerk increments could be computed in this way also.
But they are computed as average values for the time of sample duration, this approach does fit more to
the tools we are using to test this feature, as they all compute acceleration & jerk by numeric differentiation
inside one sample.
The side effect of all this is that we can have a change in jerk/acc sign inside one sample and the average value we are using
ddp,dddp could have an opposite sign, so we are seeing effects like jerk or acceleration is limited from a "wrong side" i.e. instead
using jmax -jmax is used. There is not much we can do against it, using exact jerk/acc values (from polynom) returns than wrong average values
we observe as jerk/acc exceed over their max values. So the average value approach is not perfect but gives results within the given limits.


Initial setting of predicted time and the filter limit flag (if the filter did work - this flag will be on)

limit        = false 
state.satVel = false 
state.satAcc = false  
state.satJrk = false 

Velocity, Acceleration and Jerk Filter

sync_vel defined as VelSyncTran

sync_acc defined as AccSyncTran

sync_jrk defined as JrkSyncTran

T is sampling time



where i.e. unit vector

Setting Initial velocity delta



Setting Initial acceleration delta



New position is:

If the filter was activated then:

if the velocity,accleration or jerk is limited (limit = true) then the velocity computed using polynomials does



Velocity & Accleration will be computed exactly not using dp and ddp, it has been shown that this approach is much better - means more stable



keep the old values for next sample



System is synchronized if NEW delta's are under certesian thresholds:

; - keep the previous dv


syncGain defined by the user with: MF.FilterFactor


Successful tracking completion

if    and  
Synchronization
Take the middle for an additional smoothing:


ResetFilter();		// Reset the filter
state.tracking     =    MOT_MASTER_SYNC; // System synchronized<br>

else if( dv0*dv < 0)
Check against over-oscillation

if (flops == -1) flops = 0; // ignore the first sample
else	         flops++;
flopstime = 0;

Over-Oscillation Check

maxFlops defined by the user with: MF.MaxFlops


if (flops > maxFlops && (flopstime > maxFlopsTime && fabs(dv) > syncGain * sync_accT2))

state.tracking 	= MOT_MASTER_OSC; // OScilationss

else

flopstime++;

State: Stopping (de-synchronization process)

flopstime = flops = 0;
  • De-Syncing profile, follow the given profile, ignore the real source


  • determine the curvature parameters path:


, ,

or linear movement:


  • initialize stopping profile with current values of curvature angle:

desync.pos =
desync.vel =
desync.acc =

See: Theoretical_Background


  • initialize the profiler for stopping - computing the stopping (deceleration path) ad set as new target position for the profiler.
  • during stopping:
desync.Profile();



or in case of linear motion:


if(desync.path.Status.stop)			// if stopped,change the state to OFF
	 SetState(MOT_MASTER_OFF);