autonomous juggling robot - rutgers school of engineering · juggling has existed as a form of...

13
Autonomous Juggling Robot Paul Barsa Olivia Cao [email protected] [email protected] Shana Chen Krish Desai Aanya Gupta [email protected] [email protected] [email protected] Matthew VanDusen-Gross* Mary Pat Reiter* Ryan Wu* [email protected] [email protected] [email protected] New Jersey Governor’s School of Engineering and Technology July 27, 2019 *Corresponding Author Abstract—The art of juggling requires the brain to make decisions faster than human reaction time – a phenomenon that has yet to be explained by modern science. By studying the juggling motion of a robot, it is possible to explore the methods through which the brain is able to translate a decision into an action. The goal of this project was to create a robot that could accomplish two-dimensional juggling with up to five marbles in a cascade, or with site-swap patterns. Computer-aided design was utilized to create models of linear actuators for the robot, and the Arduino platform was used to program the robot. The robot was able to juggle one marble, perform a three ball cascade, and accomplish a three-one site-swap, albeit with inconsistencies. A MatLab simulation was used to determine the paths that the marbles would have taken provided that the robot could accomplish juggling more balls and perform more complex site- swaps. I. I NTRODUCTION In general, humans do not register the locations of individual balls while juggling. Instead, juggling is a dynamic, multi- dimensional task which combines instinct and reaction time, forcing humans to act within a feedback loop of information [1]. Alex Barron, the world-record holder for juggling eleven balls, is able to track each ball that is thrown within 160 ms. However, human reaction time is at best 200 ms for high speed athletes, leaving many unanswered questions when it comes to how the human brain is able to control the body and perform juggling [4]. Attempting to achieve this task with a robot proves to be a significant challenge – while robots have the processing speed to match and surpass humans, they are limited in the necessary dexterity to perform such an operation, much less the instinctual feedback loop of information that helps humans juggle [2]. The goal of this project is to create a sensorless robot that can juggle up to five balls in several different patterns, transferring between them using an operation to generate new sequences, known as a site-swap. This will be done on an inclined plane which will reduce the acceleration due to gravity of the ball, and simplify the juggling pattern into two dimensions. This project seeks to use high speed linear actuators in order to achieve the launch velocity required to drive marbles up the inclined plane into projectile motion. This will be the first step to creating a robot that can use sensors to synthesize information and determine how to juggle on its own. This robot can be studied to further understand the human brain and the human thought complex. II. BACKGROUND A. Logistics of Juggling Juggling has existed as a form of entertainment for over four thousand years, beginning in the Middle Kingdom in Egypt [5]. It was popularized in the 1920s by Enrico Rastelli, who, for nearly a century, held the record for juggling ten balls. The operations involved in juggling can be described through a series of mathematical algorithms rooted in physics and number theory. The mathematics of juggling rest on the principle of an ideal environment, in which an object can be caught and then immediately thrown again [6]. This leads to the impossible implication that the object must achieve infinite acceleration in order to change direction instantaneously. The fundamental tasks of “catching”, “carrying”, and “throwing” are reduced in theory to simply “catching” and “throwing” [7]. In practice, humans are able to surmount this obstacle by continuously adapting the launch velocity of the object. For robots, this presents a much more serious issue; without human intuition, robots must rely on the laws of physics to attempt to simulate the idealized situation. Because of this complication, robots that use cameras and computer vision would be able to juggle more efficiently, but given the extensive research done in the fields such as juggling theory, it is possible to construct a sensorless robot that tracks balls only using the laws of physics. This project is similar to Shannons Machine, the first juggling robot created in 1970, as it is an open-loop system that depends upon physics rather than sensors. Another juggling robot, the Yale Planar Juggling 1

Upload: others

Post on 01-Jun-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Autonomous Juggling Robot - Rutgers School of Engineering · Juggling has existed as a form of entertainment for over four thousand years, beginning in the Middle Kingdom in Egypt

Autonomous Juggling Robot

Paul Barsa Olivia [email protected] [email protected]

Shana Chen Krish Desai Aanya [email protected] [email protected] [email protected]

Matthew VanDusen-Gross* Mary Pat Reiter* Ryan Wu*[email protected] [email protected] [email protected]

New Jersey Governor’s School of Engineering and TechnologyJuly 27, 2019

*Corresponding Author

Abstract—The art of juggling requires the brain to makedecisions faster than human reaction time – a phenomenon thathas yet to be explained by modern science. By studying thejuggling motion of a robot, it is possible to explore the methodsthrough which the brain is able to translate a decision into anaction. The goal of this project was to create a robot that couldaccomplish two-dimensional juggling with up to five marbles ina cascade, or with site-swap patterns. Computer-aided designwas utilized to create models of linear actuators for the robot,and the Arduino platform was used to program the robot. Therobot was able to juggle one marble, perform a three ball cascade,and accomplish a three-one site-swap, albeit with inconsistencies.A MatLab simulation was used to determine the paths thatthe marbles would have taken provided that the robot couldaccomplish juggling more balls and perform more complex site-swaps.

I. INTRODUCTION

In general, humans do not register the locations of individualballs while juggling. Instead, juggling is a dynamic, multi-dimensional task which combines instinct and reaction time,forcing humans to act within a feedback loop of information[1]. Alex Barron, the world-record holder for juggling elevenballs, is able to track each ball that is thrown within 160 ms.However, human reaction time is at best 200 ms for highspeed athletes, leaving many unanswered questions when itcomes to how the human brain is able to control the body andperform juggling [4]. Attempting to achieve this task with arobot proves to be a significant challenge – while robots havethe processing speed to match and surpass humans, they arelimited in the necessary dexterity to perform such an operation,much less the instinctual feedback loop of information thathelps humans juggle [2].

The goal of this project is to create a sensorless robotthat can juggle up to five balls in several different patterns,transferring between them using an operation to generatenew sequences, known as a site-swap. This will be done onan inclined plane which will reduce the acceleration due togravity of the ball, and simplify the juggling pattern into

two dimensions. This project seeks to use high speed linearactuators in order to achieve the launch velocity required todrive marbles up the inclined plane into projectile motion. Thiswill be the first step to creating a robot that can use sensorsto synthesize information and determine how to juggle on itsown. This robot can be studied to further understand the humanbrain and the human thought complex.

II. BACKGROUND

A. Logistics of Juggling

Juggling has existed as a form of entertainment for over fourthousand years, beginning in the Middle Kingdom in Egypt[5]. It was popularized in the 1920s by Enrico Rastelli, who,for nearly a century, held the record for juggling ten balls.

The operations involved in juggling can be describedthrough a series of mathematical algorithms rooted in physicsand number theory. The mathematics of juggling rest on theprinciple of an ideal environment, in which an object can becaught and then immediately thrown again [6]. This leads tothe impossible implication that the object must achieve infiniteacceleration in order to change direction instantaneously. Thefundamental tasks of “catching”, “carrying”, and “throwing”are reduced in theory to simply “catching” and “throwing”[7]. In practice, humans are able to surmount this obstacleby continuously adapting the launch velocity of the object.For robots, this presents a much more serious issue; withouthuman intuition, robots must rely on the laws of physics toattempt to simulate the idealized situation.

Because of this complication, robots that use cameras andcomputer vision would be able to juggle more efficiently, butgiven the extensive research done in the fields such as jugglingtheory, it is possible to construct a sensorless robot that tracksballs only using the laws of physics. This project is similar toShannons Machine, the first juggling robot created in 1970,as it is an open-loop system that depends upon physics ratherthan sensors. Another juggling robot, the Yale Planar Juggling

1

Page 2: Autonomous Juggling Robot - Rutgers School of Engineering · Juggling has existed as a form of entertainment for over four thousand years, beginning in the Middle Kingdom in Egypt

Robot created in 1989, was controlled by a mirror algorithm,a closed-loop system where the position and velocity of thepucks would be read in order to decide when to hit the pucks[3]. A robot that relies on sensor feedback is feasible, however,it is most achievable once a robot is created that can simplyjuggle balls without any sensor feedback. This approach hasthe added benefit of simplicity and cost efficacy, while stillmaintaining entertainment value.

B. Spatial Awareness

Humans have an innate spatial awareness that allow themto track the balls they are juggling without vision, and pre-dict where the balls will land in order to catch them. Thisproject seeks to recreate the intrinsic property of the brain topredict an object’s trajectory and act accordingly. One theorythat has been proposed to explain this phenomenon is the“muscle memory” explanation. It claims that jugglers, aftera certain amount of practice, have encoded responses to balltrajectories and hand movements in their brain so that theymove subconsciously. Another theory suggests that the brainis able to determine the equations of motion rapidly to catchand throw the balls [4].

C. Site-swap Patterns

This project attempts to perform site-swap juggling whichchanges the beats at which the balls are thrown. To representthis, Michael Day from the University of Cambridge, PaulKlimek from the University of California, Santa Cruz, andBruce Tiemann from the California Institute of Technologycreated site-swap notation in 1985 [9].

Site-swaps are denoted by the time intervals, or beats,between throws. For instance, in a three-ball cascade (throwingthree balls in symmetrical arcs to the other hand), the first ballwould be thrown on beats 1, 4, 7, etc.; the second ball wouldbe thrown on beats 2, 5, 8, etc.; the third ball would be thrownon beats 3, 6, 9, etc. The site-swap notation for a three-ballcascade is denoted by a 3 since each ball is thrown after threebeats.

In this scenario, all of the balls were thrown within thesame amount of beats each time. However, in a five-three-onesite-swap, the ball thrown horizontally spends less time in theair compared to the balls thrown in the arcs. The first ball isthrown and caught within five beats, the second ball is thrownand caught within three beats, and the third ball is thrownand caught within one beat. The first ball would be thrownon beats 1, 6, 7, 12, etc. The second ball would be thrown onbeats 2, 5, 8, 11, etc. The third ball would be thrown on beats3, 4, 9, 10, etc.

All site-swap notations can determine the amount of ballsneeded to perform the trick by adding up all of the numbersand averaging this value by the amount of numbers present.For instance, the average of 5, 3, and 1 provides a total ofthree balls necessary to perform a five-three-one site-swap.

Diagrams such as the ladder diagram in Figure 1 can beused to visualize this. The numbers below the ladder marksrepresent the beats, or time intervals, between throws. The L

Fig. 1. Ladder diagram of five-three-one site-swap notation.

and R in the diagram represent the left and right hand of thejuggler. The five-three-one pattern across the top of Figure 1denotes that this ladder is representative of a five-three-onesite-swap and guides the user in determining where to drawlines between the left and right hand. Above beat 1, there is a5. This means the first ball will be thrown in the air for 5 beatsbefore being caught on beat 6 which is on the right-hand-sideof the ladder. Above beat 2 is a 3. This means that the secondball will be thrown and caught within 3 beats ending in theleft hand. Above beat 3, there is a 1, meaning that the thirdball will be thrown and caught within 1 beat ending in theright hand. Then by following the colored arrow paths, theviewer can visualize the pattern that the three balls follow ina five-three-one site-swap.

The ratio between the time the robot takes to catch andthrow a ball and the time between catches is approximately 3:4[10]. This can aid in determining juggling patterns. However,as the number of balls increases, the ratio approaches 1:1. Thissuggests that there are limitations to the amount of balls thatcan be juggled. In site-swaps, every ball has a respective ratioand must be accounted for.

D. Open-Loop and Closed-Loop Strategies

One of the primary facets of human juggling is the feedbackloop that allows humans to not have to focus on all the ballsat the same time. Closed-Loop Systems are related to controltheory and reactive systems in that they take information fromthe end of the system and use that information to modify initialparameters [11]. Many times, closed loop systems tend to usecomputer vision software to determine inconsistencies withinthe trajectory of the ball [12] [13]. From that data, usinginverse kinematics, the required corrections can be made tothe launch vector [14] [15]. The next step up from closed-loop systems is artificial intelligence and closed-loop systemsalready mimic basic machine learning to a certain extent [16].However, actual machine learning algorithms and cascadeneural networks can replace inverse kinematics, making a moreaccurate and reliable method of robot learning [17] [18].

