Küre üzerinde dengede durabilen robot tasarımı
Design of a robot balancing on a sphere
Yazar: AVNİ HİLMİ PAZARBAŞI
Danışman: PROF. DR. MÜŞTAK ERHAN YALÇIN
İstanbul Teknik Üniversitesi / Fen Bilimleri Enstitüsü / Mekatronik Mühendisliği Ana Bilim Dalı / Mekatronik Mühendisliği Bilim Dalı
Derece: Yüksek Lisans, 2020
Konu: Bilgisayar Mühendisliği Bilimleri-Bilgisayar ve Kontrol = Computer Engineering and Computer Science and Control ; Mekatronik Mühendisliği = Mechatronics Engineering
Dizin: Akım kontrolü =   ; Doğrusal kontrol = Linear control ; Doğrusal olmayan kontrol = Nonlinear control ; Elektromekanik = Electromechanic ; Geri beslemeli kontrol = Feedback control ; Kaskad kontrol = Cascade control ; Motor kontrol = Motor control

Özet:
Bu tez çalışması kapsamında; bulunduğu yer düzleminde bulunan serbest bir kürenin
istenilen konuma hareketini ve bu küre üzerindeki gövdenin denge ve yönelimini
sağlayan mekanizmanın, elektronik kartların ve kontrolcülerin geliştirilme süreçleri
ile tasarım doğrulama çalışmaları anlatılmıştır. Çalışma kapsamında birbirlerine eşit
mesafede bulunan, gövdeye bağlı sabit üç motor ve çok yönlü teker tahrikiyle
dengesini ve hareketini sağlayan mekanizmanın, tasarımsal geliştirme süreçleri
açıklanmış, Langrange denklemleriyle hareket denklemlerinin eldesinden
bahsedilmiştir. Hareket denklemlerinin eldesinin ardından robotun dengede durmasını
ve istenilen bir konuma yönlendirilmesini sağlayan iki farklı kontrolcü geliştirilmiştir.
Geliştirilen LQR (Linear Quadratic Regulator) ve LQG (Linear Quadratic Gaussian)
kontrolcülerin test giriş işaretlerine verdiği yanıtlar bozucu etki yokken ve bozucu etki
varken incelenmiş ve sonuçlar yorumlanmıştır. LQR ve LGQ kontrolcülerin çıkışı olan
motor tork işaretlerini uygulamak üzere doğru akım motorları için tork kontrolcüsü
benzetim ortamında geliştirilmiştir. Robotun dengede durmasını sağlayacak
kontrolcünün koşacağı ve anakart işlevi gören devre ile anakartan gelen referans tork
işaretlerinin motorlar tarafından uygulanmasını sağlayan sürücü kartların; devrelerinin
ve baskı devre plakalarının tasarlanması-geliştirilmesi anlatılmış, algılayıcı ve eyleyici
seçimleri yapılmıştır. Tasarım çalışmasının tamamlanmasının ardından, tasarım
doğrulama çalışmasına geçilmiştir. Robot gövdesinin mekanik tasarımında motorlar
dışında hareketli parça bulunmaması sebebiyle gövdenin mekanik montajının dijital
tasarım ortamında yapılması yeterli görülmüştür. Elektronik tasarımı yapılan anakart
ve sürücü kartlar üretilmiş ve işlevselliği test edilmiştir. Anakartın çıktısı sürücü karta
iletilecek olan motor tork kontrol işaretidir ancak sürücü kartların çıktısı doğrudan
motorlara uygulanacak elektriksel sinyallerdir. Dolayısı ile doğrulama çalışmaları
kapsamında kartlar arasındaki haberleşmelerin yapılabildiği ve sürücü kartın motor
tork kontrolü yapabildiği gösterilmiştir. Bu amaçla bir test alyapısı oluşturulmuştur.
Motor sürücü kart debug modda çalıştırılmış ve sürekli olarak yazmaçlarındaki
değerler takip edilmiştir. Bununla beraber motor sürücü kartın haberleşme
çıkışlarından biri sayesinde tork referans değeri ve sürekli olarak motorun çektiği
akımın ölçülmesi ile hesaplanan motor tarafından uygulanan tork değeri bilgisayar
ortamına aktarılmıştır. Motor sürücü karttan çıkan bilgi bir FTDI dönüştürücü ile bir
bilgisayarın USB portu vasıtasıyla bir terminal programına aktarılmıştır. Toplanan bu
veriler daha sonra incelenmiş ve istenilen tork değerlerinin motorlar tarafından
uygulanabildiği gösterilmiştir.

