How to "calibrate" a micro:bot?

Greetings!

A shiny new micro:bot showed up under the Christmas Tree this year - to the delight of both my granddaughters and myself!

for the time being, I am playing with it so that I can understand how to make it do what it does, so that I can explain it to the girls.

Toward that end, I wrote a small program that does the following:

  • - Set both motors to non-invert mode. (I verified that "forward" was indeed "forward" when built.)
  • - Turn both motors "off" (just in case!)
  • - Set both motors to "forward" as speed "50"
  • - Turn both motors "on"
  • - Pause for one second to allow the device to go somewhere
  • - Turn both motors "off"
  • - Set one motor to reverse, the other forward, speed "50" (this causes it to turn in-place)
  • - Turn both motors "on"
  • - Pause for [insert time here] to allow the turn to take place.
  • - Turn both motors "off" (to end the turn)
  • - Set both motors to "forward" at speed "50"
  • - Pause for one second so the 'bot can move.
  • - Turn both motors off.
  • The idea of this being to have the motor move forward, turn in place 180 degrees, and come back to the point of origin.

    Obviously, the radial amount of the turn in degrees depends on the value of “insert time here” as well as the speed the motors are set to. Equally obvious, the exact radial degree of turn is derived by experiment, sticking one value in, trying it, sticking another value in, trying that, until the exact radial is found.

    “It is also intuitively obvious”, (as my Calculus professor used to say), that for any figure more complicated than a line, determining the timing for each and every turn is a non-trivial exercise.

    Question:

    Has anyone every tried to make some kind of “calibration chart” or “calibration curve” for the micro:bot so that someone like myself - trying to make the 'bot do something other than follow a line - can start the experimentation process with values that are reasonably close?

    I am assuming it would be some kind of nomograph relating speed, time, and (possibly) battery voltage.

    Jim “JR”

    In principle, you could use the compass on the micro:bit to determine the heading relative to magnetic North. IF (big if) the compass is properly calibrated, reasonably accurate turns can be judged from the change in heading.

    I know nothing about using the micro:bit but perhaps there is a forum or web page that will teach you how to use the compass.

    General overview and tutorial on compass calibration here: https://thecavepearlproject.org/2015/05 … r-arduino/

    Note: any magnetic or iron containing materials, as well as current carrying wires near the compass will distort the Earth’s magnetic field, and so calibration must be performed in place. In some cases, calibration may not even be possible due to such environmental interference.

    See https://support.microbit.org/support/so … ll-screen-