Regbot calibration

From Rsewiki
(Difference between revisions)
Jump to: navigation, search
(Edge)
(test edge)
Line 93: Line 93:
 
The right edge should show about 0, i.e. the robot center line is just above the right edge.
 
The right edge should show about 0, i.e. the robot center line is just above the right edge.
  
The part of the surface that is not the white line should have no more than 80% of the reflection of the white line.
+
The part of the surface that is not the white line should have no more than 80% of the reflection of the white line (at the color of the LED).
  
 
=== Crossing detect ===
 
=== Crossing detect ===

Revision as of 14:43, 24 May 2019

Contents

Calibration

In the REGBOt GUI, the "robot" pane has the basic configuration

Gui-robot.png

Figure 1. Basic robot settings.

  • "Base WB [m]" is the distance between driving wheels. This is important for heading calculation and turning.
  • "gear N" is gear reduction - normally 9.68
  • "pulses per rev" is encoder configuration - number of pulses for one motor revolution - normally 48.
  • "wheel radius" is important for distance calculation, and a bit for velocity and turning.
  • "COG tilt offset" Center of Gravity tilt offset is important when keeping balance, should be adjusted, so that "tilt" (lower right) is 0, when in balance (hand held), if not, then add tilt value to "COG tilt offset". Accuracy should be about 0.01 radian (0.5 degree).

To change, press "edit", do the change and press "save" - and to be permanent after a reboot press "save to flash"

Gyro

The gyro is primarily used when in balance, but could be usefull for turning as well. The gyro has an offset, that can be calibrated away.

Gui-imu.png

Figure 2. Gyro calibration. The lower left graph are the gyro values, when tha calibration values are implemented. The lower right graph is the accelerometer (raw) values - no calibration offered here. The top right graph is the tilt angle - a combination of gyro and acceleromerter values (complementary filter).

  • To calibrate, make sure the robot is steady (no movement, no touch) then click the "calibrate" on the "IMU" pane. This will average the values over 1s and use as an offset.
  • after this the 3 gyro values should have zero mean.

Encoder

Encoder calibration attempt to compensate for the uneven sized magnets in the magnetic encoder.

Gui-encoder.png

Figure 3. Calibration the encoder. The graph shows for all 48 encoder tics the time between the tics at constant velocity. Ideally it should be a straight line.

  • To calibrate tick both "Get raw data regulary" and "Run motor at 3V" (wheels away from floor).

This will show some rather uneven lines in the plot.

  • press the "Do calibration" button, once the velocity is stable.

This should make the calibrated lines more straight.

  • Tick also the "Use calibration" (to the right) to use the calibrated values. If this is ticked and the calibration is out of sync, then it probably is worse than no calibration.
  • NB! the calibration will only work as long as all encoder tics are counted, i.e. not after a reboot.


Edge

Edge (or line) detector for tape lines.

Gui-edge.png

Figure 4. Calibration line sensor.

Function

The sensor use blinking LEDs - on in 0.5ms and off in 0.5ms - the detected difference is converted to a value between 0 (black) and 4096 (high refection). The censor has automatic offset and is fairly linear within a wide range of ambient illumination.

Direct sunlight will in most cases saturate the sensor.

LED illumination with a blink frequency close to 1 kHz will disturb the sensor.

Turn on

Turn on line sensor by ticking the "on" field.

Select "White line" - system is never tested on a black line (may/2019).

High power and tilt compensate should only be used when regot is in balance.

To change, pres first the edit button, and when finished press the apply button (followed by the "save to flash" to make sure it stays after a reboot.

Edge sensor calibration

Place the robot so that the illuminated area is on the white part of the (tape) line, and the robot is in its normal configuration (i.e. all wheels on the ground).

The bars should be more than half filled and not saturated, and flickering slightly. Now, press the "calibrate on white", then the new calibration values will be shown for all 8 sensors.

Lift the robot, so that the sensor sees nothing and press "reflection on black".

Again press "apply" and "save to flash" to save.

test edge

Place the robot so that the left side of sensor sees the white tape and the right side do not.

The Line valid count should increase fast to 20 (the counter increase or decrease by one dependent on detection or not of a white area (white is about 80% or more of the calibrated white value). So 20 means that a line is detected in (at least) 20 ms.

One missed detection will decrease the count to 19, so a line valid test of maybe 15 should give a reliable measure of a valid line. But a value 15 will means the line has been present for at least 15ms.

White all the way to the left side of sensor yields -3 for the left edge, i.e. the robot (sensor) centerline is -3 cm to the left (3 cm to the right) of the left edge.

The right edge should show about 0, i.e. the robot center line is just above the right edge.

The part of the surface that is not the white line should have no more than 80% of the reflection of the white line (at the color of the LED).

Crossing detect

The crossing detect (Crossing det.) value is a value for how many and how fast the sensors sees an area with high reflection.

IR distance

The 2 distance sensors need calibration too.

Gui-ir-2.png

Figure 5. Calibration of the IR sensor.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox