<<

Autonomous

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

1 Robot created in 1989, was controlled by a mirror algorithm, a closed-loop system where the position and velocity of the pucks 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 simply juggle balls without any sensor feedback. This approach has the added benefit of simplicity and cost efficacy, while still maintaining entertainment value. B. Spatial Awareness Humans have an innate spatial awareness that allow them to track the balls they are juggling without vision, and pre- dict where the balls will land in order to catch them. This project seeks to recreate the intrinsic property of the brain to predict an object’s trajectory and act accordingly. One theory that has been proposed to explain this phenomenon is the Fig. 1. Ladder diagram of five-three-one site-swap notation. “muscle memory” explanation. It claims that jugglers, after a certain amount of practice, have encoded responses to ball trajectories and hand movements in their brain so that they and R in the diagram represent the left and right hand of the move subconsciously. Another theory suggests that the brain juggler. The five-three-one pattern across the of Figure 1 is able to determine the equations of motion rapidly to catch denotes that this ladder is representative of a five-three-one and throw the balls [4]. site-swap and guides the user in determining where to draw lines between the left and right hand. Above beat 1, there is a C. Site-swap Patterns 5. This means the first ball will be thrown in the air for 5 beats This project attempts to perform site-swap juggling which before being caught on beat 6 which is on the right-hand-side changes the beats at which the balls are thrown. To represent of the ladder. Above beat 2 is a 3. This means that the second this, Michael Day from the University of Cambridge, Paul ball will be thrown and caught within 3 beats ending in the Klimek from the University of California, Santa Cruz, and left hand. Above beat 3, there is a 1, meaning that the third Bruce Tiemann from the California Institute of Technology ball will be thrown and caught within 1 beat ending in the created site-swap notation in 1985 [9]. right hand. Then by following the colored arrow paths, the Site-swaps are denoted by the time intervals, or beats, viewer can visualize the pattern that the three balls follow in between throws. For instance, in a three-ball cascade (throwing a five-three-one site-swap. three balls in symmetrical arcs to the other hand), the first ball The ratio between the time the robot takes to catch and would be thrown on beats 1, 4, 7, etc.; the second ball would throw a ball and the time between catches is approximately 3:4 be thrown on beats 2, 5, 8, etc.; the third ball would be thrown [10]. This can aid in determining juggling patterns. However, on beats 3, 6, 9, etc. The site-swap notation for a three-ball as the number of balls increases, the ratio approaches 1:1. This cascade is denoted by a 3 since each ball is thrown after three suggests that there are limitations to the amount of balls that beats. can be juggled. In site-swaps, every ball has a respective ratio In this scenario, all of the balls were thrown within the and must be accounted for. same amount of beats each time. However, in a five-three-one site-swap, the ball thrown horizontally spends less time in the D. Open-Loop and Closed-Loop Strategies air compared to the balls thrown in the arcs. The first ball is One of the primary facets of human juggling is the feedback thrown and caught within five beats, the second ball is thrown loop that allows humans to not have to focus on all the balls and caught within three beats, and the third ball is thrown at the same time. Closed-Loop Systems are related to control and caught within one beat. The first ball would be thrown theory and reactive systems in that they take information from on beats 1, 6, 7, 12, etc. The second ball would be thrown on the end of the system and use that information to modify initial beats 2, 5, 8, 11, etc. The third ball would be thrown on beats parameters [11]. Many times, closed loop systems tend to use 3, 4, 9, 10, etc. computer vision software to determine inconsistencies within All site-swap notations can determine the amount of balls the trajectory of the ball [12] [13]. From that data, using needed to perform the trick by adding up all of the numbers inverse kinematics, the required corrections can be made to and averaging this value by the amount of numbers present. the launch vector [14] [15]. The next step up from closed- For instance, the average of 5, 3, and 1 provides a total of loop systems is artificial intelligence and closed-loop systems three balls necessary to perform a five-three-one site-swap. already mimic basic machine learning to a certain extent [16]. Diagrams such as the ladder diagram in Figure 1 can be However, actual machine learning algorithms and cascade used to visualize this. The numbers below the ladder marks neural networks can replace inverse kinematics, making a more represent the beats, or time intervals, between throws. The L accurate and reliable method of [17] [18].

