PHYS 351 LAB 4
Motor Control with Raspberry Pi and IRL510
© Ran Yang, Ph.D.
SUBMISSION
Submit the completed lab report as a PDF on Gradescope.
Due: 2:00 p.m. next Monday.
Introduction
In this lab, you will use the Raspberry Pi’s GPIO pins for motor control. Because the Raspberry Pi has limited current-output capacity, you will use a separate power supply and an IRL510 MOSFET to control a DC motor. This experiment develops your understanding of PWM signals, motor-control circuits, and rotation-rate measurement techniques.
Tasks
- Setting Up the Environment and PWM Analysis:
- Create a dedicated folder in the terminal for your programs and screenshots. (Note: This should be standard practice for every lab session.)
- Connect GPIO pin 12 to the oscilloscope.
- Develop a Python program to generate a range of PWM signals.
- Analyze the range of validity for the PWM output. Determine for which frequency and duty cycle values it functions as expected.
- Document your findings, including oscilloscope screenshots for various PWM settings.
TASK APPROVAL
Task 1 (PWM Analysis)
Course Instructor or TA Signature:
Date and Time:
- Motor Control Circuit with IRL510:
- Carefully review the datasheet of the IRL510 MOSFET.
- Identify and document the device pinout.
- Design and construct a circuit on the breadboard using:
- One IRL510 chip
- A DC motor
- A +5 V power supply. Do not use the Raspberry Pi as the motor power source.
- Before powering on the motor, have the course instructor or a TA verify your circuit.
- If the motor fails to rotate, troubleshoot the issue independently before seeking assistance.
TASK APPROVAL
Task 2 (IRL510 Motor Control)
Course Instructor or TA Signature:
Date and Time:
- Integrating Raspberry Pi Control:
- Disconnect the +5 V gate-voltage supply from the IRL510.
- Connect GPIO pin 12 to the gate pin of the IRL510.
- Modify your Python code to enable control of the motor’s rotation speed using PWM signals.
- Demonstrate variable speed control of the motor using your Raspberry Pi.
TASK APPROVAL
Task 3 (Raspberry Pi Integration)
Course Instructor or TA Signature:
Date and Time:
- Motor Rotation Rate Measurement and Analysis:
- Design and implement a detection system to measure the motor’s rotation rate. (Hint: Consider using an LED and a photodiode for this purpose.)
- Create a comprehensive table displaying the relationship between duty cycle and RPM. Include at least 10 data points.
- Plot RPM versus duty cycle using your collected data.
- Derive a mathematical formula to calculate RPM from the duty cycle.
- Critically analyze and discuss the accuracy of your measurements, considering potential sources of error and limitations of your setup.
TASK APPROVAL
Task 4 (Rotation-Rate Analysis)
Course Instructor or TA Signature:
Date and Time:
Closing Tasks
- Transfer all files, including programs, data, and documentation, from the Raspberry Pi to your laptop.
- Ensure you properly power off the Raspberry Pi.
- Review your collected data and begin drafting your lab report, ensuring all required elements are included.
Submission Reminder
- Oscilloscope screenshots of your PWM signals and the documented range of valid frequency and duty-cycle settings.
- The IRL510 datasheet pinout and your motor-control circuit schematic.
- Your complete, commented Python scripts for PWM generation and motor-speed control.
- The duty-cycle-vs-RPM table (at least 10 data points), the corresponding plot, and your derived RPM formula.
- A discussion of the accuracy of your measurements and potential sources of error.
- A discussion of any challenges encountered and how you overcame them.