Friday, May 7, 2010

Team C: Team Trash Talkers - Basketball Shooters


Main Design Concept
Our design was quite simple. It was broken up into two main parts. The stationary “base” which houses all of the electronics and the rotating top portion which would house our motor-drive throwing arm, web camera, and hopper. Our machine would start by rotating until a backboard is found and centered in the view of the web camera mounted on top of the dome. When the camera is facing directly toward the backboard, the throwing arm which is situated directly behind the camera will also be facing right towards the backboard. From this position, we will use computer vision to get the distance from our machine to the backboard we are aiming for. From this distance, we will determine with what speed we should shoot the basketball to make it in the hoop.



System Overview 


Figure 1. System Overview
 
  
The design consists of four subsystems, the rotational degree of freedom (DOF), longitudinal DOF, the hopper, and the computer vision (CV).  The rotational degree of freedom consists of the rotating base.  The longitudinal DOF refers to the throwing arm.  The hopper system actuated the basketball distribution to the throwing arm using a servo-motor (range: 0°-180°).  The CV encompassed our backboard tracking as well as our distance sensing.  From the image X, the body, which houses the hopper, CV and throwing arm sits on the rotating base allowing the robot to search for the backboard and fire.


Figure 2. Hopper and throwing arm.

The rotational subsystem allows the robot to travel a full 360° to scan the environment searching for the backboard.  This is controlled by one motor driving one spur gear in small steps.  The steps are required to give the CV program enough time to survey the area.  If the CV doesn’t find the backboard on the first pass, we risk having to wait for another full rotation, so the step timing had to be set and help to a deliberate 250ms.


Figure 3. Gear system connecting the stationary base and rotating top.

In order to have enough power to throw the ball, we needed a high torque 18V drill motor.  Furthermore, because of the speed with which we would be throwing the ball, we were reluctant to use an optical encoder system because we had issues with overshooting specific points and having to compensate.  To ensure a precise and repeatable stopping position, we cut out and reinforced a section of the body to act as a stopper.  We gauged the amount of time we’d supply a duty cycle to the drill motor to avoid driving the motor when we restricted its motion.  We also hollowed out a resting position in the body so we would have a constant trajectory from start to finish. 

After the arm motor completed one shot, breaked, and went back to resting position, we supplied a signal to a servo-motor to allow one ball to roll down the rails and into the throwing cup.  The hopper is housed primarily inside the body to protect the balls from falling out from any outside disturbances, the only place the rails extend out are to place the basketball in the cup.  It was also meant to be a simple and clean looking design.  The system held and distributed two basketballs for each round before having to be reloaded. 


The catapult design is centered on a powerful throwing arm with precise control through a motor driver with feedback from an optical encoder. The arm is used to launch the ball into the hoop. A servo actuated loader feeds each ball individually into the ball holder on the arm. An ultrasonic rangefinder senses the longitudinal distance to the hoop, while the lateral distance from center is manually entered by the user. The entire system is mounted on a ball bearing turntable actuated by a stepper motor with a timing belt to allow accurate aiming at off-center targets.
How it works

The program is organised in a finite state machine structure. The different states are:
- IDLE: All motors off, no action, listening to some prospective orders coming from the PC through the serial communication. This is the default state when the system is started.
- AIM: In this state, the microcontroller is waiting for orders from the PC to turn the base one step left or one step right, until the system is centred and the PC sends the order to go to the next state.
- DISTANCE: In this state, the microcontroller is waiting for the distance data from the PC. Once it gets it, it uses the lookup-table to do a weighted average of the two closes values in the table, and sets the resulting PWM duty-cycle as the throwing speed.
- RELOAD:  A low duty-cycle PWM is given to the throwing arm in the backwards direction to bring it down. Then the servo motor holding the balls in the hopper is actuated briefly to let one ball go down the path to the cup.
- FIRE: The microcontroller sends a PWM to the throwing motor, with the duty-cycle found during the DISTANCE state. The motor is powered for half a second, letting the arm accelerate and hit the stopper.
- BREAK: The microcontroller holds the throwing arm motor-drive in break mode for a second.

The states are executed in the following order:


Figure 4. Flow chart of the PIC program

For the aiming control, we use a proportional feedback from the webcam. The CV program on the PC sends data to the PIC.
To know how fast we have to throw the ball, we use a lookup-table to convert the measured distance into a duty-cycle for the motor of the throwing arm. The CV program on the PC sends the distance value to the PIC.



Team's Responsibility 
 
Zachary Barker / Mechanics
Clive Myrie / Computer Vision
Joel Rey / Microcontroller Programming
Michael Soto / System Integration
  
Video 

link: http://www.youtube.com/watch?v=eu65qvNOWsQ

1 comment:

  1. will you share the blueprints to your shooting mechanism because our school is participating in the first robotics competition and we are in need of a good shooting arm for our task. If you can help at all please contact me back at ncben2014@gmail.com

    ReplyDelete