Abstract:
There are many different types and a large number of mobile platforms designed to
operate in air, land and water environments. These mobile platforms have an
increasing usage area to serve quite different purposes such as search and rescue,
agriculture, transportation, personal transportation, military activities, assistantship.
Those who work on land within these platforms usually have more than one wheel,
which leads to restrictions on their mobility and increased size. Yet, the smaller interior
spaces are limited by the mobility of the existing platforms. A spherical single wheel
and hence a mechanism to act on a single support point will prevent both the limitation
of mobility and the enlargement of the vehicle's dimensions.
A vehicle positioned on the sphere offers a concept that takes up less space in crowded
cities and has high mobility in heavy traffic environments. While vehicles with
internal combustion engines are replaced by electric vehicles and consequently
emission rates are reduced, with this concept, both environmentally friendly and high
mobility personal vehicles can be produced.
The robot, which is in balance on the sphere, consists of mechanical,
electromechanical and electronic parts. The body of the robot can consist of different
heights and different number of layers. Up to today, different designs have been made
to verify the concept, and some have been implemented. In the thesis study, previously
developed robots are examined and their advantages and disadvantages are discussed.
The differences of these robots generally come from body structures, drive systems or
controller algorithms.
When the robots that are in balance on the sphere are examined, it is observed that
their bodies consist of several layers and generally similar equipment is located in
these layers. Generally, the bottom layer contains motor bracket parts, and the battery,
while the middle layer contains motherboard and driver boards that keep the robot in
balance and drive the motors as desired. In the upper layer, there is the internal
measurement unit, which produces information about the instant position, speed and
acceleration of the robot body. To transfer the propulsion applied by the motors to the
sphere, omni-directional wheels were used.
The operating principle of the robot can be explained as follows, the IMU, which is
located in the upper layer of the robot body, determines the orientation and angular
position of the robot body and periodically shares this information with the
motherboard. The controller algorithm is running on the motherboard, which keeps the
robot body in balance. This controller calculates the torque values that the motors must
apply in order for the robot body to execute reference behavior and sends this
information to each motor driver. Motor drivers provide outputs from the power lines
in accordance with the calculated control signs and enable the motors to execute the
desired behavior.
The body of the robot, which was designed in the thesis study, consists of three layers
with a height of 30 cm and a radius of 10 cm. The drive system of the robot consists
of Maxon DCX 22 brushed motor and Maxon GPX22 planetary gear set mechanically
compatible with this motor. Maxon EASY 16 incremental encoder, which is also
mechanically compatible with the motor, has been used to get feedback from the
motor. Motherboard and motor driver cards are designed and produced within the
scope of thesis work. They have STM 32 F1 and F4 series microcontrollers. BNO055
IMU is preferred to get the feedback of the position, speed and acceleration values of
the robot body. In order for the robot to stay in balance and follow the desired
references, it was decided to use a state feedback control structure, and more than one
structure was implemented in the simulation environment within the scope of the thesis
and the simulation results were discussed.
Body plates are designed to be produced from 5mm thick 7000 series aluminum plates
by laser cutting method. The 3 plates forming the robot body are connected to each
other using stud bolts and nuts. Therefore, the positions where these connectors will
be located on each plate are designed to be the same. At the bottom of the body plate
at the bottom, there are motor holding parts. Therefore, the motor holding parts are
positioned in the angle bisectors of the equilateral triangle, that is, to make 120 degrees
with each other. In order to tolerate errors due to distance calculations and production,
gap lines which are suitable for spherical wheels and related parts were opened instead
of bolt holes. There are various holes on the plate for fixing the battery on the bottom
plate and for the motor cables to pass. There are Motherboard and Motor Driver cards
on the top of the middle plate. In the design, areas are dismantled to reduce weight,
allow cable passages and fix electronic cards. On the top plate, IMU is placed.
The STM32F411 microcontroller development board on the motherboard is used
directly because it has the programming interface and will speed up the production
processes. DC-DC converter is used to operate with variable supply voltages at the
input of the card. Cassette type connectors are used on the motherboard. Motor driver
cards are directly attached to these connectors and no extra wiring is required. Various
ports have been created on the motherboard that can communicate with motor Drivers
and IMU. The motherboard was designed in Altium Designer 18 program.
Each of the motor driver circuits developed within the scope of the thesis work
performs the tasks of communicating with the motherboard, reading incremental
encoder data, running closed loop motor control codes and supplying power to the
motors. It also provides the supply voltages of the incremental encoders. The
STM32F103 microcontroller board is used directly on the Motor Driver for low cost
and fast production. There are various ports on the driver board to communicate with
the motherboard and different types of encoder. H-bridge MOSFET structure was
created on the motor driver board to drive the motors and an integrated circuit was
used for driving the MOSFET. Again, the current drawn by the motor was measured
with the shunt resistor on this circuit. As with the motherboard, the motor driver board
was also designed with Altium Designer 18 program.
The mathematical model of the system was created by obtaining steady-state equations
with 3 inputs and 10 outputs. Lagrange energy equations approach is used to find
steady-state matrices (A and B). Since the expressions obtained with Lagrange
equations are non-linear, they are linearized around different points with the
assumption that the motors will operate at relatively low speeds, thus the motors will
apply relatively low torques. Linearization was made around 73 points depending on 
the location of the body. After the linear models were obtained, simulation
environment was created and controller development studies started. LQR and LQG
controllers have been developed and their performance compared with and without
disruptive effects. After the studies, it was decided to use the LQG controller, which
operates more robust under disruptive effects.
The torque control algorithm in the motor drives consists of the PI controller. In the
Simulink environment, a mathematical model related to the motor chosen within the
scope of the thesis study was established and then the coefficients for the PI controller
were determined. In the same environment, the algorithm was implemented with C
code and it was proven that the code works correctly.
A study was carried out to verify the functionality of the robot designed during the
thesis study. In this study, the functionality of the design was tried to be verified rather
than the final products to be used in the project. Therefore, motherboard and motor
driver cards has been produced as one and the torque references created have been
shown to be applicable by the motor. For this purpose, a simulation has been made in
which input signs are applied so that the robot goes to a certain position and returns to
its original position. The torque values that the motors must apply during this
simulation are logged. The logged data is embedded on the motherboard and is
transferred to the driver card periodically by communication. In addition, it has been
shown that torque control can be done with a potentiometer by giving a torque
reference value. The voltage drop on the potentiometer was measured with the analog
digital converter unit of the microcontroller on the driver board. A mathematical
relationship has been established between the measured value and the torque that the
motor must apply. In order to create a mechanical load on the motor, one end of the
spring is fixed and the other end is connected to the rotor of the motor. With the
variable torque value applied by the engine, the spring was tensioned in different
amounts. The current drawn by the motor during the operation was measured with the
sensitive shunt resistor on the driver card. The current applied by the motor is
calculated by multiplying the measured current value by the motor's torque coefficient.
The calculated torque value and reference torque value were transferred to an FTDI
converter and then to the computer environment via the communication port of the
motor driver board. The reference torque value applied to the motor and the torque
applied by the motor are logged using TeraTerm, a terminal program in the computer
environment. After the study, the reference torque value and the torque value of the
motor were compared. At the end of the verification study, it has been shown that the
motors can apply the desired torque values with an acceptable approximation.
As a result, within the scope of thesis work, the usage areas of robots that can balance
on the sphere are explained. Some of the robots produced up to now have been
examined and their strengths and weaknesses have been revealed. Mechanical and
electronic design has been made for the ballboat. Controllers to keep the robot in
balance were compared in simulation environment and simulation results were
discussed. The torque control algorithm that will run on motor driver cards has been
also developed in the simulation environment. Finally, a verification study about the
concept developed in the thesis study has been made and the suitability of the design
has been demonstrated