-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Documenting a discussion with Christophe and Paolo. Not sure when this is the right idea or not.
Robots are manufactured with components of different characteristics. Adding calibration in manufacturing is not cost-effective. Field calibration is possible under two conditions:
- Having a mechanism for adjusting values on the fly based on stored calibration parameters
- Having a reliable test program and calibration environment that deduces parameters
Christophe has observed that the correction of motor speed, for example, depends on the speed. Sensor response is nonlinear, but the unreliable sensors have the same curve, just squashed. My intuition is that a low-cost affine y = Ax + b transformation will be good enough (testable hypothesis!).
Proposed firmware modification
The proposal is to:
- Add a table of (A,b) parameters in the flash memory, initially (1,0) for each sensor and motor.
- Change the firmware so that at runtime it applies this transformation on the fly to each value, either when reading (sensors) or writing (motor target).
This will consume 11 words of flash memory, and will add approximately 66 cycles to the microcontroller's update loop.
For example, when the Aseba program asks to set the target motor left speed to 300, and the flash parameters have (105,6) stored because the physical motor is 5% slower than expected, the value actually applied would be (300*1.05+6) = 321. For example, a batch of ground sensors that measure at 80% of the expected value, would have flash parameters (125,0), and convert a measured value of 420 to 525.
Plan B (plan Z): compiler modification
If it is not feasible to change the firmware, the Aseba compiler could be changed to take into account an optional robot profile, consisting of the calibration parameters. The generated code would apply these transformations when reading or writing. Advantage: no modification of firmware. Disadvantages:
- Bytecodes would not be portable between robots. Possibly not a problem since usually programs are recompiled anyway, except when loaded automatically from the SD card
- Since the transformation is done in bytecode, it will be slower and reduce available program memory
- The Studio will need access to a catalog of robot profiles or a means of loading one.
Calibration environment
The calibration environment could be a 1000mmx1000mm box with off-white walls and a fixed ground pattern. It could be built by any user or by a local support service. With the right ground pattern, the time series of left and right ground sensor events for a given motor speed is enough to deduce: ground speed (from the intervals of the events), left/right motor delta (from the phase of the events, since the delta will induce a curved path), and ground sensor grey level detection (from the measured values).
Since printers have different ideas of grey levels, it might be more reliable to use a black and white dither pattern. The ground sensors see out of focus anyway.
The proximity sensors can be calibrated from the dimensions of the box, only once the motor speeds have been calibrated.