2 Conversely, Open-Loop Systems operate on a set of initial, III.PROCEDURE unchanging parameters. In many cases, this would lead to A. Calculating Launch Angle and Velocity poorer performance as the system cannot adapt to change. However, for a predictable task such as juggling, especially in The robot can control the launch angle of the ball and the two dimensions, the physics of the scenario does not change. launch velocity applied to it, each combination mapping to a This makes an open-loop system viable since it is less taxing specific flight time and maximum parabolic height. Therefore, on resources as the machine can be constructed using less the calculations must act in reverse, determining launch angle computing power and sensors. In order to function smoothly, and launch velocity from a given flight time and maximum a system using such an approach must be constructed to height as flight time is predetermined from the juggling high precision and rigidity [19]. This task is more feasible to pattern, and the height is limited to the length of the board. accomplish before creating the closed loop system necessary To accomplish this, the initial equations of projectile motion are used: to further the study of juggling and the human brain. ∆x v = (III.1) x ∆t E. Linear Actuators 1 0 = v ∆t − g sin θ ∆t2 (III.2) A linear actuator functions through a rack and pinion that y 2 b translates rotational motion into linear motion. In this project, they propel the marbles upwards on the backboard at a certain Therefore, angle [20]. Through a high voltage source and the gear, the 1 vy = g sin θb∆t (III.3) piston is able to actuate fast enough to launch a ball and 2 be ready to receive another. One of the issues faced in the However, ∆x changes whenever the linear actuators tilt at project was the lack of sufficiently fast commercially-available different angles, meaning that: linear actuators. This led to the implementation of 3D printed linear actuators, which were capable of moving at significantly ∆x = d − 2l cos θl (III.4) higher linear speeds than the commercial actuators. Therefore, F. Electronics d − 2l cos θl v = (III.5) x ∆t Arduino is an open-source electronics platform, designed to make it easy to use hardware and software [25]. For this Having vy and vx, these values can be used to determine project, the Arduino Uno microcontroller was used, which the angle and velocity of the initial launch vector: s utilizes C++ as its primary programming language. 2 (d − 2l cos θl) 1 2 Breadboards are a fundamental component for building v = + g sin θb∆t (III.6) circuits. They consist of a series of electrically separate metal ∆t2 2 rails aligned both vertically and horizontally. The top of the 1 0 = d tan θ − 2l sin θ − g sin θ ∆t2 (III.7) board contains holes where wires can be inserted. Electrical l l 2 b connections can be made by plugging two wires into the same metal rail. They allow the creation of prototype models of The flight time of the ball can be calculated using the quadratic various integrated circuits (ICs), without having to resolder equation of the ball travelling to its peak: the connections each time [26]. Pulse Width Modulation (PWM) is a technique commonly 1 2 ∆y = vy∆t − gy∆t (III.8) used to change an electrical component’s speed or brightness. 2 This system uses pulsed DC current, meaning the current is either completely on or off. By switching the current at high At the x-intercepts, speeds, with intervals in the microsecond range, the component 1 v = g sin θ ∆t (III.9) can be controlled in an analog-like fashion. The amount of y 2 b current delivered is related to the percentage of the time the current is switched on within a given interval, known as a At the parabola’s peak, pulse width. Pins 3, 5, 6, 9, 10, and 11 on the Arduino Uno microcontroller support PWM, allowing the user to write a ∆t 1 ∆t2 ∆y = v − g (III.10) value between 0 and 255 to a component, versus the HIGH y 2 2 y 4 or LOW, or on and off commands, used with digital control.

The L293 Transistor Quadruple Half-H Driver was used as Using vy from equation (8), a speed controller. The Driver allowed control of the motors s through PWM, and allows the motors to run at high voltages 8∆y ∆t = (III.11) and currents. [23]. g sin θb

