# Motion Analysis Pose Generator

Motion analysis pose generator is used to set up parameters, train features, and run motion analysis. It can be found under its hand-eye calibration group.

In the setting page, choose one of the four options (Static Acquisition, Station Motion, Dynamic Motion, or Random Target) from "Test Mode" drop-down list to set up certain evaluation.

## Static Acquisition

Static acquisition moves motion to one specific position and then acquire images repeatedly. This purpose of this test is to evaluate whether there is a vibration issue in current machine.

### Settings

- Test Mode

  Choose Static Acquisition.

- Test Plan

  There is only one option (Basic) under this mode.

- Run Mode

  Options |
  --- | ---
  UncorrectedTrain | Train features in Raw2D
  UncorrectedRun | Run task in Raw2D
  Calibration | Run checkerboard calibration at working position
  CorrectedTrain | Train features in Plate2D
  CorrectedRun | Run task in Plate2D
  HECorrectedTrain | Train features in Home2D
  HECorrectedRun | Run task in Home2D

- Repeat Count

  how many times user want to do the test, the default is 20.

- Working Position

  Specify the position where images will be acquired, features being tracked and accumulated. Motion analysis will only acquire images at working position.

### Train Feature

Before running motion analysis, target feature should be trained first regardless of feature type.

#### Checkerboard Feature

Under checkerboard-based hand-eye calibration, motion analysis can only use checkerboard for feature tracking. Checkerboard plate does not need extra feature finder since motion analysis tool will automatically select the mass point of extracted checkers as target feature to track. User only needs to select the space for feature and then train.

1. Raw2D Train Process

   For Raw2D space training: first select UncorrectedTrain in Run Mode drop-down list, then input repeat count as 1, and then click Run Analysis to train the feature.

   It is the same process when Home2D space is used.

2. Plate2D Train Process

   For Plate2D space training, an extra step to run checkerboard calibration is needed: Choose Calibration in Run Mode drop-down list, input repeat count as 1 and then click Run Analysis to run checkerboard calibration for all cameras used in motion analysis task.

   After checkerboard calibration is done, select Calibration Train in Run Mode and click Run Analysis again to train feature.

#### Part Feature

Under part-based hand-eye calibration, motion analysis can only use real part for feature tracking. When the program is generated, there will be an extra page named "Motion Analysis Setup" on HMI for user to set up feature finder for motion analysis task.

Here are the steps to train features:

1. Acquire images by clicking Run Analysis in train mode.

2. Set feature finders in Motion Analysis Setup page. Since motion analysis only tracks one feature for each camera, only one-point feature finder should be added under each camera.

3. Run Step1 again to train feature.

The same process above applies to feature training in either Raw2D or Home2D space.

Note: Even Repeat Count is set as larger than 1, motion analysis will only run once when Run Mode is "UncorrectedTrain", "Calibration", or "CalibrationTrain".

### Run

After features is trained, change Run Mode to UncorrectedRun/CorrectedRun/HECorrectedRun depending on in which space feature is trained; Set parameters such as repeat count, working position, and then click Run Analysis button to run the motion analysis procedure.

## Static Motion

Static motion mode moves motion device back and forth between working position and target position until it has repeated this move sufficient times. The target position could either be a fixed position or one position from a set of boundary positions depending on which test plan user choose: Simply, Moderate, or Fully.

### Simply

In simply test plan, motion analysis function will control the motion device to move back and forth between working position a fixed target position repeatedly. The train time process is the same as described in Static Acquisition. Here are steps to set up for run:

1. Select Static Motion in test mode.
2. Select Simply in test plan.
3. Choose UncorrectedRun/CorrectedRun/HECorrectedRun in run mode depending on in which space features were trained because run time space and train time space should be the same.
4. Input repeat count, the default value is 20.
5. Input working position and target position.
6. Click Modify to confirm target position if it has been changed.
7. Click Run Analysis to run the motion analysis.

### Moderate

In moderate test plan, motion analysis function will move motion device back and forth between working position and a serial of boundary positions within inputted Max Limit Pose and Min Limit Pose. The train time process is the same as described in Static Acquisition. Here are steps to set up for run:

1. Select Static Motion in test mode.
2. Select Moderate in test plan.
3. Choose UncorrectedRun/CorrectedRun/HECorrectedRun in run mode depending on in which space features were trained because run time space and train time space should be the same.
4. Input repeat count, the default value is 20.
5. Input working position, max limit pose and min limit pose.
6. Click Run Analysis to run the motion analysis.

Let us assume the max limit pose is (X2, Y2, Ө2) and min limit pose is (X1, Y1, Ө1), then the generated set of poses will be as listed in table below.

