Sometimes, it's difficult to articulate exactly what type of work DMC does day to day. For example, in a career fair setting a DMC employee might only have a few minutes to describe our projects to a candidate. It quickly became apparent to us that a physical demo that highlights our capabilities would be very beneficial in these situations.
Enter, the automated ping pong game! We decided to build a machine that plays ping pong - autonomously! Here's a video showing the machine in action:
The beauty of this demo is that it involves many of the technologies and equipment that a DMC engineer works with any given day. Obviously, there was no way for us to encapsulate everything we do into one demo, but this demo includes quite a few of them.
The entire ping-pong demo is driven by a LabVIEW program.The LabVIEW program can be broken up into the following subsystems:
Camera: The camera we are currently using is a Prosilica monochrome camera with a resolution of 1280x1024 pixels.It takes around 40 pictures of the playing field per second.We use several of the NI vision VIs to identify the position of the ball on the illuminated background and filter out unwanted objects.
Trajectory Prediction: As the ball travels around the playing field, we keep a buffer of previous ball positions.We use a very basic least squares curve fit to predict the quadratic trajectory of the ball.
Servo System: To locate the hitting mechanism under the ball, we are using a Yaskawa Sigma-5 servo amplifier to drive a motor that is coupled to a linear slide.DMC developed a LabVIEW driver that communicates with Yaskawa Sigma V drives over their MECHATROLINK II protocol.Using these driver VIs, the predicted point of contact is being continuously relayed to the amplifier.Acceleration parameters are set on the drive to produce the fastest possible positioning.
Digital I/O: We are using a National Instruments USB-6009 module for our digital I/O.When the ball approaches the hitting head at the bottom of the playing field, it crosses a LASER line.Since we know the velocity of the ball (from the camera), and the distance between the LASER and the hitting head, we can calculate the precise time to hit the ball.After the necessary delay, the program activates an output to drive the solenoid that is mounted on the hitting mechanism.The solenoid is only pulsed for a very short time period (~15 ms).
A side note: One might think that the LASER is unnecessary for timing.We can get the velocity and distance of the ball from the camera, so why do we need the LASER for timing?The answer is that the information from the camera is simply not accurate enough.Since the solenoid is only activated for about 15 ms, we need very precise timing to ensure a clean hit.
During a recent brainstorming session, we came up with a few ideas for future improvements:
- “Inverted Pendulum” mode: The algorithm would position the hitter in such a way to keep the ball bouncing exactly in the middle of the playing field.
- “Target” mode: Use the curved hitting head to aim the ball at several targets on the screen.
- “User” mode: Give the user the ability to control the position of the hitting head (possibly using a Wii controller).
Feel free to comment on any ideas for future features that you may have!