2

Page 3: Autonomous Juggling Robot - Rutgers School of Engineering · Juggling has existed as a form of entertainment for over four thousand years, beginning in the Middle Kingdom in Egypt

Conversely, Open-Loop Systems operate on a set of initial,unchanging parameters. In many cases, this would lead topoorer performance as the system cannot adapt to change.However, for a predictable task such as juggling, especially intwo dimensions, the physics of the scenario does not change.This makes an open-loop system viable since it is less taxingon resources as the machine can be constructed using lesscomputing power and sensors. In order to function smoothly,a system using such an approach must be constructed tohigh precision and rigidity [19]. This task is more feasible toaccomplish before creating the closed loop system necessaryto further the study of juggling and the human brain.

E. Linear Actuators

A linear actuator functions through a rack and pinion thattranslates rotational motion into linear motion. In this project,they propel the marbles upwards on the backboard at a certainangle [20]. Through a high voltage source and the gear, thepiston is able to actuate fast enough to launch a ball andbe ready to receive another. One of the issues faced in theproject was the lack of sufficiently fast commercially-availablelinear actuators. This led to the implementation of 3D printedlinear actuators, which were capable of moving at significantlyhigher linear speeds than the commercial actuators.

F. Electronics

Arduino is an open-source electronics platform, designedto make it easy to use hardware and software [25]. For thisproject, the Arduino Uno microcontroller was used, whichutilizes C++ as its primary programming language.

Breadboards are a fundamental component for buildingcircuits. They consist of a series of electrically separate metalrails aligned both vertically and horizontally. The top of theboard contains holes where wires can be inserted. Electricalconnections can be made by plugging two wires into the samemetal rail. They allow the creation of prototype models ofvarious integrated circuits (ICs), without having to resolderthe connections each time [26].

Pulse Width Modulation (PWM) is a technique commonlyused to change an electrical component’s speed or brightness.This system uses pulsed DC current, meaning the current iseither completely on or off. By switching the current at highspeeds, with intervals in the microsecond range, the componentcan be controlled in an analog-like fashion. The amount ofcurrent delivered is related to the percentage of the time thecurrent is switched on within a given interval, known as apulse width. Pins 3, 5, 6, 9, 10, and 11 on the Arduino Unomicrocontroller support PWM, allowing the user to write avalue between 0 and 255 to a component, versus the HIGHor LOW, or on and off commands, used with digital control.

The L293 Transistor Quadruple Half-H Driver was used asa speed controller. The Driver allowed control of the motorsthrough PWM, and allows the motors to run at high voltagesand currents. [23].

III. PROCEDURE

A. Calculating Launch Angle and Velocity

The robot can control the launch angle of the ball and thelaunch velocity applied to it, each combination mapping to aspecific flight time and maximum parabolic height. Therefore,the calculations must act in reverse, determining launch angleand launch velocity from a given flight time and maximumheight as flight time is predetermined from the jugglingpattern, and the height is limited to the length of the board.To accomplish this, the initial equations of projectile motionare used:

vx =∆x

∆t(III.1)

0 = vy∆t− 1

2g sin θb∆t

2 (III.2)

Therefore,

vy =1

2g sin θb∆t (III.3)

However, ∆x changes whenever the linear actuators tilt atdifferent angles, meaning that:

∆x = d− 2l cos θl (III.4)

Therefore,

vx =d− 2l cos θl

∆t(III.5)

Having vy and vx, these values can be used to determinethe angle and velocity of the initial launch vector:

v =

√(d− 2l cos θl)

2

∆t2+

1

2g sin θb∆t2 (III.6)

0 = d tan θl − 2l sin θl −1

2g sin θb∆t

2 (III.7)

The flight time of the ball can be calculated using the quadraticequation of the ball travelling to its peak:

∆y = vy∆t− 1

2gy∆t2 (III.8)

At the x-intercepts,

vy =1

2g sin θb∆t (III.9)

At the parabola’s peak,

∆y = vy∆t

2− 1

2gy

∆t2

4(III.10)

Using vy from equation (8),

∆t =

√8∆y

g sin θb(III.11)

3

Page 4: Autonomous Juggling Robot - Rutgers School of Engineering · Juggling has existed as a form of entertainment for over four thousand years, beginning in the Middle Kingdom in Egypt

Applying to Equation (6),

0 = d tan θl − 2l sin θl − 4∆y (III.12)

Calculating the x-intercept provides the value for θl, whichcan then be applied to Equation (5) to obtain v.

WHERE:• ∆x is the distance between the launch points for each

actuator.• ∆y is the height the marble reaches in the direction of

the board.• ∆t is the flight time of the ball.• v is the launch velocity of the ball.• θb is the angle of the backboard from the horizontal.• d is the distance between the actuators when both are at

90 degrees from the horizontal• l is the length of the actuator from its point of rotation.• θl is the launch angle of the actuator from the horizontal.• g is the constant of gravitational acceleration on the

surface of Earth and is equal to 9.81 m/s2.Full calculations are given in the appendix.

B. Hardware Design

This project is similar to the Yale Planar Juggling Robot inthat it juggles in a two-dimensional plane, however, it differsthrough the means of launching and catching the balls in thejuggling process. Linear actuators will propel the balls upwardin this project, then funnels will catch the balls.

The design involves two rack and pinion systems drivenby direct-current motors. These serve as linear actuators – anelectronic piston which will shoot marbles up a board angledat 15 degrees. This simplifies the juggling to two dimensions.A rack and pinion system turns rotational energy from a motorinto linear motion using a gear driving a linear, toothed rack.The DC motors and linear actuators are each held in placeby a bracket. These brackets are rotated by servo motors tochange the angle that the linear actuators fire and where themarbles are caught. The servo motors are attached to the backof the board and connect to the brackets which are on the frontof the board through drilled sections. The funnel guides themarbles as they are propelled upwards and the wide openingat the top provides a range for the marbles to be caught in.

