-
Notifications
You must be signed in to change notification settings - Fork 85
Encoder Calibration
Note: The new Dexter HDI shouldn't need calibration, and the re-calibration process is complex. Don't calibrate a Dexter HDI!
When Dexter starts, it does not know where it is. And it does not have it's normal precision in detecting movements. The encoders send signals back to the FPGA, but the FPGA doesn't know what those signals mean, because it hasn't seen the sequence of signals for each slot. Because of small variations in the printing of the slots, each slot may have slight errors which must be compensated for. Also, there are variations introduced by the positioning of the sensors with respect to the disk, drive level of the LEDs, etc... As a result, the signals recieved are variable over the range of movement.
So, before the encoders can work, each joint must be moved through it's entire range of motion and the signals for each slot recorded into the FPGAs memory. We call that "movement calibration" or "power on calibration" or "calibration" or just "cal" as opposed to "eye calibration" (which is finding the center point of the sin/cos plot of the encoders ). On the HDI, this has been done at the factory, and the results recorded on the robot, so it does not need to be done again.
Eye calibration must be completed before the calibration described here can be successful.
HDI's are calibrated (both eye and movement) at the factory, and the eye calibration affects the movement calibration, so Don't calibrate a Dexter DHI!
Power on calibration can be done in several ways:
-
DDE has a "Calibrate Dexter..." dialog on the "Jobs" menu. There are 3 sections, first to select which robot to talk to, then a middle "Step 2" part for each joint to help adjust the "eye" pattern for each set of sensors and to mark the center. This center marking / eye calibration and adjustment section can only be done in DDE and should only need to be done once unless the robot is damaged or the position of the encoder blocks is somehow changed. It also allows you to save the centers into the robot in the AdcCenters.txt file.
DO NOT SAVE CALIBRATION ON A DEXTER HDI
The last part, at the bottom, "3. Calibrate optical encoders", starts the power on / movement calibration. This version is slow as it does each joint individually and it requires a lot of space, however, it is very smooth and provides the best results.
- The file "Cal.make_ins" can be run from the robot via the "S RunFile Cal.make_ins" SetParameter oplet. That file contains all the instructions required to move the joints through every position, just like step 3 in the DDE calibration dialog.
- The file "FastCal.make_ins" can be run from the robot via the "S RunFile FastCal.make_ins" SetParameter oplet. That file contains all the instructions required to move the joints through every position, all at the same time, and then turns on the necessary parts of the FPGA. It is very fast, and requires less space, but the shaking caused by moving all the joints at the same time can cause errors in the recording. Again, this is just like step 3 in the DDE calibration dialog.
- Those same instructions (as sent from DDE or the make_ins files) can be sent from some other program.
In any case, the data collected allows the FPGA to monitor joint position with extreme precision. It is important to understand that this relationship between where the joint motor was commanded to be, and the reading seen on the joint encoder, has no bearing on the actual slot in the encoder disk, or where that slot is. In fact, the slots can be imperfect in many ways and those errors are effectively removed by this mapping.
Actually, all that data is recorded, in a file called HiMem.dta, and that file is loaded back into RAM on startup. The problem is, there is no way to match the current position of a joint with a position in the data file. If the arm is calibrated, and the file saved, then turned off, and the arm is moved, then turned back on again, the position is unknown.
Not knowing where the arm is when it powers up would seem to be a simple problem to solve, but it is not. Limit switches require another set of wires to each joint, and extra wires are amazingly difficult to run. It is possible to always start the arm in the same position, and that is the approach we have most often used. Small knob / arrows on each motor shaft can be aligned to a know position and that gets us close enough to then find our place in a slot.
Even better, with a "garage" or "dock" where the tool interface is placed before powerup, we can know where the arm is on power up. Then we can set the position into the data from the HiMem.dta file, and know exactly where we are. Some changes required to make this possible were made in the 2018/12/10 released (off the Master branch)
To search the Wiki, use the main search box in the black bar at the top, then select WiKi to filter the results or go to https://github.com/HaddingtonDynamics/Dexter/search?type=Wikis&q= and then add your search terms to the end of the URL.
To report errors, or request additional data, please chat with us on discord and/or raise a new issue