3 The type of 3D printing used in this project is known Applying to Equation (6), as stereolithography. This is an additive process where a CAD file is converted to an STL file, essentially slicing the 0 = d tan θl − 2l sin θl − 4∆y (III.12) model into layers. These layers are added one at a time with filament during the printing process to produce the model [21]. The filament used in this project is PLA which is made Calculating the x-intercept provides the value for θl, which can then be applied to Equation (5) to obtain v. of renewable resources. PLA has a low melting temperature making it easy to print with. It provides accuracy and limited WHERE: warping of the printed part [19]. The gear, rack, bracket, and funnel for the • ∆x is the distance between the launch points for each were designed in separate part files using Autodesk Inventor, a actuator. CAD software. In order to ensure the pieces were dimensioned • ∆y is the height the marble reaches in the direction of correctly and fit together, a part file for the 775pro motor was the board. downloaded from VEX . The motor was a purchased • ∆t is the flight time of the ball. part, therefore the dimensions of the gear, rack, and bracket • v is the launch velocity of the ball. were dependent on the motor and needed to align with it. An • θ is the angle of the backboard from the horizontal. b online linear actuator file was downloaded and modified to fit • d is the distance between the actuators when both are at the motor [24]. 90 degrees from the horizontal The 775pro motor has a small gear attached to the shaft. • l is the length of the actuator from its point of rotation. To attach the 3D printed gear to the motor, the sketch of the • θ is the launch angle of the actuator from the horizontal. l 775pro motor gear was used to modify the downloaded gear, • g is the constant of gravitational acceleration on the making it fit around the 775pro motor gear. As the bracket surface of Earth and is equal to 9.81 m/s2. is holding all the parts together, it was essential that the rack Full calculations are given in the appendix. interlocked with not only the gear, but with the bracket also. The rack was dimensioned to fit in its respective slot in the B. Hardware Design bracket. The bracket was modified to also hold the motor. This project is similar to the Yale Planar Juggling Robot in Extra support was extruded onto the bracket to hold the motor that it juggles in a two-dimensional plane, however, it differs in place with the rest of the parts. To ensure that the motor, through the means of launching and catching the balls in the gear (Figure 9), rack (Figure 10), and bracket (Figure 11) were juggling process. Linear actuators will propel the balls upward all dimensioned properly and worked cohesively, the part files in this project, then funnels will catch the balls. were then placed into an Inventor assembly file (Figure 13). The design involves two rack and pinion systems driven This provided a visual for the final product before the part files by direct-current motors. These serve as linear actuators – an were individually sent to the 3D printer. Last, a funnel was also electronic piston which will shoot marbles up a board angled modeled on Inventor (Figure 12). All the images are located at 15 degrees. This simplifies the juggling to two dimensions. in Appendix A. It was needed to hold the marble in place A rack and pinion system turns rotational energy from a motor as it was propelled upwards as well as provide leeway when into linear motion using a gear driving a linear, toothed rack. catching the marble with the linear actuator. It was modeled The DC motors and linear actuators are each held in place from scratch, designed to lay flat against the board and have by a bracket. These brackets are rotated by servo motors to the same radius as the marble. change the angle that the linear actuators fire and where the marbles are caught. The servo motors are attached to the back D. Code of the board and connect to the brackets which are on the front Figure 2 illustrates the logic behind the code, specifically of the board through drilled sections. The funnel guides the for a three-one site-swap. Several functions are included in marbles as they are propelled upwards and the wide opening order to abstract the process of operating the actuators. The at the top provides a range for the marbles to be caught in. moveServo function allows the user to control the angle either servo rotates to. The spinMotor function turns either 775pro C. 3D Modeling and Printing motor at a certain speed and for a certain duration. The Computer-aided design (CAD) is an automated process that retract function pulls back an actuator by spinning a motor facilitates the documentation, modification, and analysis of a back for a certain length of time. Several constants such as design. It is used by engineers to create custom parts and angToServo, conversionFactor, heatAdjust,and timeAdjust are visualize their ideas. Autodesk Inventor is a software created used in order to compensate for the hardware overheating for this purpose and was used during this project to design and other real world discrepancies. Several juggling patterns the 3D printed parts. This software made it possible to create were pre-programmed including the one ball cascade, two ball and dimension structures vital to the creation of the linear cascade, modified three ball cascade, and a three-one site- actuators, as well as assemble them together into one file in swap. When the program begins, constants are assigned their order to visualize the end result. values and devices are assigned their ports and calibrated.

4 Then, both actuators are retracted and are turned to a starting by wood pieces also attached to the board (Figure 5). Holes angle. Finally, the loop section of the code runs, where one of were drilled into the 3D printed bracket so that the DC motors the four juggling pattern functions are be placed. could be mounted. The 3D printed bracket housed all of the 3D printed parts, including the gear and rack. The funnels were attached to the brackets using epoxy glue, and the entire bracket system was mounted to the servo motors using Loctite super glue (Figure 4). In addition, the board itself was raised in the back to an angle of 15 degrees using a wood block. Wooden blocks were attached to the bracket behind the rack so that they would retract at a fixed distance each time – standardizing the launch velocity of the marble for a given pulse-width sent through the motors. Finally, the Arduino and breadboard were mounted to the front of the board (Figure 5).

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 used to program and control electronic devices. The power for this circuit (Figure 3) was provided by a 7.5 volt power supply so the mechanisms could run at high speeds. The moving parts Fig. 4. 3D printed brackets mounted to the servo motors on the front of the include two servo motors, which could be set to specific angles board to rotate the actuator, and two 775pro motors which were used to extend and retract the rack to fire marbles. The speeds of the motors were controlled using PWM by an L293 motor driver. Together these components allowed the robot to catch and fire marbles at various launch angles and launch velocities.

