Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert AxisCal.txt to SetParameters, Add HomeOffset
In order to support the HDI with Joint 4 /5 axis which also do NOT use the microstep interpolation in the FPGA, the hardcoded *16 interpolation factor needed to be made configurable. This seemed like the best time to also move the other settings in AxisCal.txt to the Defaults.make_ins file. The HGI uses different gearing on the harmonic drives, and having multiple options in the Defaults.make_ins file with some commented out and others commented in makes it easy to document those differences and switch between them for different robots. Everything specific to the robot configuration would be in that one file at this point (Other than AdcCenters.txt which needs to remain very easy to write). Instead of using pre-calculated JointsCal values (as in the AxisCal.txt file) the values supplied in the new AxisCal SetParameter are the gearing ratios * steps per revolution * microstepping mode for each axis. This makes calculating the correct values for new robots or different versions of Dexter very easy. For example, with a 52:1 harmonic drive, 400 step per revolution motor, and 16x over microstepping, the number for joints 1 to 5 on a Dexter 1 or Dexter HD is -332800. It's negative so the drive system moves in the correct direction. With a different ordering of the stepper motor wires, that might be positive instead and the motion would still be the same. The Interpolation values are defaulted to 1, 1, 1, 16, 16 which are the standard for the Dexter 1 and HD. The Interpolation SetParameter can then be used only in the Dexter HDI to set them to 1, 1, 1, 1, 1 (e.g. no interpolation). These settings must match the operation of the fpga gateware .bit file. The necessary JointsCal and ANGLE_END_RATIO values are now calculated from these parameters and they are NOT loaded from the AxisCal.txt file, which can be removed. At this point, backwards compatibility with the Dexter 1 / Dexter HD system is assured as long as the following line is added to Defaults.make_ins: S, AxisCal, -332800, -332800, -332800, -36000, -36000 ;Defaults for Dexter HD A new SetParameter for HomeOffset is also added to allow experimental offsetting of "P" or pid moves and the resulting measured angle return values. This hopes to offset the slight movement of the robot after calibration.
- Loading branch information
4c506d6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example use / test:
S HomeOffset 0 0 0 0 324000;
P 0 0 0 0 0;
(the joint moves NEGATIVE -90 degreesthen g gives you: MEASURED_ANGLE 3 11 3 59 16
and then if you
S HomeOffset 0 0 0 0 0;
(the joint does NOT move)and g gives you: MEASURED_ANGLE 0 7 0 14 -323954;
then you can
P 0 0 0 0 0;
(the joint returns to zero)and g gets MEASURED_ANGLE 7 0 7 44 59
Notice that the HomeOffset is applied first and then the resulting value is multiplied by JointsCal. This means that the units for HomeOffset are those the user is sending. If you are sending XL-320 units, specify the offset in XL-320 units. If you are sending arcseconds, specify the offset in arcseconds.