How Robots Use Maths to Move
Summary
TLDRThis video script details the creation of a simple robot arm project with an inverse kinematic model, designed to move a ping pong ball through a contraption. The project uses basic servos, 3D-printed parts, and an Arduino Uno for control. It demonstrates the arm's ability to move in a straight line in 2D space and includes a gripper for ball manipulation. The script also discusses the use of potentiometers for analog input and the 'ramp' library for smooth motion interpolation. The project is part of a larger 'Great Ball Contraption' and is shared as open-source on GitHub.
Takeaways
- 🤖 The video discusses the application of inverse kinematics in robotics, which is essential for positioning a robot's end effector in a specific location within a known coordinate system.
- 📐 The presenter has used inverse kinematics in robot dog projects to coordinate the feet for movement in three dimensions, allowing for translation and rotation.
- 🔧 The project involves a simple robot arm with a basic inverse kinematic model, which is part of a larger 'Great Ball Contraption' project demonstrating science and engineering concepts.
- 🛠️ The robot's base consists of a sliding axis with V-wheels and a frame for stability, using drop-in T-nuts for easy assembly.
- 🔩 The robot arm uses basic servos with metal brackets for easy mounting, creating a limb with multiple joints that can be controlled via a servo PWM signal.
- 🔄 The arm includes a linear axis for shoulder movement, an elbow joint, and a gripper at the end controlled by another servo, designed to pick up and move ping pong balls.
- 🔋 A 7.4-volt 2-cell LiPo battery powers the servos and a DC motor for the linear axis, managed by an L298 motor driver.
- 📊 The inverse kinematic model for the robot is simple, suitable for an 8-bit Arduino Uno, and involves calculating joint positions based on the desired end effector position.
- 📐 The arm's design uses a triangle with two equal sides, simplifying the math for calculating joint angles using Pythagoras' theorem.
- 📊 The video includes a demonstration of the arm's movement in a straight line controlled by potentiometers, showing the effectiveness of the inverse kinematics model.
- 💻 The project's code and CAD files are open source and available on GitHub for modification and inspiration for other projects.
Q & A
What is the purpose of an inverse kinematic model in robotics?
-An inverse kinematic model in robotics is used to calculate the joint positions required to place the end effector, such as a robot's foot, at a specific point in a known coordinate system.
How does the inverse kinematic model enable a robot to move its feet in a coordinated manner?
-The model allows the robot's feet to move from point A to point B in a straight line by calculating the joint positions at each waypoint between the two positions, enabling coordinated movement in three axes of translation and rotation.
What is the 'Great Ball Contraption' project mentioned in the script?
-The 'Great Ball Contraption' is an ongoing project that involves creating a series of machines to pass ping pong balls from one stage to another, demonstrating various science and engineering concepts.
What materials and components are used for the main base of the robot in the project?
-The main base of the robot consists of a simple sliding axis with V wheels attached to a 3D print using M5 bolts and lock nuts, with the wheels fitted with bearings and spacers for smooth rotation.
How are the servos used in the robot arm project mounted and connected?
-The servos are mounted using metal brackets and connected by screwing them onto 3D prints with self-tapping screws, allowing for easy assembly of the robot arm's multiple joints.
What role does the servo mounted on top of the first servo play in the robot arm?
-The servo mounted on top of the first servo provides an additional mechanical stage to the robot arm, functioning as the shoulder joint, which, along with the elbow joint, allows for a wide range of positions.
What is the function of the gripper's fingers and how are they constructed?
-The gripper's fingers are 3D printed and consist of two parallel plates that are spaced apart and screwed together to grip the ping pong balls. They are actuated by a servo that pulls strings attached to the plates to open and close the gripper's jaw.
What is the computational requirement for the kinematic model of the robot arm?
-The kinematic model for the robot arm is simple enough to be controlled by an 8-bit Arduino Uno, which calculates the necessary joint positions based on the desired end effector position.
How is the linear sliding axis of the robot arm powered and controlled?
-The linear sliding axis is powered by a 7.4-volt 2-cell LiPo battery, which provides sufficient current to operate the servos and the DC motor. The motor is controlled using an L298 motor driver and an encoder for precise movement.
What modifications were made to the robot arm to ensure the gripper does not crush the ping pong balls?
-An elastic band was used to pull the gripper fingers together for gripping the ping pong balls, and the gripper activation servo was adjusted to ensure the fingers move freely and do not apply excessive force.
How does the Arduino ramp library help in making the robot arm's motion smoother?
-The Arduino ramp library allows for interpolation between positions, enabling the servos to move at a controlled speed and reach their target positions smoothly over a specified time period.
What is the final function of the robot arm in the 'Great Ball Contraption' project?
-The robot arm is programmed to move through set motions using the kinematic model to pick up ping pong balls at a sensor-triggered ramp, transport them to the other end, and drop them into the next stage of the contraption.
Outlines
🤖 Introduction to Inverse Kinematics and Robot Arm Design
The script introduces the concept of inverse kinematics in robotics, which is essential for calculating joint positions to achieve a desired end-effector position in a known coordinate system. The speaker discusses their experience with inverse kinematics in robot dog projects and presents a new project involving a simple robot arm with an inverse kinematic model. The robot arm is part of a larger 'Great Ball Contraption' project that demonstrates various scientific and engineering concepts. The base of the robot consists of a sliding axis with V-wheels and a frame for stability. The arm itself is constructed using servos with metal brackets for easy assembly, and the project is sponsored by 3D Fuel, which provided the filament for 3D printing components.
🔧 Building the Robot Arm and Writing Inverse Kinematics Code
The paragraph details the construction of the robot arm, which includes a linear sliding axis, servos for shoulder and elbow movements, and a gripper at the end controlled by another servo. The servos are connected using 3D printed parts and screws, creating a simple yet functional design. The kinematic model is kept basic, requiring only an 8-bit Arduino Uno for control. The script also describes the process of writing code for the inverse kinematics, which involves calculating joint positions based on the arm's length and desired end-effector position. The use of trigonometry and potentiometers for analog input is explained, allowing the arm to move in a straight line along one axis. The code and CAD files for the project will be open-sourced on GitHub.
📈 Refining Motion Control with Arduino Ramp Library
This section discusses the refinement of the robot arm's motion using the Arduino Ramp library, which provides smooth interpolation between positions. The script explains the initial jerkiness of the servos' motion and how the Ramp library helps to create a smoother movement. The library's example code is used to demonstrate a linear rise in values, which is applied to both the z and x positions of the arm. The result is a more controlled and fluid motion that can be adjusted by varying the interpolation time. The script also mentions the use of a sensor to detect the presence of balls and trigger a series of motions to pick up and pass the balls along the contraption.
🎥 Finalizing the Robot Arm and Future Enhancements
The final paragraph wraps up the project by showing the robot arm in action, picking up balls and moving them to the next stage of the 'Great Ball Contraption'. The script describes the safeguards in the code to ensure the arm completes one cycle before being triggered again, allowing it to continue picking up balls until the ramp is empty. The speaker expresses satisfaction with the functional aspect of the project and suggests future enhancements, such as adding LED strips to visually represent the inputs to the axis as the arm moves. The script concludes by inviting viewers to like, subscribe, and support the channel through Patreon or YouTube membership, with links provided in the video description.
Mindmap
Keywords
💡Inverse Kinematics
💡End Effector
💡Coordinate System
💡Robot Dog Projects
💡Great Ball Contraption
💡Servo PWM Signal
💡Gripper
💡Arduino Uno
💡L298 Motor Driver
💡Ramp Library
💡Potentiometers
Highlights
Inverse kinematic models enable robots to calculate joint positions for placing end effectors at specific coordinates.
The speaker has applied inverse kinematics in robot dog projects for coordinated multi-axis movement.
A simple robot arm project with an inverse kinematic model is part of the 'Great Ball Contraption', demonstrating scientific and engineering concepts.
3D Fuel provided filament for the project, showcasing the importance of materials in 3D printing.
The robot's base consists of a sliding axis with V wheels and a sturdy frame for stability.
Basic servos with metal brackets are used for the robot arm, allowing for easy assembly and control.
The robot arm design includes a shoulder and elbow joint for a wide range of motion.
A gripper with 3D printed fingers and a servo-activated jaw is designed to pick up ping pong balls.
An 8-bit Arduino Uno is sufficient to control the simple kinematic model of the robot arm.
A 7.4V 2-cell LiPo battery powers the servos and the DC motor for the linear axis.
The L298 motor driver and an encoder are used for smooth motion control of the linear axis.
Elastic bands and strings are used for the gripper's compliant mechanism to hold ping pong balls.
Trigonometry and Pythagoras theorem are applied in the inverse kinematic calculations.
Arduino code is used to convert mathematical solutions into servo control signals.
Potentiometers provide an analog input for testing the arm's motion in a straight line.
The speaker's approach to inverse kinematics simplifies calculations for a two-link arm.
PCBWay is highlighted for their PCB manufacturing and assembly services.
The robot arm's motion is tested for smoothness using the Arduino Ramp library.
A sensor is used to detect the presence of ping pong balls and trigger the gripper.
The robot arm is programmed to move through set motions for the 'Great Ball Contraption'.
The project's code and CAD files are open source and available on GitHub for community use.
LED strips are suggested for visual representation of the robot arm's axis inputs.
The robot arm successfully demonstrates inverse kinematics in a functional and educational manner.
Transcripts
i get many questions about inverse
kinematics for robotics
an inverse kinematic model gives us the
ability to request to position the foot
or end effector of a robot limb at a
specific point in a known coordinate
system
and calculate all the joint positions in
order to place it there
i've used inverse kinematic models in
multiple robot dog projects which allows
the feet to be coordinated so that the
robot's body can move in three axis of
translation and three axis of rotation
this allows us to move the robot's foot
from point a to point b
in a straight line by visiting all the
waypoints between the two positions one
after the other
and calculating the inverse kinematics
at each position
so for this video i thought i'd make a
simple robot arm project with a very
simple inverse kinematic model and also
make this part of the great ball
contraption
this is an ongoing project built in
multiple parts which passes ping pong
balls along from one stage to another
by using machines which demonstrate
science and engineering concepts
these will eventually all be linked
together so let's get the core parts of
the design printed and i'll explain the
concept
thanks to 3d fuel for the filament for
this project and lots of other projects
so check out my channel for more 3d
printing projects and check out
3dfuel.com
the main base for the robot is a very
simple sliding axis
so i've got some v wheels and i've
attached those with the right spacing to
a 3d print with some m5 bolts and lock
nuts
these v wheels came fitted with bearings
and also spacers so you can do the bolts
up nice and tight and they still rotate
freely
and that allows the carriage to run on a
piece of v-slot extrusion that's going
to make up the main base for the robot
i've built a frame which goes at each
end of the v-slot to make up four legs
so we've got a nice sturdy base for the
robot
and i'm using drop-in t-nuts here so
that we can attach all the pieces
together
as i have with many other projects so
that makes one linear sliding axis which
we can mount the robot
arm on i'm using fairly basic servos for
this project which work with a servo pwm
signal so they're easy to control
but these particular servos come with
metal brackets so that we can mount them
easily together to make up a limb with
multiple joints
they come with small screws and brackets
so we can just screw those down to the
3d print
and screw the servos on each one has an
arm which has another 3d print attached
to it to make the next section of the
robot
arm and again they come with
self-tapping screws which easily screw
in
and that makes it really easy to connect
the servos together
on top of the first servo is mounted
another servo so i have two mechanical
stages to my robot arm as well as the
linear axis that everything sits on
this gives me a shoulder and an elbow so
we should be able to achieve quite a
wide range of positions
but of course we need a gripper to
actually grip the ping pong balls to
pick them up and move them through the
machine so i fitted another servo
on the very end which is going to
control the end effector
and that one's fitted at right angles i
3d printed some fingers for my gripper
which are two parallel plates
and those are spaced apart and screw
together with countersunk self-tapping
screws
i've used m4 bolts and lock nuts again
to make sure we can tighten those up but
not over tighten them
so the fingers move really freely and
the idea is that servo has two pulleys
on
which is simply just going to pull
strings to open the jaw and they'll be
sprung back together
the kinematic model for this robot is
going to be really simple so we don't
need anything more than an 8-bit arduino
uno to control
all of it the servos i'm using need a
minimum of 6 volts so i'm using a 7.4
volt 2 cell lipo battery
which has got more than enough current
capability to power all of the servos
as well as the dc motor on the sliding
axis
and to power the motor for the linear
axis i'm using an l298 which is a fairly
archaic motor driver but it does two
amps and axis so that should be more
than sufficient
the motor itself is driven with an
encoder hung on the back and i 3d
printed a t5 pulley for it
so this is just going to be a simple
belt drive that goes all the way up and
down the axis
to move the carriage a bit like a 3d
printer bed
or tool head i've used an elastic band
to pull the gripper fingers together so
they can grip the ping-pong ball
and i've also added the strings that go
around those pulleys on the gripper
activation
servo so you can see the whole thing in
operation
obviously with the elastic band there we
can't crush the ping pong ball
and that makes the gripper pretty much
compliant
now the arm's assembled it's time to
write some code for the inverse
kinematic model
and that allows to position the end
effector where it picks up the ball
in a known coordinate system and work
out the joint positions
for the other two or three joints
my approach to this is to write some
code that allows us to enter
the resulting length of the arm and
output the two joint positions
at the shoulder and at the elbow and
you'll have notice
i've made this a triangle with two equal
length sides
for both the upper arm and the lower arm
that makes the maths quite a lot easier
that's a pretty easy type of triangle to
solve but looking at the website
mathsisfun.com we can find out how to
solve various triangles
in this case we know three sides and we
want to find the missing angles
this uses pythagoras theorem which is a
simple piece of maths
i converted that mass into arduino code
which gives us the answers in radians
which then need to be turned into
degrees and into the milliseconds for
the pwm that drives the servo
of course once we've got one angle of
the arm we can easily work out the
others
and since two sides of the triangle are
equal two angles are also
equal i took some potentiometers off a
previous project from the junk pile i'm
only going to use two of them but this
allows me to have an analog
input that allows me to sweep through a
range of values and see if the maths
works
i'm only using one axis to start with
but we should see that the arm moves in
a straight line as i turn the pot
and that straight line should be a 45
degree angle with its origin at the base
joint of the base servo
the reason that it's at 45 degrees is
because that was the default position
for the servos
basically the shoulder axis pointing
straight up and the elbow axis at 90
degrees
i put that offset in the code and now
everything is based off that offset
and that 45 degree angle
now we've taken care of the length of
the arm and that's all dealt with with
the first bit of code
we now want to be able to enter two
other axes to position the arm in at
least 2d
space that can be done with simple
trigonometry though
and the rest of the arm is already dealt
with by the previous piece of code
the trigonometry looks like this cos of
theta the angle at the base
equals the adjacent over the hypotenuse
and so the hypotenuse simply equals the
adjacent
over cos theta that's just one line of
code so that we can work out the arm
length from the two other coordinates
we do need one more piece of simple
trigonometry though so that we can
modify the shoulder angle based on its
new angle
i converted that to degrees and taken
away the existing 45 degree offset
and i've also converted that to servo
pwm which is roughly 11 milliseconds
per degree but before we look at that
it's time for a quick ad from the
video's sponsor
which is pcbway pcby provide both pcb
manufacture
and pcb assembly under the same roof so
you can get them to solder the
components onto your pcb
as well as make the board and they'll do
surface mount and through-hole assembly
pcbway have also launched new cnc
services including online cnc
machining sheet metal fabrication 3d
printing and injection molding
pcb way cnc machining services include a
wide range of materials including
aluminium stainless steel and various
plastics
if you don't see the material you like
you can also choose from custom
materials
check out the pcb way website to browse
through a variety of finishes
and get a quote pcb way manufacture all
sorts of boards including standard
fiberglass pcbs
but also aluminium pcbs flexible pcbs
and rigid flex pcbs which are part rigid
and part flexible
prices start at five dollars for ten
standard pcbs and thirty dollars for ten
pcbs with assembly
but new customers can get five dollars
credit so you can get ten pcbs for free
the first time you order
find out more now at pcbway.com and i'll
put that link in the description to this
video
so now i'm using two potentiometers to
control the arm one of them moves the
arm
up and down in a pretty much perfectly
straight line there will be some issues
with servo calibration
here because the pots are probably low
tolerance inside the servo itself that
gives it feedback
so it may not run perfectly linearly but
that looks pretty good for cheap hobby
servos
and some code i wrote on an 8-bit
arduino
the other part causes the arm's reach to
move in another
almost perfectly straight line given the
servo's tolerances
and we can see that both joints are
working together there to move that arm
pretty much in a perfectly straight line
horizontally and vertically
all the code as well as the cad for this
project will be published and you can
find that on github and the link is in
the description to this video
it's open source so feel free to modify
it and do what you like with it or use
it for inspiration in your own projects
the last axis in this project is very
simple because it moves in a straight
line anyway so we don't really need to
do
any math to control it but check out my
previous robot dog projects if you want
to see something more complicated
i've programmed the rover arm to move
through some set motions
using the kinematic model so it moves in
x and z positions
in order and there's three positions in
this sequence
however you'll notice that it's very
jerky because the servos move at full
speed
and also for some moves one servo
doesn't need to move as far
so it gets there first that means we
don't have a very smooth motion
so i'm going to be using the arduino
ramp library from site swap juggler
which is open source and you can find it
on github
it has various parameters but ultimately
allows us to interpolate through
positions from one point to another
and make our motion really smooth the
example code that ships with the ramp
library is pretty simple all we need to
do is my ramp go
give it a value to interpolate 2 and a
time we want to interpolate over
so if we now open the serial plotter we
can see we get a linear rise here
straight from one value to the other
without a step
there are various other responses in
this library as well but for now we're
just going to use the linear one
so now i'm feeding both the z and the x
positions over the ramp library and i'm
feeding them
over the same amount of time so now my
step sequence is allowing those joints
to move over the same amount of time
and the end effector of the robot should
be moving in a perfectly straight line
between them
so this is a much smoother motion and
also we can control how fast it moves by
interpolating each move
over a longer or shorter time if we wish
to do so
but now we need to pick up some balls
and pass them along so the arm can be
part of the great ball contraption
i'm using one of these sensors that i've
used in the past so we can sense when
balls are present and trigger a series
of motions
i made a short ramp to feed the arm
which has the sensor on eventually this
will be fed by a reservoir and a longer
ramp
and that means we can throttle the
amount of balls pass through this stage
and the rest of the great ball
contraption
when it sees a ball present it picks it
up takes it to the other end and drops
it which will take it on to the next
stage
perhaps into the high voltage ball
accelerator that i made last time
if i stack multiple balls in the ramp
i've put various safeguards in the code
that means it finishes one cycle before
being triggered again
so this means it will keep coming round
picking up the balls taking them to the
other end and dropping them
until the ramp is empty in which case it
stops
this
i'm pretty happy with this from a
functional point of view to demonstrate
inverse kinematics what would be great
from an educational and visual point of
view would be to have perhaps two led
strips one vertical
and one horizontal that show the inputs
to the axis
as the robot arm moves so we can show
that what goes in is lines in a straight
line
and what comes out is the rotation of
these joints but for now this is a great
addition to my great ball contraption
look at the other parts in my channel
i'm going to be building a few more and
then stringing them all together
so that balls get passed all the way
around and hopefully back to the
beginning again
if you liked the video don't forget to
like and subscribe for more pieces of
this
more robotics and more open source
designs and you can find all my designs
which are open source on github the
links in the description to this video
so if you'd like to support me through
patreon or youtube channel membership
then those links are in the description
as well and patrons and youtube channel
members get access to all the videos up
to a week early
and sneak peeks and pictures of what's
coming up so you can be involved in all
of that discussion
alright that's all for now
[Music]
you
Ver Más Videos Relacionados
Robotic Arm with Arduino - Save/Play/Export/Import Positions.
SCARA Robot | How To Build Your Own Arduino Based Robot
طريقة تحويل الكاميرا الثابتة الى كاميرا متحركة بواسطة Arduino
Blender Tutorial for Complete Beginners - Part 1
Newton's First Law of Motion: Mass and Inertia
Hi-Tech Trek: Microprocessors Part 1 (Speed)
5.0 / 5 (0 votes)