ME 142 Fall 2023 Lab 10 MESAbox 4 Simulink

docx

School

University of California, Merced *

*We aren’t endorsed by this school

Course

135

Subject

Mechanical Engineering

Date

Jan 9, 2024

Type

docx

Pages

4

Report

Uploaded by KidOxide16025

ME 142 Fall 2023 1 ME 142 Lab 10: MESABOX 4-Simulink Maximo Zendejas Introduction: In this lab a plant will be constructed like Lab 09 with a Motorized Linear Potentiometer replacing the original motor. In the first part of the lab a plant will be developed to drive the linear motor forwards and backwards through a pulse generator. The motion of the motor will then be graphed. Afterwards the plant will be modified to run the motor based on sin wave frequency. The new plant will then be used to monitor the motors’ dead zones which will be analyzed and graphed. In the next part of the lab an equation will be constructed to work around the range of the motor’s dead zones. For the final part of the lab the input and output relationship will be analyzed and compared to the frequency sweep of a previous lab where a bode plot will be constructed. The bandwidth of the system is then checked and compared at a frequency of 100hz where the behavior of the control system will be determined. Summary of learning outcomes 1. Construct plant with a linear motor and graph the pulse movement and analyze its dead zones. 2. Design a system to ignore the motors dead zones. 3. Analyze the input and outputs of the plant and compare the system to one made in a previous lab. Part1: Liner Potentiometer and Dead Zones A Motorized Linear Potentiometer is a belt driven motor that moves a slide back and forth on a rail. The component has two potentiometers with a total resistance of 10K ohms each. With the potentiometer servo feedback can be used to monitor the position of the slider on the rail and with the information it can be used to help control the movement of the slider. The circuit was assembled using the motorized linear potentiometer, Red Arduino Board, and the Motor Sheild. The motor shield was placed on top of the Arduino board making sure the pins aligned properly. The linear potentiometers have five wires that are attached to the motor, sensor and its power source. First the two wires for the motor are attached to the servo ports. Then there are three wires left, two at the top of the rail and one at the bottom. One wire at the top and the bottom of the rail are the ground and voltage which are then placed to the correct pins. While the last pin is a sensor pin that is placed on the Analog A4 pin. The finished circuit can be seen below.
ME 142 Spring 2022 2 Figure 1: Motorized Linear Potentiometer System Once the circuit was constructed then the Simulink model was created. Which can the seen below. Figure 2: Motorized Linear Potentiometer System The model has three separate systems that correlate to one another. The first system starts with a pulse generator block connected to saturation block which creates an upper and lower limit. The pulse is then transferred to the frequency block for pin 3 which in this case is one of two wires connected to the servo motor. The next system a has a square wave generator connected to a switch block which was connected to the constant i. Then two constant blocks with values of one and zero are connected to each side of the switch with the end of the switch connecting then to an output block at Pin 2. The last system for the model starts with an input block for the A4 pin connecting to a gain with a value of one tenth to adjust the sensor values to the correct units which is then connected to a display block to show the value of output A4. Additional two workspace blocks were added to the model, one block was attached between the saturation block and the output block. The workspace block was labeled inputData1, and the other block was placed in between the gain block and the display block, with the workspace block being labeled Position1. Lastly a scope block was added with two inputs that were then attached to the same spots as the two workspace blocks. The system operates by having the square wave function power into a switch with constants zero and one which then powers the motor. The values of the switch are what cause the motor to go back and forth. Then a pulse is added to a separate system with saturation block with an upper and lower limit of 0 and 225 which are the limited values for the potentiometer in the linear motor. This system controls the speed the motor is running. The last system for the A4 takes the sensor the data and with the to workspace block records the data to MATLAB. The second block also records the data of the pulse. The values of both the position and pulse can be seen in the graph below.
ME 142 Spring 2022 3 Figure 3: Pulse Graph Because the sample time is only 0.01 seconds the movement of the motor can’t be seen but the pulse can be seen in yellow jumping up in value to 255 and back down to zero. The lack of movement of the motor can also be because of issues with damage to the motor or errors in the soldering of the wires. However, a video of the motor running properly can be seen in the reference section. Sin Wave Model Another way to create the same outcome is to use a sin wave block which doesn’t need a pule generator or a square have generator. The model can be seen below. Figure 4: Pulse Graph The system is similar to the pulse model, however the pulse and the generate square wave blocks are removed and replaced with a Sin wave block which is placed where the pulse box used to be. In between sin wave and saturated block, a new block is added which is the absolute value constant block. Afterwards the i constant input of the switch is connected in between the sine and absolute value block. Because the sin wave oscillates and has negative and positive values it’s easy to have the switch operate for the slider by changing directions when the wave changed its value. Then the sin value is turned completely positive through the absolute value block since that system controls the speed of the motor so it would not operate under negative values. Dead Zones: Dead Zones are input value where the motor doesn’t respond properly due to a lack of power that is being received from the breadboard to the motor. To monitor the dead zone the frequency from the sine wave was continuously reduced until the slider was barely moving due to the reduced motor speed which produced the graph below from the scope. Figure 5: Dead Zone Graph It’s rather difficult to tell where the dead zones are but from the graph it does seem to be symmetrical. However, that may be errors from the motor or simply the set up of the Simulink model. Part 2: Eliminate Dead-Zone To eliminate the dead zones, changes were made to the Simulink model. The sin wave was changed to a ramp and the absolute value block was replaced with a MATLAB function. Additionally, the i constant port was moved after the MATLAB block. And the input date block and one of the scope inputs was moved in between the ramp block and the MATLAB block.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
ME 142 Spring 2022 4 Figure 6: Pulse Graph Through these adjustments the slider moved slower in speed and gradually increased it. By having the MATLAB function which contains if else statements it prevented the system from running at dead zones inputs that were determined at the previous part of the lab. However, since the dead zones values aren’t completely accurate the slider didn’t run smoothly and there are likely dead zone values that are being run. Part 3: Input and Output relations To start the analyzing the input and output response from the system. First the system was set up in the sine wave arrangement in Figure 4 but the sine wave block was changed to a chip one. However due the issue with the linear motor and or the arrangement of the Simulink model a bode plot couldn’t be constructed along with the band width of the model. But if the bandwidth of the system was lower than the sample then that would mean the system is running properly and if the system was higher than it would imply that changes and adjustments to the system would need to be made. Conclusions In this lab a Motorized Linear Potentiometer was used and implemented in various Simulink models. Using the Simulink model, the dead zones of the motor were determined. However, due to constraints on the equipment and or errors in the Simulink models themselves the bode plot and the bandwidth couldn’t be constructed. Reference 1. ME142 Fall23 lab 010.pptx 2. RedBoard_SIK_3.2.pdf 3. MESAbox Part List.pdf 4. www.tinkercad.com 5. https://drive.google.com/file/d/1IEq5koG wNnHbGoSGYKuISQ1Hbt9m0W5l/vie w?usp=sharing