C. 3D Modeling and Printing

Computer-aided design (CAD) is an automated process thatfacilitates the documentation, modification, and analysis of adesign. It is used by engineers to create custom parts andvisualize their ideas. Autodesk Inventor is a software createdfor this purpose and was used during this project to designthe 3D printed parts. This software made it possible to createand dimension structures vital to the creation of the linearactuators, as well as assemble them together into one file inorder to visualize the end result.

The type of 3D printing used in this project is knownas stereolithography. This is an additive process where aCAD file is converted to an STL file, essentially slicing themodel into layers. These layers are added one at a time withfilament during the printing process to produce the model[21]. The filament used in this project is PLA which is madeof renewable resources. PLA has a low melting temperaturemaking it easy to print with. It provides accuracy and limitedwarping of the printed part [19].

The gear, rack, bracket, and funnel for the robotic armwere designed in separate part files using Autodesk Inventor, aCAD software. In order to ensure the pieces were dimensionedcorrectly and fit together, a part file for the 775pro motor wasdownloaded from VEX Robotics. The motor was a purchasedpart, therefore the dimensions of the gear, rack, and bracketwere dependent on the motor and needed to align with it. Anonline linear actuator file was downloaded and modified to fitthe motor [24].

The 775pro motor has a small gear attached to the shaft.To attach the 3D printed gear to the motor, the sketch of the775pro motor gear was used to modify the downloaded gear,making it fit around the 775pro motor gear. As the bracketis holding all the parts together, it was essential that the rackinterlocked with not only the gear, but with the bracket also.The rack was dimensioned to fit in its respective slot in thebracket. The bracket was modified to also hold the motor.Extra support was extruded onto the bracket to hold the motorin place with the rest of the parts. To ensure that the motor,gear (Figure 9), rack (Figure 10), and bracket (Figure 11) wereall dimensioned properly and worked cohesively, the part fileswere then placed into an Inventor assembly file (Figure 13).This provided a visual for the final product before the part fileswere individually sent to the 3D printer. Last, a funnel was alsomodeled on Inventor (Figure 12). All the images are locatedin Appendix A. It was needed to hold the marble in placeas it was propelled upwards as well as provide leeway whencatching the marble with the linear actuator. It was modeledfrom scratch, designed to lay flat against the board and havethe same radius as the marble.

D. Code

Figure 2 illustrates the logic behind the code, specificallyfor a three-one site-swap. Several functions are included inorder to abstract the process of operating the actuators. ThemoveServo function allows the user to control the angle eitherservo rotates to. The spinMotor function turns either 775promotor at a certain speed and for a certain duration. Theretract function pulls back an actuator by spinning a motorback for a certain length of time. Several constants such asangToServo, conversionFactor, heatAdjust,and timeAdjust areused in order to compensate for the hardware overheatingand other real world discrepancies. Several juggling patternswere pre-programmed including the one ball cascade, two ballcascade, modified three ball cascade, and a three-one site-swap. When the program begins, constants are assigned theirvalues and devices are assigned their ports and calibrated.

4

Page 5: Autonomous Juggling Robot - Rutgers School of Engineering · Juggling has existed as a form of entertainment for over four thousand years, beginning in the Middle Kingdom in Egypt

Then, both actuators are retracted and are turned to a startingangle. Finally, the loop section of the code runs, where one ofthe four juggling pattern functions are be placed.

Fig. 2. Flowchart of the Code

E. Circuitry

The circuit powering the robot was controlled by the Ar-duino Uno microcontoller, a small computer that can be usedto program and control electronic devices. The power for thiscircuit (Figure 3) was provided by a 7.5 volt power supply sothe mechanisms could run at high speeds. The moving partsinclude two servo motors, which could be set to specific anglesto rotate the actuator, and two 775pro motors which were usedto extend and retract the rack to fire marbles. The speeds of themotors were controlled using PWM by an L293 motor driver.Together these components allowed the robot to catch and firemarbles at various launch angles and launch velocities.

Fig. 3. Circuit diagram

F. Building Process

Two holes were created to fit the servo motors at thebottom of the board which were 51 cm apart. The servos weremounted onto the board with screws, and clamps supported

by wood pieces also attached to the board (Figure 5). Holeswere drilled into the 3D printed bracket so that the DC motorscould be mounted. The 3D printed bracket housed all of the3D printed parts, including the gear and rack. The funnelswere attached to the brackets using epoxy glue, and the entirebracket system was mounted to the servo motors using Loctitesuper glue (Figure 4). In addition, the board itself was raisedin the back to an angle of 15 degrees using a wood block.Wooden blocks were attached to the bracket behind the rackso that they would retract at a fixed distance each time –standardizing the launch velocity of the marble for a givenpulse-width sent through the motors. Finally, the Arduino andbreadboard were mounted to the front of the board (Figure 5).

Fig. 4. 3D printed brackets mounted to the servo motors on the front of theboard

Fig. 5. Servo motor mounted to the back of the board

G. Challenges

5

Page 6: Autonomous Juggling Robot - Rutgers School of Engineering · Juggling has existed as a form of entertainment for over four thousand years, beginning in the Middle Kingdom in Egypt

Fig. 6. Wood blocks attached behind racks. Arduino and Breadboard mountedto front of board.

IV. RESULTS

A. Applied Mathematics

Plugging in global variables for a ball at site-swap height7, the following equation is produced:

0 = 0.5 tan θl − 0.4 sin θl − 3.6

Through this, we also evaluate ∆t7 = 3.6 seconds.Solving for the x-intercept numerically provides θl = 82.87◦.This can be used to solve for v,

v =

√(0.5− 2 (0.20) cos 82.87◦)

2

3.62+

1

2(9.8) sin 15◦ (3.6)

2

Evaluating shows that v = 2.154 m/s.Because ∆t7 = 3.6 seconds, the flight time of a ball thrown

