USING THE RESET/CALIBRATION ARM =============================== BACKGROUND (not totally necessary): The PHANToM calculates its stylus position using 3 angular sensors. These sensors report relative changes in the 3 joint angles of the arm, rather than the absolute angles. Thus, when you first run a program and initialize the PHANToM, it does not really know where the stylus is, but it can tell you how much it moved from its starting position. Hence, GHOST assumes that the origin (i.e. 0,0,0) is wherever the user holds the stylus when the PHANToM is initialized (unless certain registry values are set to non-zero values, as we'll see later on). As such, the sample code often prompts the user to position the stylus properly before proceeding to initialize the PHANToM, e.g. printf("\nHold PHANToM in reset position and press enter to continue\n"); getchar(); gstPHANToM *phantom = new gstPHANToM("Default PHANToM"); The problem with this is that holding the stylus during a random position (say, to the extreme left) during initialization works (i.e. that position will become the origin), but it also warps the coordinate axes in weird ways. To counter this, the manufacturers have specified a "NEUTRAL POSITION". If the stylus is held at the neutral position, only then will the axes be properly aligned. The problem with this is that the neutral position is notoriously hard to pin down. Why? Firstly, it really isn't a position at all. It's when some particular joints are at right angles to each other (see Hardware Installation and Technical Manual, pg.9) Also, it's pretty hard for a user to hold the stylus steady, even if the neutral position was accurately known. This leads to imprecisions in the coordinate axes, and hence the stylus positions that are read off in software are too inaccurate for our purposes. PROPER PROCEDURE: To improve the accuracy of the system, the manufacturers came up with yet another method. First, check the registry to make sure that certain variables are as they should be: 1) Choose Start->Run regedit 2) Select Edit->Find ResetAngle 3) Check to make sure that ResetAngle0 is set to 0x000012AA (hexadecimal) 4) Check to make sure that ResetAngle1 is set to 0x00F482E2 5) Check to make sure that ResetAngle0 is set to 0x0006D6C7 These values can also be found on page 10 of the "Hardware Installation and Technical Manual", as well as on the right side of the base of the PHANToM arm. If the values are incorrect, change them by clicking on a variable name, and then choosing Edit->Modify. If you do not have administrative rights, then you cannot modify these values and are stuck with them. Find an administrator to change the values for you. These registry settings control the coordinates that are assigned to the initial position that the stylus is held in. For example, when the above settings are used (i.e. 0x000012AA, ...), the initial position is assigned as (0, 373, -180), so that the neutral position is also the origin, which is the desired outcome when the stylus is held at the calibration tip. Previously, using the other methods, the registry values were assumed to be set to 0, so the initial position was assigned as (0, 0, 0). Once these registry values have been verified as correct, proceed to run your program. When prompted to "hold the arm in reset position" or something like that, swing the calibration arm (aka reset arm) down and lock it into place. It should now be fixed pretty rigidly. Attach the PHANToM arm to the calibration arm. See page 9 and figure 14 of the "Hardware Installation and Technical Manual" to learn how this is done. The PHANToM arm and stylus are now in the correct reset position, and you can proceed. The origin is located at the neutral position, not the position of the calibration arm. The coordinates of the tip of the calibration arm (aka calibration tip) are about (0, 373, -180). When initialization is done, swing the calibration arm back up, so that it does not get in the way of the PHANToM arm during movement. BOUNDARIES (ADVANCED): Certain demo programs have a yellow warning screen that reads something like "Do not use the reset arm with the 3.0 model". These demos are not compatible with the reset arm. They should only be run when the registry values (resetAngle0, etc.) are set to 0 (and the stylus held at the neutral position during initialization). The reason for incompatibility is that these demo programs contain workspace boundaries. These boundaries literally force the stylus to be within a specified volume. During initialization, the stylus is held pretty high up, which is outside of these boundaries. When initialization is complete and the program continues execution, GHOST detects that the stylus is outside and forces the stylus back into the volume, which is bad for the PHANToM motors. To make these demo programs compatible with the reset arm, simply remove all workspace boundaries, which are mostly of class gstBoundary or gstBoundaryCube. NON-RESETTING (ADVANCED): The PHANToM initialization can be invoked in 3 ways: 1) gstPHANToM *myPhantom = new gstPHANToM ("blah blah"); 2) gstPHANToM *myPhantom = new gstPHANToM ("blah blah", TRUE); 3) gstPHANToM *myPhantom = new gstPHANToM ("blah blah", FALSE); The first two ways are equivalent, and those are the ones that should be used. Having FALSE as the second argument (the third way) initializes the PHANToM without resetting the encoders, i.e. the coordinate axes carry on from the previous time a GHOST program was run. Unless you have special reasons for doing so, refrain from using the third method, because the coordinate axes from the previous run could be inaccurate. MINI-GLOSSARY: Calibration arm -- stiff rod that is attached to the base of the PHANToM arm. Can be swung down and locked into place, for the purpose of accurate calibration Calibration tip -- tip of the calibration arm GHOST -- API (software) that sits between the hardware and the program code Immersadesk -- the big display screen, as well as the grey casing which houses the projection system Neutral position -- position at which the stylus is held such that the 3 segments of the PHANToM arm are at approximately right angles to each other. PHANToM -- the jointed arm, including the black box to which the arm is attached Reset angles -- three variables in the system registry that should either be set to (0,0,0) or the appropriate values specified on page 10 of the "Hardware Installation and Technical Manual". These values are also found on the right side of the base of the PHANToM arm. Reset arm -- same as calibration arm Reset position -- position at which the stylus should be held during initialization. Can either be same as the neutral position, or when the PHANToM is locked onto the calibration arm. Stylus -- the elongated apparatus found at the end of the PHANToM arm. Workspace boundary -- a box-like volume that specifies the volume within which the stylus is allowed to move. Often of class gstBoundary of gstBoundaryCube REFERENCES: GHOST SDK Programmer's Guide, Version 3.1, page 3-17 PHANTOM PREMIUM 3.0L, 3D Touch Components: Hardware Installation and Technical Manual, pages 8 to 11 Maximum positioning accuracy on Phantom systems (3 page document) AUTHOR: Cheston Tan