This exercise is intended to help students to understand how to determine the impulse response sequence and the frequency characteristic of an ultrasonic sensor.
- Build a four-wheeled vehicle on rails with a sensor facing to the side.
- Determine the impulse response and the magnitude characteristic of the measuring arrangement. For this purpose, the vehicle drives along a vertical wall in front of which a vertical bar (about 5 mm thick) is standing halfway away from the vehicle.
- Display the impulse and magnetite characteristics graphically and discuss the result with respect to the spatial resolution of the sensor.
Solution
- First you have to build the vehicle according to the LEGO building instructions. The building instructions are in an LXF file which can be opened with the free LEGO Digital Designer software, which is available for Computers running macOS or Windows. After launching the software you can use the view menu to switch from the construction mode to the building instructions mode.
- Your MATLAB script creates connections to the motor and the sonic sensor, moves the vehicle in small steps and measures the distance and motor rotation. It then displays the distance along the course of the vehicle, calculates and displays the magnitude response. As you can see the sensor integrates over a relatively large area and therefore smooths the result. See the LEGO Developer Kit for the specs of the sensor.
LEGO building instructions and MATLAB script to run the experiment
Download the building instructions and MATLAB script. The LXF file contains the building instructions to be used with the free LEGO Digital Designer software available for macOS and Windows.