SlideShare a Scribd company logo
Serial Arm Control in Real Time
FURKAN GÜMÜŞ
İREM UZUN
YAĞIZ ERKAN
TOLGAHAN GERGİN
TÜLBİYA KARAHAN
ADEM BAYRAM
29.05.2024
MEE428 Real-Time Control Term Project
1
CONTROL MODEL
CONCEPT
CONCLUSIONS
ELECTRICAL
CONNECTION
2
4
1 3
5
USER INTERFACE
2
CONCEPT
1
• Develop a motion control system for a two degrees of
freedom serial arm
• Enable real-time adjustment of PID control parameters via
a specialized MATLAB GUI
• Visualize and verify the arm's motion using encoder
feedback
3
2 ELECTRICAL CONNECTION
4
• Data from the Arduino is unpacked and processed to calculate the position error. The PID controller
adjusts the motor's position based on this error, sending PWM signals to the motor. Encoder data is read
via interrupts and visualized in real-time, ensuring accurate position control.
CONTROL MODEL
3
5
6
Encoder Pulses to
Position Values
• This conversion represent the pulses to angles in degrees
360
131×16
16 pulse encoder x motor speed reduction with gearbox 131= 1 rotation
7
Inverse Interrupter
8
Data Transmitting
9
• Receiving Data: Arduino sends raw data to the
Simulink model
• Unpacking: The "Byte Unpack" block takes this
raw data and splits it into meaningful
components, such as position and sensor
readings. In this application creates data type
uint8 array.
• Processing: These components used for control
logic.
Byte Unpack
9
• Preparing Data:After processing and generating control signals (like PWM values), these signals
need to be sent back to the Arduino.
• Packing: The "Byte Pack" block takes the control signals and combines them into a single data
stream.
• Transmitting: This packed data is then transmitted to the Arduino, which uses it to adjust the
motor's position.
Byte Pack
10
Treshold logic for reducing error
• This treshold ensure that
controller does not start the
second motor if the first motor
motion occurs with an error
higher than 3 angle.
• This ensures energy efficiency
and reduce error.
11
PID Controller
• This block diagram represents a PID
controller. It processes the error signal
(difference between reference and actual
values) into three components:
proportional, integral, and derivative.
• To ensure the robot working stabilization
PWM values limited as 50/-50 instead of
255/-255
12
50
-50
Bidirectional Movement
13
• It provides bidirectional movement with a
DC motor with two encoders. This
movement means that the engines can
operate in both forward and reverse
directions. The block I use in Simulink
allows me to precisely control the direction
and speed of the motors. Thanks to the
feedback signals coming from the encoders,
it ensures that the motors work correctly
and reach the targeted positions.
14
USER INTERFACE
4
Visual Hierarchy
Simplicity
• Clear and uncluttered layout.
• Quick access to essential information.
Feedback
User-Centered Design
Easy input for joint angles and PID
parameters.
function UIAxes2ButtonDown(app, event)
coordinates = app.UIAxes2.CurrentPoint;
x = coordinates(1,1);
y = coordinates(1,2);
% Inverse Kinematics calculations
L1 = app.L1;
L2 = app.L2;
% Compute the inverse kinematics
cos_theta2 = (x^2 + y^2 - L1^2 - L2^2) / (2 * L1 * L2);
sin_theta2 = sqrt(1 - cos_theta2^2); % Taking the positive root
theta2 = atan2(sin_theta2, cos_theta2);
k1 = L1 + L2 * cos(theta2);
k2 = L2 * sin(theta2);
theta1 = atan2(y, x) - atan2(k2, k1);
% Convert to degrees for display
theta1_deg = rad2deg(theta1);
theta2_deg = rad2deg(theta2);
% Update the numeric edit fields
app.Ref1EditField.Value = num2str(theta1_deg);
app.Ref2EditField.Value =num2str(theta2_deg);
% Plot the arm on the UIAxes
cla(app.UIAxes2);
xLimit = L1 * 2; % Adjust as needed for scale
xlim(app.UIAxes2, [-xLimit xLimit]);
% Fixed y-axis limits
yLimit = L1 ; % Adjust as needed for scale
ylim(app.UIAxes2, [-yLimit yLimit]);
hold(app.UIAxes2, 'on');
grid(app.UIAxes2, 'on');
axis(app.UIAxes2, 'equal');
plot(app.UIAxes2, [0, L1*cos(theta1)], [0, L1*sin(theta1)], 'b', 'LineWidth', 2);
plot(app.UIAxes2, [L1*cos(theta1), x], [L1*sin(theta1), y], 'r', 'LineWidth', 2);
plot(app.UIAxes2, x, y, 'ko', 'MarkerFaceColor', 'k');
hold(app.UIAxes2, 'off');
Inverse Kinematic
• This function executes when the user
clicks on UIAxes2. It captures the click
coordinates, calculates the inverse
kinematics
15
% Button pushed function: startserialButton
function startserialButtonPushed(app, event)
% Configure the callback function to be called after reading 8 bytes
configureCallback(app.serialObj, "byte", 8, @(src, event)readSerialData(app, src, event));
app.logEditField.Value = "serial communication started";
setupTimer(app);
Serial Connection
• This function executes when the start serial button is pressed.
• It configures a callback function to be triggered after reading 8 bytes from the
serial port.
• It updates the log to display "serial communication started" and sets up a timer
to update the plot periodically.
16
OptiTrack Cameras
13
We utilized OptiTrack cameras to monitor the
end effector's real-time movements. These
cameras provided precise tracking of the end
effector's position, which was then visualized
in MATLAB. This allowed us to verify and
adjust the motion control system accurately,
ensuring the end effector followed the
desired path with high precision.
Thank you
for listening

More Related Content

PDF
Modified Chattering Free Sliding Mode Control of DC Motor
PDF
Optimal and pid controller for controlling camera’s position in unmanned aeri...
PDF
Optimal and Pid Controller for Controlling Camera's Position InUnmanned Aeria...
PDF
Paper id 24201493
PPTX
Unmanned Ground Vehicle
PDF
D0255033039
PPTX
Zagazig digital control introduction.pptx
PDF
F05613947
Modified Chattering Free Sliding Mode Control of DC Motor
Optimal and pid controller for controlling camera’s position in unmanned aeri...
Optimal and Pid Controller for Controlling Camera's Position InUnmanned Aeria...
Paper id 24201493
Unmanned Ground Vehicle
D0255033039
Zagazig digital control introduction.pptx
F05613947

Similar to Serial Arm Control in Real Time Presentation (20)

PDF
Development of Digital Controller for DC-DC Buck Converter
PDF
Design of Robust Speed Controller by Optimization Techniques for DTC IM Drive
PDF
An 706
PDF
Hill Top Braking System in Electronic Bikes
PDF
IRJET- Design & Development of Two-Wheeled Self Balancing Robot
PDF
Lecture 2
PDF
Rotor Resistance Adaptation Scheme Using Neural Learning Algorithm for a Fuzz...
PDF
Direct Digital Control
PDF
Robotic Catching Arm using Microcontroller
PDF
(11 16) rajiv g
PDF
Fuzzy logic speed control of three phase
PPTX
MAJOR PROJECT PROGRESS preparation .pptx
PDF
Welcome to International Journal of Engineering Research and Development (IJERD)
PPT
Tachometer using AT89S52 microcontroller with motor control
PPTX
Design, analysis and controlling of an offshore load transfer system Dimuthu ...
DOCX
Computer numerical controlled machine project
PDF
Internal Model Based Vector Control of Induction Motor
PDF
PID Controller based DC Motor Speed Control
PDF
motor-power-control.white pepper with PV and wind and Microgrid transfer cont...
PPT
rudder actuation system
Development of Digital Controller for DC-DC Buck Converter
Design of Robust Speed Controller by Optimization Techniques for DTC IM Drive
An 706
Hill Top Braking System in Electronic Bikes
IRJET- Design & Development of Two-Wheeled Self Balancing Robot
Lecture 2
Rotor Resistance Adaptation Scheme Using Neural Learning Algorithm for a Fuzz...
Direct Digital Control
Robotic Catching Arm using Microcontroller
(11 16) rajiv g
Fuzzy logic speed control of three phase
MAJOR PROJECT PROGRESS preparation .pptx
Welcome to International Journal of Engineering Research and Development (IJERD)
Tachometer using AT89S52 microcontroller with motor control
Design, analysis and controlling of an offshore load transfer system Dimuthu ...
Computer numerical controlled machine project
Internal Model Based Vector Control of Induction Motor
PID Controller based DC Motor Speed Control
motor-power-control.white pepper with PV and wind and Microgrid transfer cont...
rudder actuation system
Ad

Recently uploaded (20)

PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Approach and Philosophy of On baking technology
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PPTX
A Presentation on Artificial Intelligence
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
Getting Started with Data Integration: FME Form 101
PPTX
1. Introduction to Computer Programming.pptx
PPTX
TLE Review Electricity (Electricity).pptx
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Diabetes mellitus diagnosis method based random forest with bat algorithm
Approach and Philosophy of On baking technology
A comparative study of natural language inference in Swahili using monolingua...
Spectral efficient network and resource selection model in 5G networks
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
A Presentation on Artificial Intelligence
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
A comparative analysis of optical character recognition models for extracting...
Reach Out and Touch Someone: Haptics and Empathic Computing
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Univ-Connecticut-ChatGPT-Presentaion.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Per capita expenditure prediction using model stacking based on satellite ima...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Getting Started with Data Integration: FME Form 101
1. Introduction to Computer Programming.pptx
TLE Review Electricity (Electricity).pptx
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Ad

Serial Arm Control in Real Time Presentation

  • 1. Serial Arm Control in Real Time FURKAN GÜMÜŞ İREM UZUN YAĞIZ ERKAN TOLGAHAN GERGİN TÜLBİYA KARAHAN ADEM BAYRAM 29.05.2024 MEE428 Real-Time Control Term Project 1
  • 3. CONCEPT 1 • Develop a motion control system for a two degrees of freedom serial arm • Enable real-time adjustment of PID control parameters via a specialized MATLAB GUI • Visualize and verify the arm's motion using encoder feedback 3
  • 5. • Data from the Arduino is unpacked and processed to calculate the position error. The PID controller adjusts the motor's position based on this error, sending PWM signals to the motor. Encoder data is read via interrupts and visualized in real-time, ensuring accurate position control. CONTROL MODEL 3 5
  • 6. 6
  • 7. Encoder Pulses to Position Values • This conversion represent the pulses to angles in degrees 360 131×16 16 pulse encoder x motor speed reduction with gearbox 131= 1 rotation 7
  • 10. • Receiving Data: Arduino sends raw data to the Simulink model • Unpacking: The "Byte Unpack" block takes this raw data and splits it into meaningful components, such as position and sensor readings. In this application creates data type uint8 array. • Processing: These components used for control logic. Byte Unpack 9
  • 11. • Preparing Data:After processing and generating control signals (like PWM values), these signals need to be sent back to the Arduino. • Packing: The "Byte Pack" block takes the control signals and combines them into a single data stream. • Transmitting: This packed data is then transmitted to the Arduino, which uses it to adjust the motor's position. Byte Pack 10
  • 12. Treshold logic for reducing error • This treshold ensure that controller does not start the second motor if the first motor motion occurs with an error higher than 3 angle. • This ensures energy efficiency and reduce error. 11
  • 13. PID Controller • This block diagram represents a PID controller. It processes the error signal (difference between reference and actual values) into three components: proportional, integral, and derivative. • To ensure the robot working stabilization PWM values limited as 50/-50 instead of 255/-255 12 50 -50
  • 14. Bidirectional Movement 13 • It provides bidirectional movement with a DC motor with two encoders. This movement means that the engines can operate in both forward and reverse directions. The block I use in Simulink allows me to precisely control the direction and speed of the motors. Thanks to the feedback signals coming from the encoders, it ensures that the motors work correctly and reach the targeted positions.
  • 15. 14 USER INTERFACE 4 Visual Hierarchy Simplicity • Clear and uncluttered layout. • Quick access to essential information. Feedback User-Centered Design Easy input for joint angles and PID parameters.
  • 16. function UIAxes2ButtonDown(app, event) coordinates = app.UIAxes2.CurrentPoint; x = coordinates(1,1); y = coordinates(1,2); % Inverse Kinematics calculations L1 = app.L1; L2 = app.L2; % Compute the inverse kinematics cos_theta2 = (x^2 + y^2 - L1^2 - L2^2) / (2 * L1 * L2); sin_theta2 = sqrt(1 - cos_theta2^2); % Taking the positive root theta2 = atan2(sin_theta2, cos_theta2); k1 = L1 + L2 * cos(theta2); k2 = L2 * sin(theta2); theta1 = atan2(y, x) - atan2(k2, k1); % Convert to degrees for display theta1_deg = rad2deg(theta1); theta2_deg = rad2deg(theta2); % Update the numeric edit fields app.Ref1EditField.Value = num2str(theta1_deg); app.Ref2EditField.Value =num2str(theta2_deg); % Plot the arm on the UIAxes cla(app.UIAxes2); xLimit = L1 * 2; % Adjust as needed for scale xlim(app.UIAxes2, [-xLimit xLimit]); % Fixed y-axis limits yLimit = L1 ; % Adjust as needed for scale ylim(app.UIAxes2, [-yLimit yLimit]); hold(app.UIAxes2, 'on'); grid(app.UIAxes2, 'on'); axis(app.UIAxes2, 'equal'); plot(app.UIAxes2, [0, L1*cos(theta1)], [0, L1*sin(theta1)], 'b', 'LineWidth', 2); plot(app.UIAxes2, [L1*cos(theta1), x], [L1*sin(theta1), y], 'r', 'LineWidth', 2); plot(app.UIAxes2, x, y, 'ko', 'MarkerFaceColor', 'k'); hold(app.UIAxes2, 'off'); Inverse Kinematic • This function executes when the user clicks on UIAxes2. It captures the click coordinates, calculates the inverse kinematics 15
  • 17. % Button pushed function: startserialButton function startserialButtonPushed(app, event) % Configure the callback function to be called after reading 8 bytes configureCallback(app.serialObj, "byte", 8, @(src, event)readSerialData(app, src, event)); app.logEditField.Value = "serial communication started"; setupTimer(app); Serial Connection • This function executes when the start serial button is pressed. • It configures a callback function to be triggered after reading 8 bytes from the serial port. • It updates the log to display "serial communication started" and sets up a timer to update the plot periodically. 16
  • 18. OptiTrack Cameras 13 We utilized OptiTrack cameras to monitor the end effector's real-time movements. These cameras provided precise tracking of the end effector's position, which was then visualized in MATLAB. This allowed us to verify and adjust the motion control system accurately, ensuring the end effector followed the desired path with high precision.