at site-swap height 1 can be calculated as:

∆t1 =∆t7

7=

3.6

7= 0.514 seconds

Using this value of t1, the other values of tx are calculated,and then applied to the equations for v and θl, as shown inTable 1.

Site-swap t (s) v (m/s) θl (◦)1 0.514 0.9939 40.98402 1.028 1.3719 71.86703 1.542 1.9780 81.36004 2.056 2.6173 85.03305 2.570 3.2644 86.79206 3.084 3.9142 87.76107 3.596 4.5649 88.3500

B. MatLab Simulation

This project used MatLab to simulate the mathematicalequations generated in Section III.A. Plotting the equationsfor all the potential site-swap heights generated a graph of theexpected trajectories (Figure 7). This required the usage ofthe values from the table in Section IV.A. The code for thissimulation is in Appendix C. According to the simulation, thevalues from the table provided working trajectories, validating

their usage for the actual robot. Some basic simplifications andassumptions were made – namely that the catch and launchoccur from the same point. This, and other minor assumptions,were determined to be negligible.

MatLab was also used to simulate the number of catches therobot could achieve before failing. Given statistical data indi-cating the chance of a catch given consistent motor speeds andservo angles, MatLab was able to calculate that, over 5 datasets of 20 catches, the robot could make an average of 2.27catches before missing a catch. The code for this simulationis in Appendix D, while the data is displayed in AppendixE. This average was extremely low, and therefore indicatedthat the robot would be unsuccessful in juggling, barring anychanges. The high variability also indicated that certain otherfactors are influencing the ball’s launch velocity other thanjust the motor speed, as despite the motor’s consistent speed,there were still variations in the ball’s trajectory.

Fig. 7. Simulated trajectories from MatLab

C. Statistical Comparison

1) Consistency of Motors: For statistical comparison inregards to the success rate of the two motors, a two-propz-test was performed. Two-prop z-tests are used to eitherreject or fail to reject a certain hypothesis, termed the nullhypothesis (H0). Should the null hypothesis be rejected, thenthere would be convincing evidence in favor of the alternativehypothesis (Ha). In this case, the null hypothesis is that thereis no difference between the success rate for each motor. Thealternative hypothesis states that there is a difference betweenthe success rate for each motor. The equation for finding thez-score in a two-prop z-test is:

z =(p̂1 − p̂2)− 0√p̂(1− p̂)( 1

n1+ 1

n2)

(IV.1)

p̂1 is the value for p1 as determined from our sample.Similarly, p̂2 is the value for p2 as determined from our

6

Page 7: Autonomous Juggling Robot - Rutgers School of Engineering · Juggling has existed as a form of entertainment for over four thousand years, beginning in the Middle Kingdom in Egypt

sample. n1 and n2 are the number of trials for p̂1 and p̂2respectively.

p̂ =successes1 + successes2

n1 + n2(IV.2)

p1 = the proportion of times when motor one launches a ballthat is successfully caught. p̂1 = 0.70.p2 = the proportion of times when motor two launches a ballthat is successfully caught. p̂2 = 0.20.Therefore,

H0 : p1 = p2

Ha : p1 6= p2

Conditions:• For p1:

– Because the data is collected functionally as a censusof the trials, there is no randomization requirement.

– 10n1 = 10(50) ≤Total number of launches =Infinite possible launches.

– n1p̂1 = (50)(0.7) = 35 ≥ 10– n1(1− p̂1) = (50)(0.3) = 15 ≥ 10

• For p2:– Because the data is collected functionally as a census

of the trials, there is no randomization requirement.– 10n1 = 10(50) ≤Total number of launches =

Infinite possible launches.– n1p̂2 = (50)(0.2) = 10 ≥ 10– n1(1− p̂2) = (50)(0.8) = 40 ≥ 10

Two-prop Z Test

Calculating p̂ from Equation IV.2 yields p̂ = 0.45. Applyingto Equation IV.1, it is found that z = 5.025. Furthermore,

p = P (z < −5.025) + P (z > 5.025) = 5.038 ∗ 10−7 (IV.3)

The significance level, α is the probability of rejecting H0

when it is true. Any value outside of the significance levelof a bell curve is deemed statistically significant because itis statistically unlikely to get that value if H0 is true. Givenα = 0.05, then p = 5.038 ∗ 10−7 < α = 0.05, therefore thedata is statistically significant. Because of this, it is possibleto reject H0.

Therefore, there is convincing evidence that the true pro-portion of successful catches differs for the two motors whenthey are programmed identically. This indicates that there arefactors other than the motor that are changing the launchvelocity, and furthermore that these factors vary in each actu-ator. Therefore, when coding, the motors will have differentconversion factors from written values to linear velocity.

2) Average Successful Consecutive Catches: To statisticallyfind an expected number of successful consecutive catches, aT-Interval was used based on successful catches made. Theactuators were set to optimal angles and launch speeds, beforepassing one ball back and forth in a one-ball cascade. Unlikethe previous test, this analysis finds an interval in which

the average exists with 95% certainty. Therefore, no null oralternative hypotheses are necessary. The equation for a T-Interval is:

x = x̄± t∗nS√n

(IV.4)

Where x is the population average for an infinite numberof tests, x̄ is the sample average, t∗n is the t value for theconfidence interval given n, S is the standard deviation, andn is the sample size.

Plugging in these values provides a T-Interval where t =(1.204, 2.729). Therefore, with 95% certainty, it can be estab-lished that the average number of successful catches the robotcan consecutively make lies between 1.204 and 2.729 catches.

D. TestingAfter having built the robot, the first test done was to shoot

a marble straight up and catch it in the same funnel. This testclearly showed that the robot was able to perform a launchand catch.

