NATIONAL SCIENCE FOUNDATION
TOKYO REGIONAL OFFICE


The National Science Foundation's (NSF) Tokyo Office periodically receives and disseminates reports on research developments in Japan that are related to the Foundation's mission. NSF-sponsored researchers currently working in Japan prepare many of these reports. These reports present information for use by NSF program managers and policy makers; they are not statements of NSF policy.



 

Special Scientific Report #99-14 (October 1, 1999)



Phantom Robot Bouncing Ball Project



Ms. Carlotta A. Johnson, a Ph.D. student in the Department of Electrical Engineering at Vanderbilt University, prepared the following report. Ms. Johnson was a participant in the 1999 Summer Institute sponsored in the United States by NSF/NIH/USDA and the Science and Technology Agency and Japan Science and Technology Corporation in Japan. Dr. Kiyoshi Komoriya of the Department of Robotics at Mechanical Engineering Laboratory, MITI/AIST, hosted Ms. Johnson. Ms. Johnson can be reached via email at: johnsonc@vuse.vanderbilt.edu



I worked as an intern in the Mechanical Engineering Laboratory, Department of Robotics, Cybernetics Division from July 8, 1999 to August 18, 1999. The Mechanical Engineering Laboratory is located in Tsukuba-shi, Ibaraki Japan. This city is the designated international scientific research center for Japan. Some of the projects that the Cybernetics Division are presently working on are finger manipulation, teleoperation, micro-manipulation, casting manipulation, three dimensional position sensing and force display and designing a mobile robot platform.

The initial task for the summer was to determine a project that I could implement and complete in a 5-week period. My initial two days, I toured each of my lab mates work in order to determine where I could be most useful. After seeing the work done with the Phantom robot, it was determined that this was the best place to find a short term project. The details of this introduction and tours are located in section b of the body.

The Phantom robot and PA10 robots are used to perform research on teleoperation. Eventually, this technology would be used in a manufacturing environment to control manipulation using the small Phantom slave robot of a larger slave industrial PA10 robot. The robot similar to a joystick would serve as the master device for control. The Phantom is the master input device for remote control of the PA10 manipulator. VxWorks is used to model the robot with a real time operating system. The principal advantage in this is the safety of the operator, who is completely remote from the workspace of the robot. The eventual goal of this research would be to control a system like this over a network as opposed to from a short distance. This method would of course involve video display of the workspace. The present demonstration program for the Phantom was made using OpenGL to animate the movements of the robot. The robot has force sensors on the joints that can be increased or decreased with slider bars in the software. The user can then feel these changes in the robot end dynamically as the view is updated on the screen.

This summer I learned how to program in OpenGL using the C++ language. OpenGL is a graphics system software used to create interactive programs that produce color images of moving three-dimensional objects. My objective for the summer was to become familiar with the Unix environment, C++ programming and OpenGL programming in order to make a program that could be used for demonstrations. My programming project was to simulate a robot bouncing a ball in a room. The Phantom manipulator would be used to dribble the ball inside of its workspace. The final stage would be to use a socket to connect this program to the actual robot controller and at that point use the x,y,z, and force data of the actual Phantom end effector to bounce the virtual ball in the room. By also adding the force feedback, it was possible to feel the effect of the ball bouncing up to hit the hand. I will now explain how this project was implemented.

The initial function written was the DrawBall. This function simply drew the room environment with the ball, the global axes and the cubic room. The most important function was the BounceBall function which modeled the dynamic equation. The first step was to define a time base for the simulation. The initial clock was the internal C++ clock which initialized at program execution. This clock was defined by a constant series of clicks, incremented at a rate of about 100 clicks/second. The clock for the Phantom robot was defined as a real world clock in milliseconds and when communication was turned on for the robot controller, the system would run off of the robot internal clock instead of the computer time. The ball home position was at the top of the box and the first task was to simulate a free fall as if the ball were dropped by a human. The formulas used for this calculation were,

velocity = vo - gt

where vo is initial velocity, g is gravity 9.8 (m/s2) and t is time

y = yo + vot - ½gt2

where y is ball position, yo is initial ball position

For the free fall, the initial velocity was set to zero. At every y position if the ball was above the bottom of the floor then it would continue to fall. If the calculated next position was below the bottom of the floor, then there were additional calculations. The first equation calculated the exact time and velocity with which the ball would have hit the floor. This information was used to determine the upward velocity that the ball had upon impact.

tc = (vo ±(vo2 - 2g(yf - yo))/g
where tc is the contact time, yf is the bottom position

If the ball is found to be within a small distance to the floor, then the ball position is immediately set to the bottom of the box. Otherwise, the time to contact for the floor is set to the new rebound time of the ball. The velocity is recalculated using this new contact time. The velocity constant efficiency for the ball is then used to determine the rebound velocity. The formula for this is as follows,

va = evb
where vb is the contact velocity and vb is the rebound velocity and
e is the efficiency (0<e<1)

For the initial test simulations for this program, the efficiency value was set to .95 so that the ball would bounce for a long period. After mastering this task, it was time to add the additional constraint of a hand hitting the ball. The change in the program involved calculating the dynamics for a hand striking the ball and testing that the ball had indeed been hit. If this was satisfied, the initial position for the ball was set to the point of contact and the velocity vector was again 95% of the arrival velocity in the downward direction. One obvious problem in this derivation was the case where the ball was hit on the way down, which was addressed in the revised program. The final step calculated the time of contact with the hand. The time of contact, tc was used to calculate the upward and downward velocity. This process continued recursively until the ball damped down to the floor.

The problems discovered in the initial derivation were that by the calculations, the ball would sometimes fall through the floor when time increased greatly. This is because the pull of gravity would become so much larger than the upward velocity. Unlike the real world, there was no actual floor so the ball would be sucked through the floor. This problem was resolved with an if loop. The force of the hit could also propel the ball to the floor like a rock. The dribble would also only make the ball bounce lower and faster but the force could never cause an increase in bounce. These problems were subsequently fixed in the final revision of the program. Next, the details of the final derivation of the dynamics will be discussed.

The concept behind the dribbling of the ball was conservation of momentum and transferring the force with which the ball was hit to the velocity of the ball. The equations used for this simulation were as follows,

mbvb +mhvh =_mbvb' +mhvh'

where mb, mh are the masses of the ball and hand, ,
vb, vh are the velocities the ball and hand before impact, respectively, vb', vh' are the velocities of the ball and hand after impact, respectively.

e = - vb' - vh'
   vb - vh

where e is the efficiency of the before and after velocities

k = mb
     
mh

 

where k is the mass ratio between the ball and hand

From these equations it is possible to derive the value for the velocity of the ball after impact as well as the force the hand exerted on the ball. These equations were as follows,

vb' = (k - e)vb - (1 + e )vh
k + 1

fDt = mb k (1 + e ) (vb - vh)
k + 1

See the figure for graphical illustrations of this concept.

 

The first step was to define a structure class with three variables t, yo and vo, time for free fall, initial velocity and initial position for fall, respectively. The name of this structure was Falling and it was used to calculate the fall of the ball. The BounceBall function initially read in the position information from the Phantom end effector via shared memory. The environment time was initialized from the baseClock of the robot controller. The variable t was defined as the interval time from each subsequent strike of the ball either from the floor of the hand. The initial positions of the ball were read into the dataFall class as well as the variable for position of the ball. This same process was continued for the initial and present velocities of the ball. If the force from the end effector of the robot was nonzero then decrement the force count. Once this value reached zero then set the force value to zero. The process for calculating the fall of the ball were the same as before for y position and velocity. The three data values were then read into the temporary Falling data structure. The next step was to evaluate the closeness of the y position of the ball to the bottom of the box. This was done by verifying that ± (vo2 - 2g(yf - yo)) was much greater than zero. If so, the time to contact the floor, velocity at contact and position were passed into the Falling data. The velocity data value was found by multiplying the present velocity by the repulsion coefficient of the floor. If the square root term was close to zero then the velocity of the ball was immediately set to zero and the position was set to the floor. If the ball were not close to the bottom of the box then the calculations were performed for closeness to the hand. If the ball position is greater than the hand position this denotes that the hand is in the initial starting position. If this is the case then calculate the root ± €(vo2 - 2g(yhb - yo)) and evaluate if it is much larger than zero. If so set the speed of the end effector to the present value divided by the speed constant. The time to contact the hand was calculated similar to the way it was done to contact the floor. The velocity was calculated using the previous mentioned equation using the mass ratio and efficiency constant. All these values were once again written to the Falling structure. The force was calculated from the aforementioned formula and the change in force written to the force count. If the ball was found to be extremely close to the hand then the velocity was found from

vb' = (1 + e )vh.
k + 1

The final condition for consideration was if the ball was in contact with the hand and the velocity was negative which meant a falling situation. Once again the root was checked for closeness to zero and the speeds were changed as before. The same formulas were used as in the last loop. The final step was to operate the robot and ball using these dynamics.

This is the process by which the written program communicated with the physical robot. On one Unix PC, the robot dynamic program resided as well as the controller program for the phantom robot. These two entities communicated via shared memory and transferred data about three dimensional position and force. The controller then communicated with VxWorks1000 via a socket on another Unix PC. The output from the VxWorks program sent data and commands to the Phantom robot. See chart in the Appendix. This process was implemented and worked with much success. Future opportunities for work for this project would be to expand the bouncing of the ball to three dimensions instead of one. The other area of improvement would be to account for deformation in the ball when it hits an object. Presently, the ball is assumed to be perfectly round as if a solid object. Another suggested improvement would move the dynamic calculations to the viewer in order to optimize the screen updates after ball position calculations.

 

Appendix I

Research Photographs

The phantom robot used in my project



The display screen of the OpenGL simulation/demonstration
(the white cylinder was the robots hand)

 


The communication schema for the bouncing ball program


 


The bouncing ball in free fall



The dribbling ball

 


Click here to return to top of this report