Trap chess

My neighbour creates totally insane chess boards. He needs my electronics skills for this one...

Similar projects worth following
This project page describes the design and construction of an electronic system that detects chess pieces and makes them fall randomly into traps while both players try to play normally. It's not even the weirdest chess board that Bob, my neighbour, builds...

So one day my neighbour comes and asks for help. Why not ?

Imagine you play chess against your opponent. Sometimes one of your pieces falls into a trap that opens suddenly as you press the button of the timer.

Bob has build to chess boards with traps, operated by individual servomotors. Each chess pieces has a magnet, that is detected by reed sensors. Now, I have to create the electronic board to control the whole thing...

1. Timing
2. Plot twist !!!
3. Power distribution
4. . 
5.   .

  • More work

    Yann Guidon / YGDES5 days ago 0 comments

    Board #2  is built and I added more switches to control the current. This makes 6 control signals with fanouts 4, 3, 3, 1, 1, 1.  I'll have to wire the ULN2003s...

    Now the problem is to detect the end of course through the current in the motor, which is measured by a 3.3 Ohms shunt resistor connected to the base of a transistor. The oscilloscope shows that the generated signal is far from the one I expected... End of course should be set after 50ms of "overcurrent" but  should be reset as soon as the current drops under the 0.2A. I try to do a discrete version but it's not as easy as I thought.

  • Power distribution

    Yann Guidon / YGDES01/21/2019 at 02:42 2 comments

    I finally decided to use relays to distribute the power to one selected servo.

    The path of the power goes through an unbalanced binary tree, made of parallel 8-tree and 4-tree, with a control vector of [1, 2, 4, 4] (total is 11, which is 12-1 as expected).

    The relays have a 160 ohms coil, or 32mA @ 5V. The driving requirements for the tree are 32, 64, 128, 128 mA. This is well within the range of a ULN2003 and the total draw (worst case) is about 0.35A.

    The reverse side is the usual mess:

    The 16-positions knob selects one of the 12 outputs, 4 outputs have a duplicate code. I can test the behaviour by hand and the manual control is really helpful during prototyping and later for installation and troubleshooting.

    The hex encoder must be disabled during normal operation, which is selected by a small slider switch. This requires anti-feedback diodes on the knob's inputs, hence an increase of the power voltage.

    Oh and of course, there is a lot of work to do because now, the servo's motor must be wired directly (the control PCB must be removed). But for now I must focus on controlling the current's direction and detecting the increase of current when the servo has reached its limits. Hint: a 3.3 Ohm resistor develops a potential less than 0.7V when the servo operates normally.

  • Plot twist !!!

    Yann Guidon / YGDES01/08/2019 at 01:48 0 comments

    I'm getting even more lazy.

    Dealing with signal levels of the servos when they are turned of gets annoying so... What about driving the motors directly ?

    The servos can be unscrewed and we can access the two wires, which are easy to desolder. So all I need is a dozen of motor drivers ("H bridges") that can hold a few hundreds of mA. But... only one motor needs to be driven at the same time.

    I have enough Allegro A3968ELB (dual H Bridges) for this purpose but that still sounds overkill.

    Another idea is to share the sensors' selection with the motor drivers' outputs. It's a bit tricky...

    I am very tempted to implement those functions with relays. They draw a lot of current but convenience of design and simplicity beat many other constraints, and I don't want to have to program anything...

  • Timing

    Yann Guidon / YGDES12/22/2018 at 04:52 0 comments

    I'm lazy and don't want to use a microcontroller so here comes the FPGA.

    The function is pretty simple so VHDL simulation will be easy.

    The servos are controlled by one output, one pin driven in PWM : 1ms long pulse for closed, 2ms long pulse for open. There would be a bit more than 500ms in each state : >500ms open, >500ms closed. The PWM pulses are repeated at about 50Hz, or 20ms apart. This could be either 16ms or 32ms...

    Already we see what can be done :

    1. a prediv from the 50MHz integrated clock, down to 1KHz (a counter from 0 to 49999) => 16 bits
    2. a counter for the pulse repeat rate : the pulse is high during the first cycle (or two, for the open case). 20ms gives us 5 bits.
    3. A counter for the open or close period : 50 repeats gives us a 6-bits counter
    4. 2 state bits for wait-open-close

    The state affects one bit of the 2nd stage, so the pulse is longer or shorter. And that's all for the PWM+FSM.

    There is a need for a RNG : it can be taken from bits of the free-running counter, sampled when the trigger state changes. Some probability shaping is required, one bit gives 1/2, and 2 bits combine to add the 1/4 and 3/4 chance (respectively with AND and OR). Maybe probabilities 0, 1, 1/2, 1/4 and 1/8 could be selected...

    One input needs to be selected when the RNG is 1. Otherwise, the FSM returns to the WAIT state. There are up to 16 inputs max (10 or 12 in practice, 14 outputs max) so this maps to the PWM counter (which is also the RNG ?). The counter would scan the inputs until one is set to 1. The loop can be stopped when non-existent input 16 is reached, set to 1.

    The FSM has these states and runs at 1KHz :

    • 0 : wait until the trigger input changes. PWM counter is running at 1KHz. Servo power is off.
    • 1 : scan / select input (1 to 16 cycles max), select output
    • 2 : if conditions met : power on the selected servo and run 64 cycles of "open"
    • 3 : run 64 cycles of "close" then goto back to 0

    yeah, this should work... it could even be implemented mostly as TTL/CMOS :-D

    There are however many other issues to solve, such as : how to send the PWM signal properly and avoid electrical issues when the servo is not powered ? So far the servos are switched from the low side, such that the PWM input will float around 5V when idle, which is not suitable for classic (push-pull) digital outputs...

View all 4 project logs

Enjoy this project?



Dr. Cockroach wrote 12/22/2018 at 12:41 point

That's sick, twisted, evil and just plain mean........   I love it :-D

  Are you sure? yes | no

Yann Guidon / YGDES wrote 12/22/2018 at 20:37 point

The guy has other sadistic chess contraptions in the making...
like the one where all the pieces are underwater and you have to fish them.

  Are you sure? yes | no

Dr. Cockroach wrote 12/22/2018 at 22:46 point

Lol and you mentioned melting wax, how about melting ice XD

  Are you sure? yes | no

Yann Guidon / YGDES wrote 12/22/2018 at 22:55 point

Ice might be in the plans. But then how do you see which piece is white or black ? :-P

Other chess playgrounds are totally warped and require magnets to hold the positions. Another moves randomly...

  Are you sure? yes | no

Dr. Cockroach wrote 12/23/2018 at 10:32 point

Food color in the ice would do well :-)

  Are you sure? yes | no

Frank Buss wrote 12/22/2018 at 11:11 point

Cool, please implement Atomic chess with it as well. I guess this would be the first real-world and automatic implementation of this variant.

  Are you sure? yes | no

Yann Guidon / YGDES wrote 12/22/2018 at 12:35 point

well, the players will play how they want.
The artist however is making other totally insane and ridiculous chess boards for an upcoming exhibition :-) like, pieces made of melting wax...

  Are you sure? yes | no

Morning.Star wrote 12/23/2018 at 07:55 point

Brilliant lol, can't you drag him in here? Sounds like you make a great team heh ;-p

  Are you sure? yes | no

Morning.Star wrote 12/08/2018 at 15:17 point

Seriously? XD

  Are you sure? yes | no

Yann Guidon / YGDES wrote 12/22/2018 at 03:54 point

You didn't know I have crazy neighbours. I'm not the only artist in the building...

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates