Podcast
Questions and Answers
What is the primary function of the mCore board in the mBot?
What is the primary function of the mCore board in the mBot?
- Controlling the robot's movement wirelessly.
- Driving the motors directly.
- Providing power to the ultrasonic sensor.
- Serving as the main controller, connecting, programming, and controlling all components. (correct)
If the mBot's left motor is connected to M2 and the right motor to M1, and you set both motor values to 255, what is the robot's likely behavior?
If the mBot's left motor is connected to M2 and the right motor to M1, and you set both motor values to 255, what is the robot's likely behavior?
- Move backwards instead of forwards. (correct)
- The robot will not move.
- Move forward at normal speed.
- Turn left.
In the basic obstacle avoidance pseudocode, what is the condition that triggers the robot to turn?
In the basic obstacle avoidance pseudocode, what is the condition that triggers the robot to turn?
- When the ultrasonic sensor detects a distance greater than 20 cm.
- After the robot has moved forward for a set amount of time.
- When the ultrasonic sensor detects a distance less than 15 cm. (correct)
- When the button on the mCore board is pressed twice.
Which of the following pseudocode snippets will cause the mBot to rotate left?
Which of the following pseudocode snippets will cause the mBot to rotate left?
What values does the Line Follower sensor return?
What values does the Line Follower sensor return?
What is the purpose of setting one motor faster than the other, while remaining positive?
What is the purpose of setting one motor faster than the other, while remaining positive?
Why is it recommended to add a small delay after setting motor speeds in mBot programs?
Why is it recommended to add a small delay after setting motor speeds in mBot programs?
What does the ultrasonic sensor measure?
What does the ultrasonic sensor measure?
What is indicated when both of the mBot's LEDs light up green on the mCore board?
What is indicated when both of the mBot's LEDs light up green on the mCore board?
Which component is used to mount other components together?
Which component is used to mount other components together?
How can the mBot be programmed to follow a white line instead of a black line using the line-follower sensor?
How can the mBot be programmed to follow a white line instead of a black line using the line-follower sensor?
In the advanced obstacle avoidance strategy, what is the mBot programmed to do if it detects obstacles in the front, left and right directions?
In the advanced obstacle avoidance strategy, what is the mBot programmed to do if it detects obstacles in the front, left and right directions?
What is the maximum value the light sensor can return?
What is the maximum value the light sensor can return?
Typically, what is the minimum distance the ultrasonic sensor can accurately measure?
Typically, what is the minimum distance the ultrasonic sensor can accurately measure?
Which of the following components is used to upload programs and charge the mBot?
Which of the following components is used to upload programs and charge the mBot?
What is the function of the mini wheel on the mBot?
What is the function of the mini wheel on the mBot?
What is the purpose of the RJ25 cable?
What is the purpose of the RJ25 cable?
What might cause inconsistencies with the angle achieved on a turn?
What might cause inconsistencies with the angle achieved on a turn?
When mapping light brightness to speed, what formula is used?
When mapping light brightness to speed, what formula is used?
How is the Ultrasonic sensor connected to the mCore board?
How is the Ultrasonic sensor connected to the mCore board?
AA Batteries are connected to which electrical component?
AA Batteries are connected to which electrical component?
What is the metal frame that holds the mBot components together?
What is the metal frame that holds the mBot components together?
What is the default line following functionality?
What is the default line following functionality?
What needs to happen to the speed of both motors for the robot to stop moving?
What needs to happen to the speed of both motors for the robot to stop moving?
If both line-follower sensors read black, which direction will the robot move?
If both line-follower sensors read black, which direction will the robot move?
What does the infrared remote controller allow?
What does the infrared remote controller allow?
In the advanced obstacle avoidance code, the variables x and y combine to achieve what?
In the advanced obstacle avoidance code, the variables x and y combine to achieve what?
Which of the following is not part of the mBot kit?
Which of the following is not part of the mBot kit?
What is the motor speed maximum?
What is the motor speed maximum?
What is the purpose of the velcro sticker pad?
What is the purpose of the velcro sticker pad?
If the left sensor sees black and the right sensor sees white, which direction will the mBot curve?
If the left sensor sees black and the right sensor sees white, which direction will the mBot curve?
What does 'rotating' a robot mean?
What does 'rotating' a robot mean?
How is the robot's speed controlled in brighter and darker environments?
How is the robot's speed controlled in brighter and darker environments?
What type of values does the ultrasonic sensor return?
What type of values does the ultrasonic sensor return?
Why is it recommended to install the program on mCore board via USB?
Why is it recommended to install the program on mCore board via USB?
How does a small free-rolling wheel help the robot?
How does a small free-rolling wheel help the robot?
Flashcards
Mainboard mCore
Mainboard mCore
Main controller board; programmable, connects and controls all components.
Ultrasonic Sensor
Ultrasonic Sensor
Measures distance to obstacles using sound waves.
Line-follower Sensor
Line-follower Sensor
Detects line contrast to follow black or white tracks.
Motors (2)
Motors (2)
Signup and view all the flashcards
RJ25 Cable (2)
RJ25 Cable (2)
Signup and view all the flashcards
USB Cable
USB Cable
Signup and view all the flashcards
Infrared Remote Controller
Infrared Remote Controller
Signup and view all the flashcards
AA Battery Holder
AA Battery Holder
Signup and view all the flashcards
Chassis
Chassis
Signup and view all the flashcards
Mini Wheel
Mini Wheel
Signup and view all the flashcards
Wheel (2)
Wheel (2)
Signup and view all the flashcards
Screwdriver
Screwdriver
Signup and view all the flashcards
M4*25mm Brass Stud (4)
M4*25mm Brass Stud (4)
Signup and view all the flashcards
M3*25mm Screw (6)
M3*25mm Screw (6)
Signup and view all the flashcards
M2.2*9mm Self-drilling Screw (4)
M2.2*9mm Self-drilling Screw (4)
Signup and view all the flashcards
M3 Nut (8)
M3 Nut (8)
Signup and view all the flashcards
Line-follower Map
Line-follower Map
Signup and view all the flashcards
Velcro sticker pad (2)
Velcro sticker pad (2)
Signup and view all the flashcards
Mini Screwdriver
Mini Screwdriver
Signup and view all the flashcards
Go Forward
Go Forward
Signup and view all the flashcards
Go Backwards
Go Backwards
Signup and view all the flashcards
Stop Moving
Stop Moving
Signup and view all the flashcards
Turn Left
Turn Left
Signup and view all the flashcards
Rotate
Rotate
Signup and view all the flashcards
Curve
Curve
Signup and view all the flashcards
Light Sensor
Light Sensor
Signup and view all the flashcards
Ultrasonic Sensor
Ultrasonic Sensor
Signup and view all the flashcards
Obstacle avoidance
Obstacle avoidance
Signup and view all the flashcards
Line-Follower Sensor
Line-Follower Sensor
Signup and view all the flashcards
Study Notes
Components
- Complete parts list is included in the mBot kit.
Electrical Components
- Mainboard mCore is the primary programmable controller, connecting and managing all components.
- Ultrasonic Sensor measures distance using sound waves.
- Line-follower Sensor detects line contrast for black or white tracks.
- Motor (2) drives the mBot's wheels for movement.
- RJ25 Cable (2) connects sensors and modules to the mCore.
- USB Cable is for uploading programs and charging the mBot.
- Infrared Remote Controller allows wireless control.
- AA Battery Holder powers the mBot with AA batteries.
Mechanical Components
- Chassis provides the frame which holds all components.
- Mini Wheel stabilizes the robot with a small, free-rolling design.
- Wheel (2) are the main wheels that connects to the motors for movement.
- Screwdriver assembles and disassembles mBot parts.
- M4*25mm Brass Stud (4) are used as brass spacers to mount components.
- M3*25mm Screw (6) fastens parts together.
- M4*8mm Screw (15) are for general assembly purposes.
- M2.2*9mm Self-drilling Screw (4) mounts motors or plastic parts.
- M3 Nut (8) secures M3 screws in place.
- Line-follower Map is a pre-printed track to test the line-following function.
- Velcro sticker pad (2) helps attach components.
- Mini Screwdriver is a small tool to do fine adjustments.
Movement
- mBot utilizes two motors connected to M1 and M2 ports on the mCore board.
- The left motor connects to M1, while the right motor connects to M2.
- Incorrect motor connections invert movements if motor values are set to 255.
- Setting both motors to 255 is the fastest forward speed.
- Setting them both to -255 is the fastest backward speed.
- Setting them both to 0 makes the robot stop.
Movement Pseudocode
- Go Forward: set M1 speed to 255, set M2 speed to 255.
- Go Backward: set M1 speed to -255, set M2 speed to -255.
- Stop: set M1 speed to 0, set M2 speed to 0.
- Turn Left: set M1 speed to 0, set M2 speed to 255, invert logic to turn right.
- Rotate Left: set M1 speed to -255, set M2 speed to 255.
- Rotate Right: set M1 speed to 255, set M2 speed to -255.
- Curve Left: set M1 speed to 100, set M2 speed to 200.
- Curve Right: set M1 speed to 200, set M2 speed to 100.
- Add a delay after setting motor speeds and then set motors to 0 with a short delay (0.1 seconds) for consistent results.
Light Sensor Applications
- The light sensor is integrated into the mCore board and is not connected through motor or sensor ports.
- Measures light brightness from 0 (minimum) to 1023 (maximum).
- Maximum motor speed is 255.
- Brightness to speed mapping: speed = light / 4
- Allows the robot to move faster in brighter environments and slower in darker ones.
Ultrasonic Sensor
- The ultrasonic sensor connects to port 3 on the mCore board using an RJ25 cable.
- The sensor measures distances from 3 cm to 400 cm, in whole number values.
- Values below 3 cm distances are unreliable due to the sensor's physical placement on the chassis.
Obstacle Avoidance
- Ultrasonic sensor's primary function is obstacle avoidance.
- Pressing the button on the mCore board activates a pre-developed obstacle avoidance mode.
- Two green LEDs light up on the mCore board when active.
Basic Obstacle Avoidance Version
- The robot moves forward if the ultrasonic sensor detects a distance greater than a defined threshold (10 cm to 20 cm).
- It turns left or right briefly if the distance drops below the threshold.
Basic Obstacle Avoidance Pseudocode
- Repeat forever: move forward; wait until distance is less than 15; turn left or right 90 degrees; delay.
Advanced Obstacle Avoidance Version
- Checks left and right of robot for a clear path.
- If its a dead end the robot turns all the way back.
- Every time the robot faces an obstacle it checks in three directions: front, left, and right, or front, right, left.
- The robot picks one of the two approaches randomly, or if all three directions are blocked, it then turns around and goes back.
Advanced Obstacle Avoidance Pseudocode
- The code placed in the "else" statement is symmetrical to the first half.
- If rotation to the left 90 degrees, then right 180 degrees, then right 90 degrees, the robot instead will rotate right 90 degrees, then left 180 degrees, then left 90 degrees every time the robot is facing a wall or obstacle.
Factors Affecting Rotation
- Combined values of x and y result in rotation.
- Battery type, battery charge level, ground surface, dirt on wheels, and improperly fixed motors/wheels can influence the achieved angle.
- Developing the program in a computer system, installing it on the mCore board via USB, and adjusting parameters like x and y can remove runtime inconsistencies.
Line-Follower Sensor
- The line-follower sensor mounts under the front of the mBot.
- Connects to port 2 on the mCore board with an RJ25 cable.
- It has two detectors: left and right, and is designed to follow a black line on a white surface.
- Pressing the mCore button twice activates the pre-developed black line following mode.
- Two blue LEDs light up when active and obstacle avoidance is active.
- The logic can be inverted to follow a white line on a black surface.
- Returns four values:
- 0: Both sensors see black
- 1: Left sensor sees black, right sees white
- 2: Left sensor sees white, right sees black
- 3: Both sensors see white
Black Line Following Pseudocode
- Initiate lastCurve = 0
- Loop (forever)
- Read sensor value from line
- If the sensor detects 0 (black) then move forward
- Else if the sensor detects one (left)
- Curve left
- Then set the last curve to the left, else if the sensor detects two (right)
- Curve right
- Then set the last curve right - Else if the censor detects three go backwards.
Line Following Logic
- In sharper turns the robot may exit the line.
- It is essential to come up with a technique for the robot to follow the black line again.
- Make the mBot turn instead of curving in the same direction it was curving last until it can find the line.
- To follow a white line, invert the logic: move forward when the value is 3, and adjust accordingly.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.