Mark Yourself Question
An EV3 robot has wheels of diameter 80 mm, drive motors on ports B (left) and C (right), and a touch sensor on input port 1 mounted on its front bumper. Positive Speed drives the robot forward. Assume direct wheel drive, so one motor revolution produces one wheel revolution, and rolling without slip. Assume the matched drive motors produce straight forward motion at equal Speed settings. Use encoder readings to estimate travel distance.
Write a MATLAB script that:
State the encoder target you use and show how you obtained it. A short pause between unsuccessful polling passes is recommended. Account for polling and braking delay when explaining the stopping behavior.
Unlock full course notes by signing up
Wheel rotation for a spin turn
A differential-drive EV3 robot has a wheel diameter of 50 mm and a track width of 140 mm, measured between the wheel centres. To make a spin turn, the MATLAB program sets the left motor to Speed = 25 and the right motor to Speed = -25, so the robot rotates in place about the midpoint of its axle. How many degrees must each wheel rotate for the robot to turn through 60°? Assume no wheel slip.
Ordering a drive-to-wall script
You are writing a MATLAB script that drives a two-motor EV3 robot straight towards a wall, stops once the ultrasonic sensor reads less than 0.20 m, and then displays how far the robot travelled during this move only. Put the stages of the script in the order they must run.
Speed and arrival time from timed encoder readings
An EV3 robot with 56 mm diameter wheels is driving straight at a constant motor Speed. The script reset the encoder at the start of the move, then logged readRotation against toc while the robot drove:
The robot must stop after travelling 1.50 m from its starting point. Assume the wheels do not slip and the speed stays constant after 0.40 s. Find:
the wheel rotation rate in degrees per second, to the nearest whole number;
Keeping a proportional command in range
A robot should hold itself 0.25 m from a wall using an ultrasonic sensor. The sensor faces the wall and can report distances up to 2.55 m. Positive Speed drives both wheels toward the wall, and negative Speed drives them away. Both drive motors are already running, and this loop sets their speed commands:
Speed must lie between -100 and 100. When the program starts, the sensor reads 0.80 m. Which change keeps every command within the allowed range while preserving proportional, bidirectional behaviour near the target?