# The Off-Line Simulation on Measuring through Software PC-DMIS CAD++ V4.3
## 4 Discussion
Our own alignment of the coordinate systems (Figure 17) consists in the scanning of six points \(P_{im}\left(x_{p_{m}},y_{p_{m}},z_{p_{m}}\right),i=1,\ldots,6\), which are on the surface of the measured part, while all points are scanned in the coordinate system of the coordinate measuring machine. The alignment points that form the coordinate system of the component have to be arranged on its surface so that they are on the most accurate, contiguous perpendicular surfaces. Figure 16: Measuring decomposition of the programming task. The first three alignment points, \(P_{1m}\big{(}x_{P_{1m}},y_{P_{1m}},z_{P_{1m}}\big{)}\), \(P_{2m}\big{(}x_{P_{2m}},y_{P_{2m}},z_{P_{2m}}\big{)}\) and \(P_{3m}\big{(}x_{P_{3m}},y_{P_{3m}},z_{P_{3m}}\big{)}\), scanned on one surface of the measured part determine the plane translation, which is the coordinate plane \(x_{w}y_{w}\) of the part coordinate system. The next two points \(P_{4m}\big{(}x_{P_{4m}},y_{P_{4m}},z_{P_{4m}}\big{)}\) and \(P_{5m}\big{(}x_{P_{5m}},y_{P_{5m}},z_{P_{5m}}\big{)}\) are scanned on a surface perpendicular to the previous part surface. The plane passing through the points \(P_{4m}\) and \(P_{5m}\) is perpendicular to the previous plane and at the same time is the coordinate plane \(x_{w}z_{w}\) of the part coordinate system. The plane perpendicular to the previous planes passes through the last point \(P_{6m}\big{(}x_{P_{6m}},y_{P_{6m}},z_{P_{6m}}\big{)}\) scanned on the surface perpendicular to the previous two surfaces of the part, and this represents the plane \(y_{w}z_{w}\) of the coordinate system of the part. The coordinate system of the component (\(O_{w}\), \(x_{w}\), \(y_{w}\), \(z_{w}\)) is now mathematically related to the coordinate system of the coordinate measuring machine (\(O_{m}\), \(x_{m}\), \(y_{m}\), \(z_{m}\)). For the transformation matrix \(T\), which describes the translation and rotation between the given coordinate systems, the following applies (1):  
\[T=\left[ \begin{array}{cccc}a_{xw}&a_{yw}&a_{zw}&O_{xw}\\ b_{xw}&b_{yw}&b_{zw}&O_{yw}\\ c_{xw}&c_{yw}&c_{zw}&O_{zw}\\ 0&0&0&1\end{array} \right] \tag{1}\]  
The direction vectors \(s_{xw}\), \(s_{yw}\), \(s_{zw}\) of the individual coordinate axes \(x_{w}\), \(y_{w}\), \(z_{w}\) of the component coordinate system can be expressed as follows (2):  
\[ \begin{array}{c}s_{zw}\ =\ (P_{1}P_{2}\ x\ P_{1}P_{3})=(P_{2}-P_{1})\ x\ (P_{3}-P_{1})=(s_{zw1}\,\ s_{zw2}\,\ s_{zw3})\\ s_{xw}\ =\ P_{4}P_{5}=(P_{5}-P_{4})=(s_{xw1}\,\ s_{xw2}\,\ s_{xw3})\\ s_{yw}\ =\ (z_{w5}\ x_{w})=(s_{yw1}\,\ s_{yw2}\,\ s_{yw3})\end{array}  \tag{2}\]  
where \(P_{1}\)-\(P_{5}\)--relevant alignment points. For directional cosines of the coordinate axes \(x_{w}\), \(y_{w}\), \(z_{w}\) of the coordinate system of the component with respect to the coordinate system of the coordinate measuring machine (3):  
\[ \begin{array}{c}\cos\alpha_{xw},\ y_{w},\ zw=\frac{s_{xw1,\ yw1,\ zw1}}{|s_{ xw,\ yw2,\ zw2}}\\ \cos\beta_{xw},\ y_{w},\ zw=\frac{s_{xw1,\ yw2,\ zw2}}{|s_{xw,\ yw2,\ zw2}|}\\ \cos\gamma_{xw},\ y_{w},\ zw=\frac{s_{xw1,\ yw3}}{|s_{xw,\ yw2,\ zw2}|}\end{array}  \tag{3}\]  
Figure 17: Coordinate system alignment. \(O_{m}(x_{m},y_{m},z_{m})\)—coordinate system of the coordinate measuring machine, \(O_{w}(x_{w},y_{w},z_{w})\) —coordinate system of the verified part; \(P_{1}\) —points scanned on the surface of the part; \(PLN_{T}\) —plane of the work table of the coordinate measuring machine. Until the mutual position of the coordinate systems is defined, the coordinates of all scanned points are expressed in the machine coordinate system, and only then are all scanned points expressed in the current coordinate system of the part. Rough alignment. During the rough alignment, the individual points are scanned in manual mode, which means that the touch tip of the scanning system does not touch the surface of the measured part with a constant force at all scanned points, and therefore, it is not possible to speak about a sufficiently precise definition of the mutual position of coordinate systems.