1. 1
ETE 480 - Introduction to Motion Control
Quasi-Autonomous Vehicle
Matt Emge Levi Galeski Mike Nikiema
Alexander Capetillo Sergio Reyes Sanghoon Rhee
Spring 2016
Dr. Scott Boskovich
Electromechanical Systems Engineering Technology
College of Engineering
Table of Contents
2. 2
I. Executive Summary
II. Introduction
III. Theory
IV. Design
V. Results
VI. Summary/Conclusion
VII. Appendix
VIII. Budget
IX. References
Executive Summary
Often times when recent graduates enter the workforce, it is necessary for them
to have an understanding of certain soft skills; these include an proficiency in team
3. 3
environments. Thankfully the engineering technology department is one such curriculum
that emphasizes and encourages the team setting by enabling students to collaborate
on numerous projects throughout their time spent at Cal Poly, even as undergraduates.
This is extremely important for helping students to reach for ambitious goals and step
out of their comfort zones.
Building upon this learning infrastructure, a class such as ETE 480 , Introduction
to Motion Control , takes the benefit of the team emphasis and adds another element
into the mix. The majority of the time students are only involved within their own
respective engineering focus, or core major. However, this class involves two opposing
curricula, with just enough in common to build upon student’s fundamental knowledge.
Not only does this provide an opportunity to learn about the respective mechanical or
electrical side of engineering which the student is missing, but it offers the students a
chance to share their expertise and teach others, further reinforcing their knowledge
and application.
This is a senior level course with senior level expectations, it involves various
elements of design accompanied with project management skills. This course is truly
the culmination and the capstone of the engineering technology departments. Some
would argue that this project even rivals various senior projects. It requires not just the
input from both the mechanical and electrical focuses; to complete the project also
requires previous , background, experience with tasks and parts, partnered with topics
covered in class.
Introduction
The goal of this project is to create a quasi-autonomous vehicle that will compete
in a number of events. Each team will participate the events, and depending on their
respective success, will be seeded in each proceeding category. These events are
4. 4
designed such that the teams participating will have to evaluate the cost / benefit of their
design by varying: power, speed, size, weight, cost, schedule impact, and many other
factors which will be discussed further.
These events will test students capability to design and build an effective robot
that combines electrical, mechanical, and software components. Students will be
expected to utilize various chassis, steering, sensing, motor, and control designs to best
optimize their chance of winning the competition, which will take place June 10th 2016,
as the final portion of the course. Winning teams will take home the coveted gears and
pull ring/rope assembly will be given to the lead. Detailed in this report are the steps that
were taken to achieve our final product and bring the “Land Shark” alive. These include
how the team managed to devise their scheme for best navigating obstacles in the
events, how and why the team chose a specific design, what problems were
encountered and how they were dealt with, as well as how the final product was
reached.
Theory
The theory involved in obtaining smooth, autonomous motion of our vehicle was
a major part of the challenge in our design. When compared to differential steering, an
Ackerman design becomes much more complicated much quicker, as your steering
takes place over a much longer stretch of time, and this must be accounted for in 2nd
order equations dealing with a rate of change of steering angle of your front wheels. In
addition to this design challenge, the exclusion of pre-designed motors with gearing and
5. 5
encoders also provided us with more difficult theory. Designing our own encoders
allowed us to really understand the mechanics behind how they work, along with the
code involved in actually obtaining the data and correlating it to actual vehicle speed.
Our choice of stand-alone brushless motors also allowed us the opportunity to delve
into the design theory of a gearing and power transmission system, while
simultaneously providing us with better results in both top speed and overall torque
when compared to alternative methods of design.
When investigating the theory behind Ackerman steering, it is important to
understand the differences when compared to differential drive steering. In differential
drive, the rotational velocity of your left and right side wheels, no matter how many you
have, must be very precisely monitored and kept equal in order to achieve an infinite
instantaneous center of rotation (ICR), meaning your vehicle will travel in a straight
path. These velocities can, and will be altered by some very minute details in the
vehicle's design that are not easily adjusted. For example, if one of your wheels is ever
so slightly smaller in diameter than the others, this will cause a change in velocity,
altering your ICR. In the case of Ackerman steering, these velocities don’t necessarily
have to be as precise as in differential drive. Ackerman steering is capable of traveling
in a relatively straight line by making minor adjustments to the steering wheels,
essentially providing your vehicle with a constantly changing ICR. In addition to this
capability, Ackerman steering provides the vehicle with the ability to make steering
adjustments while maintaining a relatively constant speed. Another major advantage to
the Ackerman steering method when compared to differential drive steering is the
significant weight reduction that comes along with not requiring a motor attached to
each wheel. In differential steering, each wheel is paired with a motor, requiring much
more power overall from your battery bank, while an Ackerman design will typically only
require one motor (or two in our case) along with a transmission system. Because of
this, Ackerman designs often times end up being much lighter weight over their
differential counterparts.
6. 6
Without purchasing a complete motor kit with encoders and a pre-determined
gearing ratio, our group was able to design all of these components on our own, and in
doing so ended up with an all around better product than the available kits. Our
simplified theory behind choosing a motor was that we prioritized speed over power.
While most of the motor kits available come geared between 20:1 and 100:1, we were
able to achieve the same, if not more torque at the cost of only an 8:1 gearing ratio,
allowing for much higher speeds simultaneously. In addition to this advantage, the
motors that we chose draw ~3Amps under no load, allowing them to run a full hour each
off of our chosen 3000mAh battery packs before losing speed and power. This run time
will be significantly reduced by the weight of the vehicle, but can also be accounted for
by simply adding another small battery pack. One other advantage of choosing to stray
from the path of kit motors is that we were able to design and develop our own encoder
system. Using pre designed software from Dr. Scott Boskovich, we were able to choose
our encoder resolution and print the physical encoder disk to whatever specifications we
desired. Coupling the encoder disks with photodetectors also allowed us to decide
precisely where we wanted to measure the rotational speed of our system, whether it
was at the wheels themselves, or the motor shaft. Because of our 8:1 gearing ratio, and
encoder resolution of 10 ticks/revolution, every 80 ticks of the encoder on the motor
shaft would equate to one revolution of our wheels. By combining this with the
circumference of our wheels (4.35”) we are able to achieve a resolution of .173 inches.
Because of our Ackerman steering design, this is a reasonable resolution, as the
precise speed of each wheel is not as important as in a differential drive system.
Addressing each trial the vehicle is to complete required a number of different
approaches and theories. In the first trial, Tug-o-War, the vehicle with the greatest
combined torque at the wheels coupled with the highest overall weight would have the
greatest advantage. Using Ackerman steering and more powerful motors than our
competitors puts our design at a middle ground for this competition. In theory, our
design is lighter weight due to the loss of two or more motors, however our dual motors
do provide higher amounts of torque than our competitors. The second trial of the
competition is a straight line race up a considerable incline. This drag race not only
7. 7
requires significant amounts of vehicle torque, but the vehicle is also limited to a lane
roughly three feet wide. If any vehicle exits their designated lane, their final distance is
measured at that point. With our 8:1 gearing ratio and running the motors at 75% duty
cycle, we were achieving speeds of approximately six ft/s up the hill, and with our
Ackerman steering, we are able to make steering adjustments as needed to stay within
the three foot lane. In order to determine whether we are traveling in a straight line or
not, a compass will be coded to give a general direction, and our wheel encoders will
determine if one side of the vehicle is traveling faster than the other, causing the vehicle
to turn. The third trial of the competition utilizes the same incline as the straight line
race, although in this instance there are a series of predetermined obstacles set about
the course. With the layout of these obstacles given to us ahead of time, each team
should be able to program in a designated path for their vehicle to traverse the field. In
our case, a simple set of motor controls was programmed for our vehicle to avoid the
obstacles while still traveling in a smooth curve from start to finish. This particular trial is
one in which our Ackerman steering design may be able to give our vehicle a significant
advantage over the other vehicles, simply because we are able to control our ICR while
still traveling in a forward direction. The fourth trial of the competition is “seek and
destroy” in which each vehicle take its turn as the seeker, and must hunt down the other
vehicles on an open field. The method of detection for this trial is purely visual, as we
were given the paint sampling for each vehicle ahead of time in order to develop a color
detection program on our main processor. Our theory for this particular event is fairly
straightforward; seek the colors in a sequence, and eliminate them from the
programming once they have been “destroyed”. Our vehicle will first complete a full
circle in an attempt to detect its determined color, then travel towards the color once it is
detected. The final and most difficult trial in the competition is the Gauntlet, in which
obstacles of all shapes and sizes are placed randomly in a path that all four vehicles
must traverse simultaneously. Not only will the vehicles be relying solely on sensor
feedback to dodge the obstacles, but they must also be able to detect the position and
heading of the other vehicles in order to prevent collisions from taking place. To combat
this, our vehicle is designed with a series of eight sonar sensors, separated at 45°
angles in order to achieve maximum coverage in all directions of the vehicle. The
8. 8
programming involved is actually quite simple as well; If an object is detected within
three feet to the front of the vehicle, turn the servo away from that object in the most
free direction, and continue moving until that object has been cleared from the front of
the vehicle, then resume the path. Because our vehicle steers using an Ackerman
system, the sensors to the direct front are the most detrimental to our overall success in
this challenge. The sensors to each side allow the vehicle to know as it is passing by an
object, although this has little impact on our path planning, as our vehicle has no way of
traveling directly to the side at any instant.
Mechanical Design
The initial design of our vehicle began with the decision to deviate from the
standard path in terms of robotics projects. Our group decided to tackle the challenges
involved with implementing an Ackerman steering design, along with utilizing standard
RC car motors for power. While this path proved to be difficult, if done properly, it has
the potential to outclass other designs significantly.
To begin, our chassis design was to be relatively straight-forward, simply
allowing space for the Ackerman steering to take place with the front wheels. The initial
mounting of the servo motor was to be modeled after a basic Traxxas vehicle design, in
which the servo was mounted on its side and the steering linkages were mounted to a
steering differential system. This design was quickly changed to our current design of
the servo being coplanar to the chassis allowing for a much simpler method of steering.
The design of the C clamps for mounting the wheels to the chassis of the vehicle came
directly from a similar part used in stock RC cars, however one major difference is that
9. 9
the off-the-shelf parts are all designed with capabilities for suspension. To simplify the
design was to remove the unneeded portion of the clamp, and 3D print our own part
(Fig.1). Once the components of the steering system were 3D printed and assembled,
the steering linkages were cut to precise lengths from 3mm steel rod, and assembled on
the front of the vehicle (Fig.2). Initial testing of the steering system showed that slight
modifications needed to be made to the servo hub in order to prevent the steering
linkages from catching on unused portions of the gear. Once this was resolved, we were
able to test the full capabilities of our steering system, showing that we have a
maximum turning angle of ~45 degrees, limited by the steering knuckles. With the
dimensions of the vehicle, this provides us with a minimum ICR of 0.36 feet, which is
respectably small. Taking into account the width of the vehicle, our final outer turning
diameter is just under two feet.
Once the steering design was fabricated and implemented, we were able to
move on the designing a mounting system for our motors. Our initial concept was
comprised of a simple motor mount designed to hold our twin motors completely co-
axial in order to prevent any alignment issues. The motors were measured and
solidworks model (Fig.3) was made for a single mount that would span the width of the
vehicle and be able to house both motors. The motors were held in place with 3mm
machine screws designed for motor mounting. This initial design worked fairly well with
the exception of the thin walls through which the motor shaft would run. These walls
were designed at ⅛” thick to allow for the maximum length of motor shaft to be available
for mounting the encoder and wheels. Unfortunately this thin section began to develop
cracks shortly after motor testing began. This was alleviated by simply removing part of
the wall and restraining the motors with other fasteners (zip ties) to prevent the motors
from angling under the added weight of batteries and electrical components.
Once the motors were mounted in a solid manner, we were able to tackle the
design challenge of achieving enough torque at the wheels to allow our increasingly
heavier vehicle to traverse the hill required for two of the trials. Even though our motors
were designed for high torque applications, they were only able to hold the vehicle in
10. 10
place on the hill when powered rather than send the vehicle up the incline. The only
viable solution for solving this problem was to develop a gearing system to increase the
torque applied at the wheels at the cost of reducing our top speed. The first thought was
to attempt to find a pair of gears that would provide us with a 10:1 ratio, however after
making a trip to a local hobby shop, a ratio of 8:1 was settled on, as these gears were
readily available and compatible with our motors. Once we had the pinion and spur
gears, the design of a three part system for mounting took a few hours to develop and
model on solidworks (Fig.4). Two of the three parts for each side were 3D printed, and
the final mounting component was of simple enough design to machine out of wood.
Once completed, this design was able to attach the spur gear to the wheel, while still
allowing the wheel to spin independently of the chassis of the vehicle. The pinion gear
on the motor shaft then made contact with the spur gear and provided the power to the
wheels. After assembly was completed, the vehicle testing went very well with
traversing the hill. The first test at maximum PWM duty cycle actually flipped the vehicle
over backwards, so it was learned that a slow ramp up to maximum speed would be
needed in the future.
Electronics design
The electronics portion of the robotic vehicle can be divided into simple level
and/or categories for simplification. The project has three main levels used to control
and manipulate data.
The higher level consists of a Raspberry Pi 3. We chose to use this single board
computer for the high level computing because it is built around the quad core Cortex-
A53 which runs at a speed of 1.2 GHz. This speed is important for the object recognition
and image processing feature of the project. It also offers onboard programmable GPIO
pins for easy interfacing to the other microcontroller used in the project at the lower level
data processing. The high level computes complex calculation such as speed and
direction based on data received from the lower level data processing level.
11. 11
The lower level data processing consists of various PIC16 microcontrollers that
are used to acquire data from sensors and execute commands from the high level data
processing level. To maximize performance and efficient of the microcontrollers which
can only run at speeds up the 32 MHz, we subdivided the lower level data processing
into 3 main categories: the motion control unit, the direction control unit, and the
obstacle detection unit.
The motion control unit is composed of a PIC16F18344, two encoders made of 2
slot-type opto-coupler model number OPB854A1, and two Axial AX31330 12V DC
motors. The motion control unit sends speed information and receives PWM pulse width
percentage from the encoders the High Level. The received data is used to adjust the
speed of the vehicle.
The direction control is simply made of a servo controlled by a PIC16F18344. It
received position information from the high level. The servo has 20 preset positions. A
total span of 90 degrees from the straight forward position, 45 degrees left and right.
This unit also uses a compass to acquire heading information in order to adjust the
direction of the vehicle accordingly.
12. 12
The obstacle detection unit has 8 US-015 sonar sensors managed by a
PIC16F18344. The theoretical distance measurement is about 7 meters, however in our
tests, the best results are achieved for obstacles within 3 meters. The sensors are
activated and read one at the time with high priority/ more scan frequency given to
whichever sensor detects an obstacle within range. While in motion only few sensors
are activated to increase efficiency. For example when in a forward motion, only the
front 3 sensors are scanned until an object is detected or the objective is attained.
Additionally we use a webcam connected to the Raspberry Pi 3 for image processing.
When an object is detected his coordinates are used to plan the next instruction for the
motion and direction control
units.
Levels Pyramid Of Robotic Vehicle
Data Processing
Since the vehicle has to accomplish different task we found is wise to categorize
the data processing by task. The user can choose which mode of operation to run from
the following choices: Speed Race, Tug O War, Seek and Destroy, Obstacle avoidance,
and Path planning.
In speed race mode, the vehicle is instructed to run forward for a set distance of
time for as fast as possible. The compass and encoder data are sent to the high level.
The high level calculates the PWM value using a PID control to ensure both rear wheels
13. 13
run at the same speed. It also adjusts the position of the front wheels based on the
heading information provided by the compass.
In Tug O War mode, the vehicle has to travel 3 feet as far as possible in a
straight path. The sensors used in this mode are the encoders, and compass. The
encoders provide distance information and the compass provides heading information.
The program runs until the vehicle has travel 3 feet forward (wins) or backward (loses).
In Seek and destroy, the camera is used to detect a target. If the target is not in
sight rotate clock wise or counter clock wise until the target is found. Rotation
information is calculated in the form of ICR and angle. The ICR and angle are then
translated into PWM and position by the motion and direction units respectively.
In obstacle avoidance mode, if no destination is provided, the vehicle runs freely
while avoidance any obstacle found on its path. The heuristics used to control the
direction in case an obstacle is detected are simply to make a 90 degree right turn with
the smallest ICR as long as no obstacle is also detected on the right. If there is an
object on the right as well, then make a left turn instead or reverse in case there is an
obstacle on the left as well.
In path planning mode, the vehicle has to travel a predefined path inputted by the
user in order to reach a destination. All distance, angles, and ICR are pre-calculated
and set by the user. Global information on the environment can be used to ensure the
vehicle is following the right trajectory. The camera, encoders, and compass data are
used to automatically adjust the direction and travel the proper set distance.
14. 14
Data and Communication Protocols
We chose SPI as the main communication protocol between the High
level/Central Processing unit because of its simplicity, ease of implementation, and data
transfer speed. The SPI clock runs 2 MHz. Depending on the each low level unit the
communication is established with, different type of data is exchanged. The central
processing unit exchanges PWM value and Speed in the form of Bytes. On the other
15. 15
hand the motion control unit receives data in the form of pulses from the encoder. The
compass transmits data in the form of packet over I2C. The camera transmits packets
as well over USB. And the Sonar sends data in the form Pulse Width.
Results
Throughout this competition we experienced a number of errors, this was largely
due to the approach to design and steps that were taken to reach the specified goals.
Our design included a number of steps to minimize dependency on pre-fabricated parts,
the goal was to design and build as much as possible in house.
The motors that were bought are RC motors that do not include encoders or
gearing. Both of these were designed by the team to provide an overall understanding
of how these systems were integrated with each other. The encoders were an integral
16. 16
part of the pulse with modification process to monitor the speed of the wheels, and to
make adjustments where needed. The gearing system was necessary in order provide
enough torque to travel uphill, the vehicle does lose speed, however it is a necessary
trade-off for increased torque and power to excel through the events that require these
applications.
The frame, although not a critical component to the performance of the vehicle, is
necessary for aesthetic purposes. Originally was a plastic sheet that would be heat
shrank around a foam core. This quickly became a disaster to look at and we switched
to foam board for lightweight and rigid design.
Thankfully the electrical side of the project didnt encounter too many errors, this
allowed us to successfully continue with testing. We feel fairly confident going into the
trials, we are eager to see the final results and how we place compared to the other
teams, as well as what their designs include.
Summary / Conclusion
In summary this project was designed to test our capabilities as a team of
engineers with various backgrounds; in order to reach our goals many obstacles had to
be overcome, but it is through our collaborative effort and shared experience that this
project was made possible.
Design/build projects have become the standard as the progression through
curriculum has evolved. Initially, student’s labs we pre-written, and tested so that the
student can retain material learned in class by means of another outlet. However, with
senior level classes, Cal Poly excels at throwing students into practical applications
where the lab is open for interpretation. This project had very limited guidelines as to
what students could potentially create, as long as the design remained within the
constraints of a square foot ( give or take ). Even the more standard design features
such as the wheels, motors, and batteries, become a complex system when taking into
account what emphasis they have on our design goals, how they play into the overall
system and co-mingle with the other systems.
This team was very ambitious in our efforts, which is why we are all so proud to
have been apart of the experience. We took the long road in most of our endeavours, so
17. 17
that we can truly call this project ours. We explored almost every possible path of
attack, just as a shark would, and made it our mission to reach the target. By not relying
on pre-purchased materials, the team was able to design many aspects of the vehicle to
gain a much more clear understanding of how these systems work. Some examples of
in-house design produced by the team include : encoders for speed and displacement
feedback, gearing system to increase torque, ackerman steering and drive trains,
multiple sensors for obstacle detection in 360 degrees around the vehicle, and various
parts being designed through solidworks and 3D printed for best fit as well as reduced
cost to budget and schedule.
Overall, it was this ambition that allowed our team to get the most out of this
project. Since every step along the way needed to be planned and calibrated,
accompanied by the errors and unforeseen problems in planning, his group was able to
take away an amazing understanding of design, planning, construction, quality control,
budget, and schedule; which are all important factors needed for entering the workforce
and being prepared to take leadership roles within the industry. This team would like to
thank Dr. Boskovich for continually challenging students, setting the bar just out of
reach, and allowing students to make their own assumptions of how to reach the
expectations provided. It is challenging, time consuming, and above all else, it is what
makes the engineers here at Cal Poly such desirable candidates for employment post-
graduation.