deeper-blue / sdp-robot

The robot code for Deeper Blue, an assistive chess-playing robot. Developed for the System Design Project, a 3rd year course offered at the School of Informatics, University of Edinburgh.
2 stars 0 forks source link

Sensing whether a piece was picked up #58

Open pilif0 opened 5 years ago

pilif0 commented 5 years ago

If we want to sense whether the grabber picked up a piece, there are two options. One involves adding a sensor to the arch to point below the grabber when the platform is centred, the other involves constructing a rigid grabber and attaching the sensor to the bottom of that.

Option 1

The idea of this option is that the robot would check whether the grabber is holding a piece after centring the platform immediately following the pick-up. This requires the least changes to the overall structure.

A sensor could be added just under the top rail at the platform's centring point, so that it points below the grabber when the platform is centred. There it would sense whether the is an object a couple cm in from of it or not. If there is an object, the only object that can be so close is a piece being held by the grabber and therefore the pick-up succeeded.

On successful detection, the robot would continue as normal. If an object is not detected, there are a few options of what we could do:

1) Notify the user and have them intervene. While this would deal with most causes of not picking up correctly, it also decreases the robot's autonomy. 2) Retry pick-up. This would deal with a limited subset of the causes, but not all (e.g. piece being severely off centre). 3) Combine the above. Retry pick-up a (configurable) number of times, and notify user if all attempts fail.

Tasks

Option 2

If Option 1 doesn't work, it might be required to attach the sensor to the bottom of the grabber.

It is virtually impossible to attach the required sensor to the thread grabber. The sensor can't be attached in the centre of the grabber, and attaching it off centre would greatly unbalance the grabber leading to serious inaccuracy. Furthermore, the cable required for the sensor would lead to even more error and would get in the way even more than the EM cable gets in the way now. Thus the requirement to implement the rigid grabber.

The Art of Lego on page 8 describes a gear rack that would be good inspiration for fixing our rigid grabber prototype. The document also provides some further pointers for constructing with Lego. I think that especially the construction using the gear rack only on one side might be useful if it proves stable enough.

The grabber needs to have range of movement at least the height of the tallest piece, in order to be able to move the tallest piece over the other tallest piece without hitting it. Considering the board is already measured and we have limited time, another constraint is that this grabber needs to have the same offsets as the thread grabber, so that only minimal structural adjustments are needed.

The sensor would then be used to repeatedly attempt to grab a piece. There might be some other options of what to do and this part requires further design if we choose to go for this option.

Tasks

Sensor

For the sensor, the aim is to detect whether a piece is attached to the bottom of the grabber. This could be done by either an ultrasonic sensor, or a light sensor and an LED. The ultrasonic sensor would be better, because it is independent of colour, but it might not produce a tight enough beam. The light sensor would impose some restrictions on the useable piece colours.

Jeremy643 commented 5 years ago

In terms of saving time in detecting if a piece was successfully picked up, option 2 seems to be the best option. With that said, I feel the changes required to make it work will require too much time to implement therefore I feel option 1 is the best choice for us.

Option 1

A possible idea that could improve the time to detect if a piece was picked up could be:

Sensors

I feel that the ultrasonic sensor would be best suited for this task. I found that the beam of the ultrasonic sensor is ±30° from https://www.grasp.upenn.edu/sites/default/files/ev3basics2015.pdf slide 26.

pilif0 commented 5 years ago

I added the ultrasonic sensor under the platform as described above, and tested that it didn't interfere with the robot's movement. I have also tested that the sensor sees a piece directly in front of it. In my testing the distance when no piece was grabbed was 255, while when one was grabbed was 3.6