Fig. 3. Circuit diagram

F. Building Process Fig. 5. Servo motor mounted to the back of the board Two holes were created to fit the servo motors at the bottom of the board which were 51 cm apart. The servos were mounted onto the board with screws, and clamps supported G. Challenges

5 their usage for the actual robot. Some basic simplifications and assumptions were made – namely that the catch and launch occur from the same point. This, and other minor assumptions, were determined to be negligible. MatLab was also used to simulate the number of catches the robot could achieve before failing. Given statistical data indi- cating the chance of a catch given consistent motor speeds and servo angles, MatLab was able to calculate that, over 5 data sets of 20 catches, the robot could make an average of 2.27 catches before missing a catch. The code for this simulation is in Appendix D, while the data is displayed in Appendix E. This average was extremely low, and therefore indicated that the robot would be unsuccessful in juggling, barring any Fig. 6. Wood blocks attached behind racks. Arduino and Breadboard mounted changes. The high variability also indicated that certain other to front of board. factors are influencing the ball’s launch velocity other than just the motor speed, as despite the motor’s consistent speed, IV. RESULTS there were still variations in the ball’s trajectory. A. Applied Mathematics Plugging in global variables for a ball at site-swap height 7, 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, s (0.5 − 2 (0.20) cos 82.87◦)2 1 v = + (9.8) sin 15◦ (3.6)2 3.62 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: ∆t 3.6 ∆t = 7 = = 0.514 seconds 1 7 7 Fig. 7. Simulated trajectories from MatLab

Using this value of t1, the other values of tx are calculated, and then applied to the equations for v and θl, as shown in Table 1. C. Statistical Comparison ◦ Site-swap t (s) v (m/s) θl ( ) 1) Consistency of Motors: For statistical comparison in 1 0.514 0.9939 40.9840 regards to the success rate of the two motors, a two-prop 2 1.028 1.3719 71.8670 z-test was performed. Two-prop z-tests are used to either 3 1.542 1.9780 81.3600 reject or fail to reject a certain hypothesis, termed the null 4 2.056 2.6173 85.0330 hypothesis (H0). Should the null hypothesis be rejected, then 5 2.570 3.2644 86.7920 there would be convincing evidence in favor of the alternative 6 3.084 3.9142 87.7610 hypothesis (Ha). In this case, the null hypothesis is that there 7 3.596 4.5649 88.3500 is no difference between the success rate for each motor. The alternative hypothesis states that there is a difference between B. MatLab Simulation the success rate for each motor. The equation for finding the This project used MatLab to simulate the mathematical z-score in a two-prop z-test is: equations generated in Section III.A. Plotting the equations (p ˆ1 − pˆ2) − 0 for all the potential site-swap heights generated a graph of the z = q (IV.1) expected trajectories (Figure 7). This required the usage of pˆ(1 − pˆ)( 1 + 1 ) n1 n2 the values from the table in Section IV.A. The code for this simulation is in Appendix C. According to the simulation, the pˆ1 is the value for p1 as determined from our sample. values from the table provided working trajectories, validating Similarly, pˆ2 is the value for p2 as determined from our

6 sample. n1 and n2 are the number of trials for pˆ1 and pˆ2 the average exists with 95% certainty. Therefore, no null or respectively. alternative hypotheses are necessary. The equation for a T- Interval is: successes1 + successes2 S pˆ = (IV.2) x =x ¯ ± t∗ √ (IV.4) n1 + n2 n n p = the proportion of times when motor one launches a ball Where x is the population average for an infinite number 1 x¯ t∗ that is successfully caught. pˆ = 0.70. of tests, is the sample average, n is the t value for the 1 n S p = the proportion of times when motor two launches a ball confidence interval given , is the standard deviation, and 2 n that is successfully caught. pˆ = 0.20. is the sample size. 2 Plugging in these values provides a T-Interval where t = Therefore, (1.204, 2.729) H : p = p . Therefore, with 95% certainty, it can be estab- 0 1 2 lished that the average number of successful catches the robot Ha : p1 6= p2 can consecutively make lies between 1.204 and 2.729 catches. D. Testing Conditions: After having built the robot, the first test done was to shoot • For p1: a marble straight up and catch it in the same funnel. This test – Because the data is collected functionally as a census clearly showed that the robot was able to perform a launch of the trials, there is no randomization requirement. and catch. – 10n1 = 10(50) ≤Total number of launches = The second test was to attempt to launch the marble from Infinite possible launches. one funnel and have it caught in the other (Figure 8). After a – n1pˆ1 = (50)(0.7) = 35 ≥ 10 few adjustments to the angle and launch velocity, the robot was – n1(1 − pˆ1) = (50)(0.3) = 15 ≥ 10 successful in achieving this task, demonstrating that rotating was also a successful function of the robot. Achieving this task • For p2: was inconsistent, however, because the motors tended to rotate – Because the data is collected functionally as a census at different speeds each time depending on factors such as the of the trials, there is no randomization requirement. rapid heating of the L293 transistor, and the slight inaccuracies – 10n = 10(50) ≤Total number of launches = 1 of the 3D printed parts. Each time a test was run, the transistor Infinite possible launches. would heat up, causing the linear actuators to retract and – n pˆ = (50)(0.2) = 10 ≥ 10 1 2 extend slower, therefore decreasing the launch velocity of the – n (1 − pˆ ) = (50)(0.8) = 40 ≥ 10 1 2 ball and its travel time. After more trials, it was determined Two-prop Z Test that if compressed air was sprayed on the transistor while the program was running, there would be greater consistency with Calculating pˆ from Equation IV.2 yields pˆ = 0.45. Applying the tests. to Equation IV.1, it is found that z = 5.025. Furthermore, E. Precision and Accuracy p = P (z < −5.025) + P (z > 5.025) = 5.038 ∗ 10−7 (IV.3) The most accurate angles of launch and catch were between The significance level, α is the probability of rejecting H0 55 and 65 degrees. The marble was able to be launched to a when it is true. Any value outside of the significance level height within a range of 16 and 20 cm with an average of of a bell curve is deemed statistically significant because it approximately 17.83 cm. The average time to perform a one- is statistically unlikely to get that value if H0 is true. Given beat site-swap, or one-ball cascade, was approximately 1.4 α = 0.05, then p = 5.038 ∗ 10−7 < α = 0.05, therefore the seconds. This was inconsistent with the predicted values for data is statistically significant. Because of this, it is possible a one-beat site-swap based on the physical calculations done to reject H0. before the tests. A one-beat site-swap was predicted to be best Therefore, there is convincing evidence that the true pro- performed at a 41 degree angle and occur in 0.51 seconds. The portion of successful catches differs for the two motors when physical calculations were helpful to provide a general idea they are programmed identically. This indicates that there are of the values to attempt for angles of launch, initial velocity, factors other than the motor that are changing the launch and time between throws and catches, but multiple trials and velocity, and furthermore that these factors vary in each actu- adjustments were necessary to achieve more accurate cycles. ator. Therefore, when coding, the motors will have different To calculate the robot’s ability to juggle continuously, thirty conversion factors from written values to linear velocity. trials of a one-ball cascade were performed utilizing the same 2) Average Successful Consecutive Catches: To statistically code each time. The number of complete cycles of catches find an expected number of successful consecutive catches, a and throws were recorded in Table II. On average, the robot T-Interval was used based on successful catches made. The could juggle in a one-ball cascade for 1.97 cycles. The most actuators were set to optimal angles and launch speeds, before catches and throws it was able to perform was 8. one ball back and forth in a one-ball cascade. Unlike the previous test, this analysis finds an interval in which

7 Trial Catches Trial Catches Trial Catches 1 2 11 0 21 2 2 1 12 2 22 2 3 2 13 1 23 1 4 7 14 1 24 0 5 4 15 5 25 4 6 0 16 1 26 2 7 0 17 2 27 4 8 8 18 1 28 1 9 1 19 3 29 0 10 1 20 0 30 3

TABLE II NUMBEROFCATCHESPERTRIALWITHONEBALL

and catching balls, timing sensitive cascades and site-swaps remained inconsistent due to hardware limitations. If more time was available, hardware improvements would be made to the robot including the use of smaller, lower current-draw motors, as well as a more thermally capable speed controller. This would eliminate the need to apply compressed-air to the transistor in order to control the tem- perature. In addition, it may have been possible to increase Fig. 8. Marble being launched from the right funnel to the left the robots resemblance of human-like tendencies. Humans rotate their hands in a circular motion while juggling, but the Trial Number Height (cm) robot moves in a linear path to accomplish the task instead. 1 18 2 19 These hardware changes, along with improvements to the 3 15 code, would give the robot the ability to accomplish a higher 4 18 number of balls in a cascade and perform more difficult site- 5 16 6 18 swaps. 7 17 8 16 C. Future Direction 9 17 10 16 This project is the first step to understanding the correlation 11 18 between the thought process required for dynamic tasks and 12 19 the human brain. Now that a robot with an open-loop system 13 17 14 19 has been created and has the capability to juggle, a closed-loop 15 20 system can be created which can mimic the human thought 16 19 process and motion through the use of sensors. Specifically, 17 20 18 19 utilization of a camera to track ball trajectories along with machine learning and computer vision algorithms would allow TABLE I the robot to adapt to dynamic conditions. This could then HEIGHTREACHEDUPTHEBOARDBYMARBLEPERTRIAL be studied to learn more about the human thought complex. What is discovered through this research could have new implications on the human body and mind. [4]. 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 inconsistently accomplished 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 main cause of the inconsistent results. As the transistor gained heat, resistance built up within the circuit, lowering the amount of voltage applied to the motors. Therefore, although the robot was completely assembled and capable of launching

8 APPENDIX A

Fig. 12. Dimensions of the funnel

Fig. 9. Dimensions of the gear

Fig. 10. Dimensions of the rack

Fig. 13. Assembled actuator in CAD

APPENDIX B

#include

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

//Component Ports Fig. 11. Dimensions of the bracket Servo leftServo; Servo rightServo; const int leftMtrCW = 9;

9 const int leftMtrCCW = 10; } const int rightMtrCW = 6; Serial.println(analogRead(10)); const int rightMtrCCW = 5; Serial.println(analogRead(9)); delay(duration); //Basic Functions analogWrite(leftMtrCW, 0); void moveServo(String side, double ang) { analogWrite(leftMtrCCW, 0); if(side =="left"){ } double angle = (ang + 35) * if(side =="right"){ angToServo; if(velocity >= 0) { if(angle > leftServo.read()) { analogWrite(rightMtrCW, velocity * for(int pos = leftServo.read(); conversionFactor); pos <= angle; pos += 1) { analogWrite(rightMtrCCW, 0); leftServo.write(pos); } delay(5); else{ } analogWrite(rightMtrCW, 0); } analogWrite(rightMtrCCW, -1 * else{ velocity * conversionFactor); for(int pos = leftServo.read(); } pos >= angle; pos -= 1) { delay(duration); leftServo.write(pos); analogWrite(rightMtrCW, 0); delay(5); analogWrite(rightMtrCCW, 0); } } } } } else if(side =="right"){ void retract(String side) { double angle = (90 - ang + 1) * spinMotor(side, -255, 300 * timeAdjust) angToServo; ; if(angle > rightServo.read()) { timeAdjust *= 1.1; for(int pos = rightServo.read(); } pos <= angle; pos += 1) { rightServo.write(pos); void moveSide(String side, double delay(7); velocity, double angle, double } duration) { } moveServo(side, angle); else{ spinMotor(side, velocity, duration); for(int pos = rightServo.read(); } pos >= angle; pos -= 1) { rightServo.write(pos); delay(7); //Patterns } void oneBallCascade() { } spinMotor("right", 235 + heatAdjust, } 300); } heatAdjust += 3; retract("right"); void spinMotor(String side, double retract("left"); velocity, double duration) { delay(2500); if(side =="left"){ spinMotor("left", 255, 300); if(velocity >= 0) { retract("left"); analogWrite(leftMtrCW, velocity * delay(2500); conversionFactor); } analogWrite(leftMtrCCW, 0); } void twoBallCascade() { else{ spinMotor("right", 228 + heatAdjust, analogWrite(leftMtrCW, 0); 300); analogWrite(leftMtrCCW, -1 * heatAdjust += 3; velocity * conversionFactor); retract("right");

10 spinMotor("left", 255, 300); moveServo("left", 66); retract("left"); threeBallCascade(); delay(2500); spinMotor("left", 255, 300); } retract("left"); spinMotor("right", 228 + heatAdjust, APPENDIX C 300); heatAdjust += 3; %% GSET Autonomous Juggling Robot %% retract("right"); % Paul Barsa, Olivia Cao, Shana Chen, delay(2500); Krish Desai, Aanya Gupta } % Mary Pat Reiter, Matthew VanDusen-Gross , Ryan Wu void threeBallCascade() { % July 25th, 2019 spinMotor("right", 244 + heatAdjust, % This code was written for the 300); Autonomous Juggling Robot project in heatAdjust += 4; GSET 2019. retract("right"); % This code simulates and plots of ball retract("left"); projection for juggling based on a delay(250); % chosen pattern (ordered ball height) spinMotor("left", 255, 300); and angle of the backboard. retract("left"); delay(250); % } clear; clc; close all; void setup() { % Chosen User Inputs //Intialize Components standardT = 0.514; %desired time point pinMode(leftMtrCW, OUTPUT); for each throw pinMode(leftMtrCCW, OUTPUT); thetaB= 15;%angle of the board with pinMode(rightMtrCW, OUTPUT); respect to the ground in degrees pinMode(rightMtrCCW, OUTPUT); pattern = [1 2 3 4 5 6 7]; %desired height pattern where 7 is maximum //Retract Actuators height, and 1 is minimum height retract("right"); retract("left"); % Initial calculations delay(500); g = -9.81*sind(thetaB); %effect of gravity on the ball with given //Calibrate Servos influence of the angle of the board moveServo("left", 64); dx = []; %empty array for distance in x moveServo("right", 64); dy = []; %empty array for distance in y leftServo.attach(11); moveFactor = 1; %initial factor rightServo.attach(3); h = 0; %initial h value delay(1000); refArr = [1 0.9939 40.984; 2 1.3719 71.867;3 1.9780 81.36; 4 2.6173 //Serial Debugging 85.033; 5 3.2644 86.792; 6 3.9142 Serial.begin(9600); 87.761; 7 4.5649 88.35]; %array of [ pattern #, velocity, angle for the //Testing actuators //Angle Servos moveServo("right", 66); %’for loop’ that creates the x andy moveServo("left", 66); positions } for i=1:length(pattern) void loop() { x = pattern(i); %takes the’i // put your main code here, to run -th’ pattern value to use as the repeatedly: t_x = standardT * x; %determines moveServo("right", 66); the t-value required for specific

11 v_o = refArr(x, 2); %takes the count = 0; velocity of the ball for the while (check == 1) specific pattern r = rand(1); theta_l = refArr(x, 3); %angle of the if (r > p) actuators medially where 90 check = 0; degrees is parallel with the side count = count - 1; of the board end count = count + 1; v_x = v_o * cosd(theta_l); %breaks end the velocity into x component x = [x, count]; v_y = v_o * sind(theta_l); %breaks end the velocity into y component l x for t=0:0.02:t_x %goes from 0 seconds sum = 0; to the total time with intervals for k=1:length(x) of 0.02 sum = sum + x(k); dx = [dx, h + moveFactor * v_x * end t]; %dx is the distance in the sum/length(x) x direction y = [y, sum/length(x)] dy = [dy, v_y * t + 0.5 * g * t x = []; .ˆ 2]; %distance in the y end direction APPENDIX E Data Sets end Trial Number: 1 2 3 4 5 1 2 0 1 0 0 moveFactor = -1 * moveFactor; h = dx(length(dx)); 2 1 7 2 0 0 3 6 0 1 4 0 end 4 4 13 0 3 0 5 0 7 1 7 2 6 4 4 0 1 7 dz=dy*tand(thetaB); %creates the distance in the z direction by projecting onto 7 6 0 2 4 2 the board which is at a 15 degree 8 2 2 4 0 2 angle 9 1 1 5 0 2 10 0 0 4 2 1 %3D plot of the ball movement 11 0 0 5 3 3 comet3(dx, dy, dz); %animated 3D comet 12 3 1 20 0 3 plot of the movement of a single ball 13 0 0 1 0 0 at the specified pattern, board angle, 14 0 2 5 3 0 and time step 15 2 11 1 2 2 grid on 16 1 2 2 0 2 xlabel(’base of board, ft’) 17 3 9 5 0 3 ylabel(’side of board, ft’) 18 7 0 5 3 3 zlabel(’height of board, ft’) 19 0 2 1 1 1 GSETJugglingRobot.m 20 1 0 6 0 4 Displaying GSETJugglingRobot.m. Average: 2.15 3.05 3.55 1.65 1.85 Standard Deviation: 2.17 4.08 4.24 1.90 1.71 APPENDIX D Overall Average: 2.45 clear; clc; close all; p = 0.70; x = []; y = []; for l=1:5 for k=1:20 check = 1;

12 ACKNOWLEDGEMENTS [8] M. Buhler, D. Koditschek, and P. Kindlmann, A family of strategies for intermittent dynamical environments, Proceedings, 1989 The authors of this paper would like to gratefully thank International Conference on Robotics and , 1990. the following: Project mentors Mary Pat Reiter, Matthew [9] P. J. Beek and A. Lewbel, The Science of Juggling, Scientific American, VanDusen-Gross, and Ryan Wu for their invaluable guidance 1995. and hands-on involvement in the engineering and research [10] P. J. Beek and M. T. Turvey, Temporal patterning in cascade juggling., Journal of Experimental Psychology: Human Perception and Perfor- process; Dr. William Craelius and Dr. Troy Shinbrot for mance, vol. 18, no. 4, pp. 934947, 1992. founding the project and loaning lab equipment; Residen- [11] J. Schneider and C. Brown, Robot skill learning, basis functions, and tial Teaching Assistant Shravan Venkatesan for his constant control regimes, [1993] Proceedings IEEE International Conference on assistance; Research Coordinator Helen Sagges for her as- Robotics and Automation, 1993. [12] G. Batz et al. Dynamic manipulation: Nonprehensile ball catching, 18th sistance in conducting the proper research; Head Counselor Mediterranean Conference on Control and Automation, MED10, 2010. Michael Higgins for his support throughout the program; [13] M. Yashima and T. Yamawaki, Robotic nonprehensile catching: Initial Dean Jean Patrick Antoine, the Director of the New Jersey experiments, 2014 IEEE/RSJ International Conference on Intelligent Governor’s School of Engineering and Technology, for his Robots and Systems, 2014. [14] K. Onozato and Y. Maeda, Learning of inverse-dynamics and inverse- management and guidance; Rutgers University, Rutgers School kinematics for two-link SCARA robot using neural networks, SICE of Engineering, and the State of New Jersey for the chance Annual Conference 2007, 2007. to increase knowledge, explore engineering, and open up to [15] M. M. Schill and M. Buss, Kinematic Trajectory Planning for Dynami- cally Unconstrained Nonprehensile Joints, IEEE Robotics and Automa- new opportunities; Lockheed Martin, New Jersey Space Grant tion Letters, vol. 3, no. 2, pp. 728734, 2018. Consortium, and other corporate sponsors for the funding [16] D. Koditschek, Globally stable closed loops imply autonomous behavior, of these scientific endeavours; and lastly the New Jersey Proceedings. 5th IEEE International Symposium on Intelligent Control Governor’s School of Engineering and Technology Alumni for 1990, 1990. [18] K. Christman, Open Loop Juggling Machine, Scribd, Jun-2006. [Online]. their continued participation and support. [Accessed: 20-Jul-2019]. [19] 2019 PLA Filament Guide All You Need to Know, All3DP, 30-Jan- REFERENCES 2019. [Online]. [Accessed: 20-Jul-2019]. [1] E. Aboaf, S. Drucker, and C. Atkeson, Task-level robot learning: [20] H. Winther and T. Iverson, Linear Actuator. juggling a tennis ball more accurately, Proceedings, 1989 International [21] F. P. Melchels, J. Feijen, and D. W. Grijpma, A review on stereolithog- Conference on Robotics and Automation, 1989. raphy and its applications in biomedical engineering, Biomaterials, vol. [2] T. Sakaguchi et al. Motion planning and control for a robot performer, 31, no. 24, pp. 61216130, 2010. [1993] Proceedings IEEE International Conference on Robotics and [22] A. M. Okamura, N. Smaby and M. R. Cutkosky, “An overview of dex- Automation, 1993. terous manipulation,” Proceedings 2000 ICRA. Millennium Conference. [3] M. Truzzi, On Keeping Things Up in the Air, Natural History, Dec- IEEE International Conference on Robotics and Automation. Symposia 1979. Proceedings (Cat. No.00CH37065), San Francisco, CA, USA, 2000, pp. [4] J. Botvinick-Greenhouse and T. Shinbrot, “Juggling Dynamics,” unpub- 255-262 vol.1. lished. [23] L293 (ACTIVE) Quadruple Half-H Drivers, Texas Instruments. [Online]. [5] A Brief . [Online]. [Accessed: 20-Jul-2019]. [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, [24] Thingiverse.com, Linear Servo Actuators by potentprintables, Thingi- Proceedings IROS 91:IEEE/RSJ International Workshop on Intelligent verse. [Online]. [Accessed: 20-Jul-2019]. Robots and Systems 91, 1991. [25] Introduction, Arduino. [Online]. [Accessed: 20-Jul-2019]. [17] Robot juggling: implementation of memory-based learning, IEEE Con- [26] M. Short, How to use a Breadboard, Sparkfun. [Online]. [Accessed: trol Systems, vol. 14, no. 1, pp. 5771, 1994. 20-Jul-2019].

13