The second test was to attempt to launch the marble fromone funnel and have it caught in the other (Figure 8). After afew adjustments to the angle and launch velocity, the robot wassuccessful in achieving this task, demonstrating that rotatingwas also a successful function of the robot. Achieving this taskwas inconsistent, however, because the motors tended to rotateat different speeds each time depending on factors such as therapid heating of the L293 transistor, and the slight inaccuraciesof the 3D printed parts. Each time a test was run, the transistorwould heat up, causing the linear actuators to retract andextend slower, therefore decreasing the launch velocity of theball and its travel time. After more trials, it was determinedthat if compressed air was sprayed on the transistor while theprogram was running, there would be greater consistency withthe tests.

E. Precision and AccuracyThe most accurate angles of launch and catch were between

55 and 65 degrees. The marble was able to be launched to aheight within a range of 16 and 20 cm with an average ofapproximately 17.83 cm. The average time to perform a one-beat site-swap, or one-ball cascade, was approximately 1.4seconds. This was inconsistent with the predicted values fora one-beat site-swap based on the physical calculations donebefore the tests. A one-beat site-swap was predicted to be bestperformed at a 41 degree angle and occur in 0.51 seconds. Thephysical calculations were helpful to provide a general ideaof the values to attempt for angles of launch, initial velocity,and time between throws and catches, but multiple trials andadjustments were necessary to achieve more accurate cycles.

To calculate the robot’s ability to juggle continuously, thirtytrials of a one-ball cascade were performed utilizing the samecode each time. The number of complete cycles of catchesand throws were recorded in Table II. On average, the robotcould juggle in a one-ball cascade for 1.97 cycles. The mostcatches and throws it was able to perform was 8.

7

Page 8: Autonomous Juggling Robot - Rutgers School of Engineering · Juggling has existed as a form of entertainment for over four thousand years, beginning in the Middle Kingdom in Egypt

Fig. 8. Marble being launched from the right funnel to the left

Trial Number Height (cm)1 182 193 154 185 166 187 178 169 1710 1611 1812 1913 1714 1915 2016 1917 2018 19

TABLE IHEIGHT REACHED UP THE BOARD BY MARBLE PER TRIAL

V. CONCLUSION

A. Accomplishments

The robot was able to successfully launch and catch a sin-gular ball, perform a three-one site-swap, and it inconsistentlyaccomplished a three-ball cascade.

B. Improvements and Shortcomings

The success of the robot was highly sensitive to the tem-perature of the L293 transistor, which served as the maincause of the inconsistent results. As the transistor gained heat,resistance built up within the circuit, lowering the amountof voltage applied to the motors. Therefore, although therobot was completely assembled and capable of launching

Trial Catches Trial Catches Trial Catches1 2 11 0 21 22 1 12 2 22 23 2 13 1 23 14 7 14 1 24 05 4 15 5 25 46 0 16 1 26 27 0 17 2 27 48 8 18 1 28 19 1 19 3 29 0

10 1 20 0 30 3

TABLE IINUMBER OF CATCHES PER TRIAL WITH ONE BALL

and catching balls, timing sensitive cascades and site-swapsremained inconsistent due to hardware limitations.

If more time was available, hardware improvements wouldbe made to the robot including the use of smaller, lowercurrent-draw motors, as well as a more thermally capablespeed controller. This would eliminate the need to applycompressed-air to the transistor in order to control the tem-perature. In addition, it may have been possible to increasethe robots resemblance of human-like tendencies. Humansrotate their hands in a circular motion while juggling, but therobot moves in a linear path to accomplish the task instead.These hardware changes, along with improvements to thecode, would give the robot the ability to accomplish a highernumber of balls in a cascade and perform more difficult site-swaps.

C. Future Direction

This project is the first step to understanding the correlationbetween the thought process required for dynamic tasks andthe human brain. Now that a robot with an open-loop systemhas been created and has the capability to juggle, a closed-loopsystem can be created which can mimic the human thoughtprocess and motion through the use of sensors. Specifically,utilization of a camera to track ball trajectories along withmachine learning and computer vision algorithms would allowthe robot to adapt to dynamic conditions. This could thenbe studied to learn more about the human thought complex.What is discovered through this research could have newimplications on the human body and mind. [4].

8

Page 9: Autonomous Juggling Robot - Rutgers School of Engineering · Juggling has existed as a form of entertainment for over four thousand years, beginning in the Middle Kingdom in Egypt

APPENDIX A

Fig. 9. Dimensions of the gear

Fig. 10. Dimensions of the rack

Fig. 11. Dimensions of the bracket

Fig. 12. Dimensions of the funnel

Fig. 13. Assembled actuator in CAD

APPENDIX B

#include <Servo.h>

//Constantsconst double conversionFactor = 1;const double angToServo = 100.0/90.0;const double g = 9.81;int heatAdjust = 0;int timeAdjust = 1;

//Component PortsServo leftServo;Servo rightServo;const int leftMtrCW = 9;

9

Page 10: Autonomous Juggling Robot - Rutgers School of Engineering · Juggling has existed as a form of entertainment for over four thousand years, beginning in the Middle Kingdom in Egypt

const int leftMtrCCW = 10;const int rightMtrCW = 6;const int rightMtrCCW = 5;

//Basic Functionsvoid moveServo(String side, double ang) {if(side == "left") {

double angle = (ang + 35) *angToServo;

if(angle > leftServo.read()) {for (int pos = leftServo.read();

pos <= angle; pos += 1) {leftServo.write(pos);delay(5);

}}else {

for (int pos = leftServo.read();pos >= angle; pos -= 1) {

leftServo.write(pos);delay(5);

}}

}else if(side == "right") {

double angle = (90 - ang + 1) *angToServo;

if(angle > rightServo.read()) {for (int pos = rightServo.read();

pos <= angle; pos += 1) {rightServo.write(pos);delay(7);

}}else {

for (int pos = rightServo.read();pos >= angle; pos -= 1) {

rightServo.write(pos);delay(7);

}}

}}

