Note that the range of ultrasonic sensor is 3 255 cm Figure 2 Layout of the

Note that the range of ultrasonic sensor is 3 255 cm

This preview shows page 3 - 7 out of 11 pages.

the ultrasonic sensor, change the distance using the ground bricks in the lab. Note that the range of ultrasonic sensor is [3, 255] cm. Figure 2. Layout of the distance measurement using an ultrasonic sensor. 3. Based on the above information, read the ultrasonic sensor reading using the Port View on the EV3 and fill in Table II. Table II. Record of distance measurements. Distance ( d , cm) Sensor Reading First Measurement Second Measurement Third Measurement Average
Image of page 3
ECE 456/556 Mechatronics Sensor Lab Question Task TA Timed Exercise Page 4/11 0 30 60 90 120 150 180 210 240 Use Table II to answer the following questions 1. Use the average of three measurements plot the distance vs. sensor reading graph using MATLAB. (Include the graph in the lab report) 2. Full range of the object distance = ___________. Full range of the sensor reading = __________. 3. Use the polyfit and polyval functions in Matlab to determine the best linear (i.e. n = 1 in polyfit ) approximation for intensity vs. output voltage plot and determine the non-linearity at d = 60. Non-Linearity error (at d = 60) = ____________________ 4. Calculate the sensitivity of the ultrasonic sensor at each distance range. Distance ( d ) Sensitivity 0 -30 30-60 60-90 90-120 120-150 150-180 180-210 210-240 5. Based ONLY on your answer to question 4, how can you justify that the ultrasonic sensor is linear or non-linear.
Image of page 4
ECE 456/556 Mechatronics Sensor Lab Question Task TA Timed Exercise Page 5/11 Task 3: Build the MATLAB Simulink block to control EV3 Simulink ® Support Package for LEGO ® MINDSTORMS ® EV3 Hardware lets you program and run algorithms on LEGO MINDSTORMS EV3 robots. The support package includes a library of Simulink blocks for configuring and accessing the robot’s sensors, actuators, and communication interfaces. To build your own MATLAB Simulink module to control the EV3, you need to finish the following steps: 1. To install the useful MATLAB support package, open MATLAB/Apps/Get More Apps, as depicted in Figure 3. Figure 3. Open MATLAB Simulink Add-On Explorer. 2. Install “MATLAB Support Package for LEGO MINDSTORMS EV3 Hardware” and “Simulink Support Package for LEGO MINDSTORMS EV3 Hardware”. 3. Open MATLAB Simulink. 4. Open “Library Browser ” and search for “Simulink Support Package for LEGO MINDSTORMS EV3 Hardware”. 5. Drag “Color Sensor” block and “Display” block to Simulink, and connect together as Figure 4 shows. Figure 4. Color sensor control in MATLAB Simulink. Set Color sensor block in MATLAB Simulink:
Image of page 5
ECE 456/556 Mechatronics Sensor Lab Question Task TA Timed Exercise Page 6/11 6. Double click on the color sensor block and set the input port as the port you connect the color sensor with the EV3.
Image of page 6
Image of page 7

You've reached the end of your free preview.

Want to read all 11 pages?

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture