By
Johan Soegiharto 11112003
BACHELOR’S DEGREE in
MECHANICAL ENGINEERING – MECHATRONICS CONCENTRATION FACULTY OF ENGINEERING AND INFORMATION TECHNOLOGY
SWISS GERMAN UNIVERSITY EduTown BSD City
Tangerang 15339 Indonesia
August 2016
Revision after Thesis Defense on 18th July 2016
Johan Soegiharto STATEMENT BY THE AUTHOR
I hereby declare that this submission is my own work and to the best of my knowledge, it contains no material previously published or written by another person, nor material which to a substantial extent has been accepted for the award of any other degree or diploma at any educational institution, except where due acknowledgement is made in the thesis.
Johan Soegiharto
____________________________________________
Student Date
Approved by:
Dr. Eka Budiarto, S.T, M.Sc.
____________________________________________
Thesis Advisor Date
Edward Boris P. Manurung, M.E.
____________________________________________
Thesis Co-Advisor Date
Dr. Ir. Gembong Baskoro, M.Sc.
____________________________________________
Dean Date
Johan Soegiharto ABSTRACT
DESIGNING AND CONSTRUCTING A CAR SIMULATOR CASE: ELECTRICAL AND MOTION CONTROL
By
Johan Soegiharto
Dr. Eka Budiarto, S.T, M.Sc., Advisor Edward Boris P. Manurung, M.E., Co-Advisor
SWISS GERMAN UNIVERISTY
The objective of this thesis is to design and build a safe electrical circuit design and a good motion control to add the realistic movement to the car simulator. PID Controller is used to control the movement of the DC wiper motor which is used in the simulator so the simulator can simulate in real time. The simulator can only simulate two rotational movements, roll movement and pitch movement since the simulator is a 2-DOF car simulator. The system received feedback signals from a potentiometer as position feedback. A VNH2SP30 is used as the motor shield to control the direction and speed of the motor. As the main microcontroller board, an Arduino Mega 2560 board is used which is based on the ATMega 2560. Firmata Communication Protocol is used in this project to send the data between Arduino and Qt.
Keywords: Car Simulator, 2-DOF Simulator, Electrical Engineering, PID Controller, VNH2SP30 Motor Shield.
Johan Soegiharto
© Copyright 2016 by Johan Soegiharto
All rights reserved
Johan Soegiharto DEDICATION
I dedicate this works to my Lord, Jesus Christ, My family, who have support me this whole time,
My friends and teachers who have help me, My country, Indonesia,
And to all car simulator researchers for their help and support throughout this thesis work
Johan Soegiharto ACKNOWLEDGEMENTS
The author would like to thank the Lord for all of His blessings and grace throughout the entire thesis work and the opportunity to do and finish the thesis.
The author would like to express his sincere thanks to his thesis advisor, Dr. Eka Budiarto, S.T, M.Sc and his thesis co-advisor, Edward Boris P. Manurung, M.E for all their guidance and advice throughout the process of the thesis. The author also want to thank to Dennis Adrian Tjahyadi, Nicolas Aditya and William Irawan to be his partner and give the author a lot of support, help, encouragement and knowledge.
The author also would like to thank to his beloved parents and family who always give the author support, help and encouragement to finish this thesis work during the entire time. In the end, the author also would like to thank to all of the lecturer, his colleagues in Mechatronics Batch 2012 and also to all of his best friends, Charles Logis, Ivan Surya, Kevin Susanto, Kevin Tirtaatmadja and Samuel Loanka for their encouragement and support all this time.
Johan Soegiharto TABLE OF CONTENTS
Page
STATEMENT BY THE AUTHOR ... 2
ABSTRACT ... 3
DEDICATION ... 5
ACKNOWLEDGEMENTS ... 6
TABLE OF CONTENTS ... 7
LIST OF FIGURES ... 10
LIST OF TABLES ... 13
CHAPTER 1 – INTRODUCTION ... 14
1.1 Thesis Background ... 14
1.2 Thesis Objectives... 15
1.3 Thesis Problems... 16
1.4 Thesis Scope ... 16
1.5 Thesis Limitations ... 16
1.6 Thesis Organization ... 17
CHAPTER 2 - LITERATURE REVIEW ... 18
2.1. Car Simulator ... 18
2.2 Car Motion... 18
2.3 H-Bridge ... 22
2.4 DC Motor... 23
2.5 DC Wiper Motor ... 24
2.6 PID Controller ... 24
2.7 Control System ... 27
2.8 Arduino (Software) ... 28
2.9 Arduino (Hardware) ... 29
2.10 Qt IDE ... 30
2.11 Firmata Protocol... 30
2.12 Dynamic Equation ... 31
Johan Soegiharto
CHAPTER 3 – RESEARCH METHODS ... 37
3.1 Materials and Equipment ... 37
3.1.1 System Design Overview ... 37
3.1.2 Mechanical Design ... 39
3.1.3 Electrical Design ... 40
3.1.3.1 DC Wiper Motor ... 41
3.1.3.2 Motor Shield ... 41
3.1.3.3 Microcontroller ... 43
3.1.3.4 PC ... 43
3.1.3.5 Monitor ... 44
3.1.3.6 Steering Wheel and Pedal ... 45
3.1.3.7 Power Supply 12V 20A ... 45
3.1.3.8 Fan 12V DC ... 46
3.1.3.9 Potentiometer ... 47
3.1.4 Software Design ... 48
3.1.5 Arduino Connection ... 49
3.1.6 Control Design ... 50
3.1.7 Trial and Error PID Tuning Method ... 54
3.1.8 Reading of Pitch and Roll Value ... 55
3.1.9 Control System ... 57
3.2 Analytical Method ... 58
CHAPTER 4 – RESULTS AND DISCUSSIONS ... 61
4.1 Initial Evaluation ... 61
4.1.1 Torque and PWM Analysis... 61
4.1.2 Motor Testing ... 63
4.1.3 Result of Electrical Connection ... 64
4.1.4 Qt Programming ... 65
4.1.5 Pitch Movement Testing ... 69
4.1.6 Roll Movement Testing ... 71
4.1.7 Maximum and Minimum Pitch and Roll Angles Testing ... 73
Johan Soegiharto
4.2.1 Testing Without PID ... 75
4.2.2 Testing With Kp=1 ... 75
4.2.3 Testing With Kp=5 ... 76
4.2.4 In-Game Testing ... 77
4.2.5 In-Game Error Analysis ... 84
CHAPTER 5 – CONCLUSIONS AND RECOMMENDATIONS ... 87
5.1 Conclusions ... 87
5.2 Recommendations ... 87
GLOSSARY ... 89
REFERENCES ... 90
APPENDICES ... 92
APPENDIX A – Datasheets ... 93
Arduino Mega 2560 ... 93
Motor Shield – VNH2SP30-E ... 99
APPENDIX B - Qt Programming ... 105
APPENDIX C - Bill of Material ... 114
CURRICULUM VITAE ... 115