void spinMotor(String side, doublevelocity, double duration) {

if(side == "left") {if(velocity >= 0) {

analogWrite(leftMtrCW, velocity *conversionFactor);

analogWrite(leftMtrCCW, 0);}else {

analogWrite(leftMtrCW, 0);analogWrite(leftMtrCCW, -1 *

velocity * conversionFactor);

}Serial.println(analogRead(10));Serial.println(analogRead(9));delay(duration);analogWrite(leftMtrCW, 0);analogWrite(leftMtrCCW, 0);

}if(side == "right") {if(velocity >= 0) {

analogWrite(rightMtrCW, velocity *conversionFactor);

analogWrite(rightMtrCCW, 0);}else {

analogWrite(rightMtrCW, 0);analogWrite(rightMtrCCW, -1 *

velocity * conversionFactor);}delay(duration);analogWrite(rightMtrCW, 0);analogWrite(rightMtrCCW, 0);

}}

void retract(String side) {spinMotor(side, -255, 300 * timeAdjust)

;timeAdjust *= 1.1;

}

void moveSide(String side, doublevelocity, double angle, doubleduration) {

moveServo(side, angle);spinMotor(side, velocity, duration);

}

//Patternsvoid oneBallCascade() {spinMotor("right", 235 + heatAdjust,

300);heatAdjust += 3;retract("right");retract("left");delay(2500);spinMotor("left", 255, 300);retract("left");delay(2500);

}

void twoBallCascade() {spinMotor("right", 228 + heatAdjust,

300);heatAdjust += 3;retract("right");

10

Page 11: Autonomous Juggling Robot - Rutgers School of Engineering · Juggling has existed as a form of entertainment for over four thousand years, beginning in the Middle Kingdom in Egypt

spinMotor("left", 255, 300);retract("left");delay(2500);spinMotor("left", 255, 300);retract("left");spinMotor("right", 228 + heatAdjust,

300);heatAdjust += 3;retract("right");delay(2500);

}

void threeBallCascade() {spinMotor("right", 244 + heatAdjust,

300);heatAdjust += 4;retract("right");retract("left");delay(250);spinMotor("left", 255, 300);retract("left");delay(250);

}

void setup() {//Intialize ComponentspinMode(leftMtrCW, OUTPUT);pinMode(leftMtrCCW, OUTPUT);pinMode(rightMtrCW, OUTPUT);pinMode(rightMtrCCW, OUTPUT);

//Retract Actuatorsretract("right");retract("left");delay(500);

//Calibrate ServosmoveServo("left", 64);moveServo("right", 64);leftServo.attach(11);rightServo.attach(3);delay(1000);

//Serial DebuggingSerial.begin(9600);

//Testing//Angle ServosmoveServo("right", 66);moveServo("left", 66);

}

void loop() {// put your main code here, to run

repeatedly:moveServo("right", 66);

moveServo("left", 66);threeBallCascade();

}

APPENDIX C

%% GSET Autonomous Juggling Robot %%% Paul Barsa, Olivia Cao, Shana Chen,

Krish Desai, Aanya Gupta% Mary Pat Reiter, Matthew VanDusen-Gross

, Ryan Wu% July 25th, 2019% This code was written for the

Autonomous Juggling Robot project inGSET 2019.

% This code simulates and plots of ballprojection for juggling based on a

% chosen pattern (ordered ball height)and angle of the backboard.

%clear; clc; close all;

% Chosen User InputsstandardT = 0.514; %desired time point

for each throwthetaB= 15;%angle of the board with

respect to the ground in degreespattern = [1 2 3 4 5 6 7]; %desired

height pattern where 7 is maximumheight, and 1 is minimum height

% Initial calculationsg = -9.81*sind(thetaB); %effect of

gravity on the ball with giveninfluence of the angle of the board

