TigerJython4Kids
 robotics
loslegen
Deutsch   English   

1. GET STARTED

 

 

YOU LEARN HERE...

 

how to operate the mbRobot and create an initial robot program that you download to the robot and execute there.

 

 

RUN THE FIRST PROGRAM

 

You use the TigerJython development environment for program development. If it is not yet installed on your computer, you must first install it (download TigerJython).

Start TigerJython and enter the following program in the editor window:

from mbrobot import *

forward()
delay(2000)
stop()

With the first line you import the robotics library mbrobot. With the command forward() the robot is set to move forwards and remains in this state for 2000 milliseconds. With the command stop() he is stopped.

Connect the robot to your computer using a USB cable.  

Select Tools / Devices / micro:bit. The settings remain saved. You can view or change them at any time. To do this, click on the Settings button in the menu bar and select the tab Libraries.

 

 

  Click on the robotics button Download/Execute.

While the programme is running, a terminal window is displayed on your computer in which error messages from mbRobot are displayed.

You will now see a message ‘switch the robot on’. Unplug the USB cable from the micro:bit and flip the small switch on the back of the Maqueen chassis to ‘ON*. The robot will drive forwards a short distance.

 

  There is a reset button on the back of the micro:bit that can be used to run the last downloaded programme again. You can also switch the small switch to ‘OFF’ - and back to ‘ON’. The last programme will then be executed again.

If you do not need the robot for a longer period of time, you should switch off the power supply again (switch to ‘OFF’) so that the battery is not discharged unnecessarily.

If you are working with the Maqueen Plus or Maqueen Plus V2, you must import the mbrobot_plus or mbrobot_plusV2 library. The ON-OFF slider for the power supply of the motors can be found at the back of the Maqueen Plus and on the right side of the chassis of the Maqueen Plus V2

from mbrobot_plus import *

forward()
delay(2000)
stop()
 

 

SIMULATION MODE

 

Most programmes can also be run in simulation mode. You use the same programme, but click on the green run arrow instead of the robotics button to run it.

 

 

 

REMEMBER...

 

Enter the programme code in the TigerJython editor and click on the robot button to download the programme to the mbRobot. The micro:bit of the robot must be connected to your computer via the USB cable. You must switch on the power supply before running the program.

For the simulation, start the programme execution with the green arrow.

 

 

ADDITIVE: ROBOT CALIBRATION

 

What to do if the robot does not move in a straight line?
The disadvantage of low-cost robots is that they often lack precision. Some robots move exactly straight ahead when the forward() command is given, some tend to make a left turn, others a right turn. With the command
calibrate(offset, differential, arcScaling)
you can calibrate your robot more precisely. The calibrate() function requires three parameters, which are set to 0 by default.
offset (Range: (-10, 50)). Minimum power of the motors. Depending on the state of charge of the battery)
differential (Range: (-150, 150)). Controls the left or right twist. If the robot tends to move in a left-hand arc with the forward() command, you must select a negative value. If the robot tends to move in a right-hand arc when the forward() command is given, you must select a positive number.
arcScalling (Range: (-50, 50)). Calibrates the robot when travelling on a left or right arc (commands leftArc(radius) and rightArc(radius)) Positive value if the robot radius is too large, negative value if the robot radius is too small.

Example 1: Calibration when travelling straight ahead

Callibration with left-hand twist Callibration with right-hand twist
from mbrobot import *

calibrate(0, -15, 0)
forward()
delay(4000)
stop()
from mbrobot import *

calibrate(0, 20, 0)
forward()
delay(4000)
stop()

Example 2: Adjusting the radius for leftArc() and rightArc()

Callibration if the radius of the robot is greater than 20 cm
from mbrobot import *

calibrate(0, 0, 10)
leftArc(0.2)
delay(4000)
rightArc(0.2)
delay(4000)
stop()

You have to determine the size of the parameters for your robot by trial and error and the line calibrate() in all programmes in which you want to achieve more precise movement.

   

 


Warning: include(a/1-1.html): Failed to open stream: No such file or directory in /var/www/html/engl/robotik/mbrobot/loslegen.inc.php on line 229

Warning: include(): Failed opening 'a/1-1.html' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/html/engl/robotik/mbrobot/loslegen.inc.php on line 229