Index | Acquisition Position
--- | ---
1 | (X2, Y2, Ө2)
2 | (X2, Y2, Ө1)
3 | (X2, Y1, Ө2)
4 | (X2, Y1, Ө1)
5 | (X1, Y2, Ө2)
6 | (X1, Y2, Ө1)
7 | (X1, Y1, Ө2)
8 | (X1, Y1, Ө1)

Once the Run Analysis button is clicked, motion device will move to working position to let vision take a set of images, and then move to the first position in the table and come back to working position where vision takes another set of images, then move to the second position in the table and come back again to working position to acquire images, and so on. After the last position has been moved to, the target position will go back to the first position of the table until repeated moves have reached specified count.

### Fully

In fully test plan, motion analysis function will move motion device back and forth between working position and a full set of boundary positions. The full set of positions are consisted of three sub sets which moves motion device along single axis move, two axes or three axes within inputted maximum and minimum positions.

The train time process is the same as described in Static Acquisition. The run time process is the same with moderate test plan's excepting changing test plan to Fully.

Let's assume the max limit pose is (X2, Y2, Ө2) and min limit pose is (X1, Y1, Ө1), the single axis move will have 6 poses, two axes move will have 12 poses, and three axes move will have 8 poses.

Index | Single Axis Move | Two Axes Move | Three Axes Move
--- | --- | --- | ---
1 | (X2, 0, 0) | (X2, Y2, 0) | (X2, Y2, Ө2)
2 | (X1, 0, 0) | (X2, Y1, 0) | (X2, Y2, Ө1)
3 | (0, Y2, 0) | (X1, Y2, 0) | (X2, Y1, Ө2)
4 | (0, Y1, 0) | (X1, Y1, 0) | (X2, Y1, Ө1)
5 | (0, 0, Ө2) | (X2, 0, Ө2) | (X1, Y2, Ө2)
6 | (0, 0, Ө1) | (X2, 0, Ө1) | (X1, Y2, Ө1)
7 | / | (X1, 0, Ө2) | (X1, Y1, Ө2)
8 | / | (X1, 0, Ө1) | (X1, Y1, Ө1)
9 | / | (0, Y2, Ө2) | /
10 | / | (0, Y2, Ө1) | /
11 | / | (0, Y1, Ө2) | /
12 | / | (0, Y1, Ө1) | /

Once the Run Analysis button is clicked, motion device will move the same way as in moderate test plan except that fully test plan has a larger set of target positions to iterate.

## Dynamic Motion

Under dynamic motion test mode, motion device moves between working position and a set of customized target positions. Dynamic motion mode is used to analyze backlash of motion system. The train time process is the same as described in Static Acquisition. Here are the steps to set parameters for run:

1. Select DynamicMotion in test mode.
2. There will be only one option for test plan: CustomizedPath
3. Choose UncorrectedRun/CorrectedRun/HECorrectedRun in run mode depending on in which space features were trained because run time space and train time space should be the same.
4. Input repeat count, the default value is 20.
5. Input working position where images will be acquired.
6. Input one target position and click Add to add it to moving path. Add more target positions if you like. If certain target position needs to be modified, select that position in the drop down list, modify it in edit boxes of target position, and click Modify to save the changes. If that position should be removed, select it from drop down list, then click Delete button.
7. Click Run Analysis to run the motion analysis.

Once the Run Analysis button is clicked, motion device will move to working position to let vision take a set of images, and then move to the first position in the target position list and come back to working position where vision takes another set of images, then move to the second position in the list and come back to working position to acquire images again, and so on. After the last position in the list has been moved to, the target position will go back to the first position of the list until repeated moves have reached specified count.

## Random Target Motion

In random target motion mode, motion device moves between working position and random target positions repeatedly. The random positions are generated by motion analysis tool within inputted max and min limit poses. Random target motion is used to evaluate motion device's absolute position repeatability.

The train time process is the same as described in Static Acquisition. Here are the steps to set parameters for run:

1. Select RandomTargetMotion in test mode.
2. There will be only one option for test plan: RandomOneTarget
3. Choose UncorrectedRun/CorrectedRun/HECorrectedRun in run mode depending on in which space features were trained because run time space and train time space should be the same.
4. Input repeat count, the default value is 20.
5. Input working position where images will be acquired.
6. Input max limit pose and min limit pose where random position will be generated within.
7. Click Run Analysis to run the motion analysis.

Once the Run Analysis button is clicked, motion device will move to working position to let vision take a set of images, and then move to a random position generated by motion analysis tool and come back to working position where vision takes another set of images, then move another random position and come back to working position to acquire images again, and so on. Repeat this process until it reaches specified times.