Difference between revisions of "AXY:Element Coordination/Multi Dimensional Tracking Algorithm (Orientation)"
(→Time-to-Reach initial estimation) |
|||
(14 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | = Multi Dimensional Tracking Algorithm = | + | = Multi-Dimensional Tracking Algorithm = |
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> | ||
− | + | Orientation is considered to be a 3-dimensional vector with its derivatives (velocity, acceleration, jerk): <math>\vec e </math> , <math>\vec de</math> , <math>\vec dde</math><br> | |
<math>\vec e = (yaw,pitch,roll)</math><br> | <math>\vec e = (yaw,pitch,roll)</math><br> | ||
Line 27: | Line 27: | ||
<table style="float:right" border = "1"> | <table style="float:right" border = "1"> | ||
<tr><td> | <tr><td> | ||
− | Value of [[ | + | Value of [[MC-Basic:movingFrame.ACCELERATIONMAXROT|AccMaxRot]] is used of checking of acceleration limit. |
</td></tr> | </td></tr> | ||
<tr><td> | <tr><td> | ||
− | Value of [[ | + | Value of [[MC-Basic:movingFrame.VELOCITYMAXROT|VelMaxRot]] is used of checking of velocity limit. |
</td></tr> | </td></tr> | ||
</table> | </table> | ||
Line 44: | Line 44: | ||
<table style="float:right" border = "1"> | <table style="float:right" border = "1"> | ||
<tr><td> | <tr><td> | ||
− | <math>{sync_{jrk}}</math> defined as [[ | + | <math>{sync_{jrk}}</math> defined as [[MC-Basic:robot.JERKSYNCROT|SyncJerkRot]] |
</td></tr> | </td></tr> | ||
<tr><td> | <tr><td> | ||
− | <math>{sync_{acc}}</math> defined as [[ | + | <math>{sync_{acc}}</math> defined as [[MC-Basic:robot.ACCELERATIONSYNCROT|SyncAcclerationRot]] |
</td></tr> | </td></tr> | ||
</table> | </table> | ||
Line 65: | Line 65: | ||
<table style="float:right" border = "1"> | <table style="float:right" border = "1"> | ||
<tr><td> | <tr><td> | ||
− | DampingFactor - user defined by: [[ | + | DampingFactor - user defined by: [[MC-Basic:movingFrame.DAMPINGFACTOR|MF.DAMPINGFACTOR]] |
</td></tr> | </td></tr> | ||
</table> | </table> | ||
Line 78: | Line 78: | ||
=== Prediction of the Rendezvous-Point === | === Prediction of the Rendezvous-Point === | ||
− | ''The predicted | + | ''The predicted orientation of the rendezvous (minus T, if it will happen in this sample!)''<br> |
− | <math>\overrightarrow {pred}_{ | + | <math>\overrightarrow {pred}_{ori}</math>: ''orientation prediction assuming constant acceleration''<br> |
− | <math>\overrightarrow {pred}_{diff}</math>: ''Predicted | + | <math>\overrightarrow {pred}_{diff}</math>: ''Predicted orientation difference''<br> |
<math>\overrightarrow {pred}_{vel}</math>: '' velocity prediction''<br> | <math>\overrightarrow {pred}_{vel}</math>: '' velocity prediction''<br> | ||
<math>t = (time_{toreach}-T)</math><br> | <math>t = (time_{toreach}-T)</math><br> | ||
− | <math>\overrightarrow {pred}_{ | + | <math>\overrightarrow {pred}_{ori} = \overrightarrow {master}_{ori} + t*\overrightarrow {master}_{vel} + t^2*\overrightarrow {master}_{acc}/2</math><br> |
− | <math>\overrightarrow {pred}_{diff} = \overrightarrow {pred}_{ | + | <math>\overrightarrow {pred}_{diff} = \overrightarrow {pred}_{ori} - \overrightarrow {track}_{ori}</math><br> |
<math>\overrightarrow {pred}_{vel} = \overrightarrow {master}_{vel} + t*\overrightarrow {master}_{acc}</math><br> | <math>\overrightarrow {pred}_{vel} = \overrightarrow {master}_{vel} + t*\overrightarrow {master}_{acc}</math><br> | ||
Line 96: | Line 96: | ||
'' 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>\overrightarrow a0 = \overrightarrow {track}_{ | + | <math>\overrightarrow a0 = \overrightarrow {track}_{ori} </math> - ''not used, directly written into code''<br> |
<math>\overrightarrow a1 = \overrightarrow {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>\overrightarrow a2 = 0.5*\overrightarrow {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> | ||
Line 103: | Line 103: | ||
<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> | <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 | + | === Next Sample Orinetation === |
− | ''The | + | ''The orinetation at the next sample will be:''<br> |
''Initial increment (full displacement): ''<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> | ''Initial increment (full displacement): ''<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 accleration 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 | + | '' 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, | + | '' 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 | + | '' 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 | + | '' 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 | + | '' we observe as jerk/acc exceed over theri max values. So the average value approach is not perfect but gives results within the given limits.''<br> |
Line 129: | Line 129: | ||
<table style="float:right" border = "1"> | <table style="float:right" border = "1"> | ||
<tr><td> | <tr><td> | ||
− | sync_vel defined as [[ | + | sync_vel defined as [[MC-Basic:robot.VELOCITYSYNCROT|VelSyncRot]] |
</td></tr> | </td></tr> | ||
<tr><td> | <tr><td> | ||
− | sync_acc defined as [[ | + | sync_acc defined as [[MC-Basic:robot.ACCELERATIONSYNCROT|AccSyncRot]] |
</td></tr> | </td></tr> | ||
<tr><td> | <tr><td> | ||
− | sync_jrk defined as [[ | + | sync_jrk defined as [[MC-Basic:robot.JERKSYNCROT|JrkSyncRot]] |
</td></tr> | </td></tr> | ||
<tr><td> | <tr><td> | ||
Line 144: | Line 144: | ||
− | <math> \overrightarrow { | + | <math> \overrightarrow {de} = \begin{cases} sync_{velT} \cdot \overrightarrow {de^*} , & \mbox{if } |\overrightarrow {de}| > sync_{velT} \\ limit = true \\ \overrightarrow {de} , & \mbox{if } |\overrightarrow {de}| \le sync_{velT}\end{cases}</math> |
Line 150: | Line 150: | ||
==== Setting Initial velocity delta==== | ==== Setting Initial velocity delta==== | ||
− | <math>\overrightarrow { | + | <math>\overrightarrow {dde} = \overrightarrow {de} - \overrightarrow {de_0}</math> <br> |
− | <math> \overrightarrow { | + | <math> \overrightarrow {dde} = \begin{cases} sync_{acc}T^2\cdot \overrightarrow {dde^*} , & \mbox{if } |\overrightarrow {dde}| > sync_{acc}T^2 \\ \overrightarrow {de} = sync_{acc}T^2\cdot \overrightarrow {dde^*} + \overrightarrow {de_0} \\limit = true \\ \overrightarrow {dde}, |
− | & \mbox{if }|\overrightarrow { | + | & \mbox{if }|\overrightarrow {dde}| \le sync_{acc}T^2 \end{cases}</math> |
==== Setting Initial acceleration delta==== | ==== Setting Initial acceleration delta==== | ||
− | <math>\overrightarrow { | + | <math>\overrightarrow {ddde} = \overrightarrow {dde} - \overrightarrow {dde_0}</math> <br> |
− | <math> \overrightarrow { | + | <math> \overrightarrow {ddde} = \begin{cases} sync_{jrk}T^3\cdot \overrightarrow {ddde^*} , & \mbox{if } |\overrightarrow {ddde}| > sync_{jrk}T3 \\ \overrightarrow {dde} = sync_{jrk}T^3 \cdot \overrightarrow {ddde^*} + \overrightarrow {dde_0} \\\overrightarrow {de} = \overrightarrow {dde} + \overrightarrow {de_0}\\limit = true \\ \overrightarrow {ddde}, |
− | & \mbox{if }|\overrightarrow { | + | & \mbox{if }|\overrightarrow {ddde}| \le sync_{jrk}T^3 \end{cases}</math> |
− | ==== New | + | ==== New orientation is: ==== |
− | <math>track_{ | + | <math>track_{ori} = track_{ori} + de</math> |
==== 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> \overrightarrow {track}_{vel} = \overrightarrow { | + | <math> \overrightarrow {track}_{vel} = \overrightarrow {de}/T </math><br> |
− | <math> \overrightarrow {track}_{acc} = \overrightarrow { | + | <math> \overrightarrow {track}_{acc} = \overrightarrow {dde}/T^2</math><br> |
<br> | <br> | ||
− | '' Velocity & | + | '' Velocity & Acceleration will be computed exactly not using de and dde, it has been shown that this'' |
'' approach is much better - means more stable''<br> | '' approach is much better - means more stable''<br> | ||
Line 179: | Line 179: | ||
====keep the old values for next sample==== | ====keep the old values for next sample==== | ||
− | <math>\overrightarrow { | + | <math>\overrightarrow {dde}_0 = \overrightarrow {dde}</math> <br> |
− | <math>\overrightarrow { | + | <math>\overrightarrow {de}_0 = \overrightarrow {de}</math> <br> |
====System is synchronized if NEW delta's are under certesian thresholds:==== | ====System is synchronized if NEW delta's are under certesian thresholds:==== | ||
Line 189: | Line 189: | ||
<table style="float:right" border = "1"> | <table style="float:right" border = "1"> | ||
<tr><td> | <tr><td> | ||
− | syncGain defined by the user with: [[ | + | syncGain defined by the user with: [[MC-Basic:movingFrame.FILTERFACTOR|MF.FilterFactor]] |
</td></tr> | </td></tr> | ||
</table> | </table> | ||
Line 197: | Line 197: | ||
==== Successful tracking completion ==== | ==== Successful tracking completion ==== | ||
− | '''if''' <math>(|\overrightarrow {dv}| \le syncGain * sync_{acc} T)</math> '''and''' <math>(|\overrightarrow {master}_{ | + | '''if''' <math>(|\overrightarrow {dv}| \le syncGain * sync_{acc} T)</math> '''and''' <math>(|\overrightarrow {master}_{ori} - \overrightarrow {track}_{ori}| \le syncGain * sync_{acc} T^2)</math> <br> |
'' Synchronization'' <br> | '' Synchronization'' <br> | ||
'' Take the middle for an additional smoothing:''<br> | '' Take the middle for an additional smoothing:''<br> | ||
− | <math>\overrightarrow {track}_{ | + | <math>\overrightarrow {track}_{ori} = 0.5*(\overrightarrow {track}_{ori} + \overrightarrow {master}_{ori})</math><br> |
<math>\overrightarrow {track}_{vel} = 0.5*(\overrightarrow {track}_{vel} + \overrightarrow {master}_{vel})</math><br> | <math>\overrightarrow {track}_{vel} = 0.5*(\overrightarrow {track}_{vel} + \overrightarrow {master}_{vel})</math><br> | ||
<pre> | <pre> | ||
Line 218: | Line 218: | ||
<table style="float:right" border = "1"> | <table style="float:right" border = "1"> | ||
<tr><td> | <tr><td> | ||
− | maxFlops defined by the user with: [[ | + | maxFlops defined by the user with: [[MC-Basic:movingFrame.MAXFLOPS|MF.MaxFlops]] |
</td></tr> | </td></tr> | ||
</table> | </table> | ||
Line 281: | Line 281: | ||
</pre> | </pre> | ||
− | [[Category | + | [[Category:Motion:MovingFrame]] |
Latest revision as of 09:18, 22 May 2014
Contents
- 1 Multi-Dimensional Tracking Algorithm
- 1.1 State: Full Synchronization follow the master
- 1.2 State: Tracking process
- 1.2.1 Initial Setup and testing
- 1.2.2 Time-to-Reach initial estimation
- 1.2.3 Prediction of the Rendezvous-Point
- 1.2.4 Next Sample Orinetation
- 1.2.5 Velocity, Acceleration and Jerk Filter
- 1.2.5.1 Setting Initial velocity delta
- 1.2.5.2 Setting Initial acceleration delta
- 1.2.5.3 New orientation is:
- 1.2.5.4 If the filter was activated then:
- 1.2.5.5 keep the old values for next sample
- 1.2.5.6 System is synchronized if NEW delta's are under certesian thresholds:
- 1.2.5.7 Successful tracking completion
- 1.2.5.8 Over-Oscillation Check
- 1.3 State: Stopping (de-synchronization process)
Multi-Dimensional Tracking Algorithm
This algorithm is used for multi-dimensional robot based MF tracking.
In this document position-tracking is presented.
Orientation 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:
- Tracking process
- Full Synchronization follow the master
- 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 AccMaxRot is used of checking of acceleration limit. |
Value of VelMaxRot 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-orientation
pure delta-velocity
Time-to-Reach initial estimation
defined as SyncJerkRot |
defined as SyncAcclerationRot |
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 orientation of the rendezvous (minus T, if it will happen in this sample!)
: orientation prediction assuming constant acceleration
: Predicted orientation 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 Orinetation
The orinetation at the next sample will be:
Initial increment (full displacement):
The accleration 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 theri 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 VelSyncRot |
sync_acc defined as AccSyncRot |
sync_jrk defined as JrkSyncRot |
T is sampling time |
where i.e. unit vector
Setting Initial velocity delta
Setting Initial acceleration delta
New orientation 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 & Acceleration will be computed exactly not using de and dde, 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 =
- 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);