dx = []; %empty array for distance in xdy = []; %empty array for distance in ymoveFactor = 1; %initial factorh = 0; %initial h valuerefArr = [1 0.9939 40.984; 2 1.3719

71.867;3 1.9780 81.36; 4 2.617385.033; 5 3.2644 86.792; 6 3.914287.761; 7 4.5649 88.35]; %array of [pattern #, velocity, angle for theactuators

% ’for loop’ that creates the x and ypositions

for i=1:length(pattern)

x = pattern(i); %takes the ’i-th’ pattern value to use as the

t_x = standardT * x; %determinesthe t-value required for specific

11

Page 12: Autonomous Juggling Robot - Rutgers School of Engineering · Juggling has existed as a form of entertainment for over four thousand years, beginning in the Middle Kingdom in Egypt

v_o = refArr(x, 2); %takes thevelocity of the ball for thespecific pattern

theta_l = refArr(x, 3); %angle of theactuators medially where 90degrees is parallel with the sideof the board

v_x = v_o * cosd(theta_l); %breaksthe velocity into x component

v_y = v_o * sind(theta_l); %breaksthe velocity into y component

for t=0:0.02:t_x %goes from 0 secondsto the total time with intervalsof 0.02dx = [dx, h + moveFactor * v_x *

t]; %dx is the distance in thex direction

dy = [dy, v_y * t + 0.5 * g * t.ˆ 2]; %distance in the ydirection

end

moveFactor = -1 * moveFactor;h = dx(length(dx));

end

dz=dy*tand(thetaB); %creates the distancein the z direction by projecting ontothe board which is at a 15 degree

angle

%3D plot of the ball movementcomet3(dx, dy, dz); %animated 3D comet

plot of the movement of a single ballat the specified pattern, board angle,and time step

grid onxlabel(’base of board, ft’)ylabel(’side of board, ft’)zlabel(’height of board, ft’)GSETJugglingRobot.mDisplaying GSETJugglingRobot.m.

APPENDIX D

clear; clc; close all;

p = 0.70;x = [];y = [];for l=1:5

for k=1:20check = 1;

count = 0;while (check == 1)

r = rand(1);if (r > p)

check = 0;count = count - 1;

endcount = count + 1;

endx = [x, count];

endlxsum = 0;for k=1:length(x)

sum = sum + x(k);endsum/length(x)y = [y, sum/length(x)]x = [];

end

APPENDIX EData Sets

Trial Number: 1 2 3 4 51 2 0 1 0 02 1 7 2 0 03 6 0 1 4 04 4 13 0 3 05 0 7 1 7 26 4 4 0 1 77 6 0 2 4 28 2 2 4 0 29 1 1 5 0 2

10 0 0 4 2 111 0 0 5 3 312 3 1 20 0 313 0 0 1 0 014 0 2 5 3 015 2 11 1 2 216 1 2 2 0 217 3 9 5 0 318 7 0 5 3 319 0 2 1 1 120 1 0 6 0 4

Average: 2.15 3.05 3.55 1.65 1.85Standard Deviation: 2.17 4.08 4.24 1.90 1.71

Overall Average: 2.45

12

Page 13: Autonomous Juggling Robot - Rutgers School of Engineering · Juggling has existed as a form of entertainment for over four thousand years, beginning in the Middle Kingdom in Egypt

ACKNOWLEDGEMENTS

The authors of this paper would like to gratefully thankthe following: Project mentors Mary Pat Reiter, MatthewVanDusen-Gross, and Ryan Wu for their invaluable guidanceand hands-on involvement in the engineering and researchprocess; Dr. William Craelius and Dr. Troy Shinbrot forfounding the project and loaning lab equipment; Residen-tial Teaching Assistant Shravan Venkatesan for his constantassistance; Research Coordinator Helen Sagges for her as-sistance in conducting the proper research; Head CounselorMichael Higgins for his support throughout the program;Dean Jean Patrick Antoine, the Director of the New JerseyGovernor’s School of Engineering and Technology, for hismanagement and guidance; Rutgers University, Rutgers Schoolof Engineering, and the State of New Jersey for the chanceto increase knowledge, explore engineering, and open up tonew opportunities; Lockheed Martin, New Jersey Space GrantConsortium, and other corporate sponsors for the fundingof these scientific endeavours; and lastly the New JerseyGovernor’s School of Engineering and Technology Alumni fortheir continued participation and support.

REFERENCES

[1] E. Aboaf, S. Drucker, and C. Atkeson, Task-level robot learning:juggling a tennis ball more accurately, Proceedings, 1989 InternationalConference on Robotics and Automation, 1989.

[2] T. Sakaguchi et al. Motion planning and control for a robot performer,[1993] Proceedings IEEE International Conference on Robotics andAutomation, 1993.

[3] M. Truzzi, On Keeping Things Up in the Air, Natural History, Dec-1979.

[4] J. Botvinick-Greenhouse and T. Shinbrot, “Juggling Dynamics,” unpub-lished.

[5] A Brief History of Juggling. [Online]. [Accessed: 20-Jul-2019].[6] B. Polster, The mathematics of juggling. New York, NY: Springer, 2009.[7] T. Sakaguchi, Y. Masutani, and F. Miyazaki, A study on juggling tasks,

Proceedings IROS 91:IEEE/RSJ International Workshop on IntelligentRobots and Systems 91, 1991.

[17] Robot juggling: implementation of memory-based learning, IEEE Con-trol Systems, vol. 14, no. 1, pp. 5771, 1994.

[8] M. Buhler, D. Koditschek, and P. Kindlmann, A family of robot controlstrategies for intermittent dynamical environments, Proceedings, 1989International Conference on Robotics and Automation, 1990.

[9] P. J. Beek and A. Lewbel, The Science of Juggling, Scientific American,1995.

[10] P. J. Beek and M. T. Turvey, Temporal patterning in cascade juggling.,Journal of Experimental Psychology: Human Perception and Perfor-mance, vol. 18, no. 4, pp. 934947, 1992.

[11] J. Schneider and C. Brown, Robot skill learning, basis functions, andcontrol regimes, [1993] Proceedings IEEE International Conference onRobotics and Automation, 1993.

[12] G. Batz et al. Dynamic manipulation: Nonprehensile ball catching, 18thMediterranean Conference on Control and Automation, MED10, 2010.

[13] M. Yashima and T. Yamawaki, Robotic nonprehensile catching: Initialexperiments, 2014 IEEE/RSJ International Conference on IntelligentRobots and Systems, 2014.

[14] K. Onozato and Y. Maeda, Learning of inverse-dynamics and inverse-kinematics for two-link SCARA robot using neural networks, SICEAnnual Conference 2007, 2007.

[15] M. M. Schill and M. Buss, Kinematic Trajectory Planning for Dynami-cally Unconstrained Nonprehensile Joints, IEEE Robotics and Automa-tion Letters, vol. 3, no. 2, pp. 728734, 2018.

[16] D. Koditschek, Globally stable closed loops imply autonomous behavior,Proceedings. 5th IEEE International Symposium on Intelligent Control1990, 1990.

[18] K. Christman, Open Loop Juggling Machine, Scribd, Jun-2006. [Online].[Accessed: 20-Jul-2019].

[19] 2019 PLA Filament Guide All You Need to Know, All3DP, 30-Jan-2019. [Online]. [Accessed: 20-Jul-2019].

[20] H. Winther and T. Iverson, Linear Actuator.[21] F. P. Melchels, J. Feijen, and D. W. Grijpma, A review on stereolithog-

raphy and its applications in biomedical engineering, Biomaterials, vol.31, no. 24, pp. 61216130, 2010.

[22] A. M. Okamura, N. Smaby and M. R. Cutkosky, “An overview of dex-terous manipulation,” Proceedings 2000 ICRA. Millennium Conference.IEEE International Conference on Robotics and Automation. SymposiaProceedings (Cat. No.00CH37065), San Francisco, CA, USA, 2000, pp.255-262 vol.1.

[23] L293 (ACTIVE) Quadruple Half-H Drivers, Texas Instruments. [Online].[Accessed: 20-Jul-2019].

[24] Thingiverse.com, Linear Servo Actuators by potentprintables, Thingi-verse. [Online]. [Accessed: 20-Jul-2019].

[25] Introduction, Arduino. [Online]. [Accessed: 20-Jul-2019].[26] M. Short, How to use a Breadboard, Sparkfun. [Online]. [Accessed:

20-Jul-2019].

13