brilliant engineering ideas needed!!

Thread Starter

Eric007

Joined Aug 5, 2011
1,158
Hi All

Before I post this I browsed around to find out if it was discussed before and found this link:
http://forum.allaboutcircuits.com/showthread.php?t=64123&highlight=chess
which would be a very good starting point as some of my questions have already been answered there but I will have to re-read this for further understanding and questioning.

First I want to go one step backward and plan my design and stick to it!
BTW, I am trying to make a robot that would be able to play chess!

Here's the high level design block diagram I came up with based on the discusion in the above link as seen in attachment hlevel
Any comments or better suggestion?

second, I decided to break the above high level into different modules to design separately and to be assembled later (attachment mod1, mod2, mod3). I have categorised them into hardware and software modules.

The hardware ones has the following ones:
module1 --> design of chessboard & pieces
module2 --> design of the controller to move pieces
As for module2, I am thinking of design an arm that would be used to move and lift the pieces...But this seems to be the most difficult one for me!!!
And I could not even come up with a good block diagram for it...

The software one has:
module3 --> implementation of Chess engine (on a PC) and all that goes with it.
(still researching/investigating on this one)

Third, the possible different interfacings between these modules:

1. interfacing between module1 and module3: I read somewhere (can't remember) parallel port would be easier,...
2. interfacing between module3 and module2: serial cable, bluetooth,...
3. interfacing between module2 and module1 (how are the board and the controller 'arm' attached together? this would be mechanical I guess)

Any suggestion on the different interfacing and their advantages (would definitely choose the one that would make my life easier)

The system would also have the additional software modules:
module4 --> communication protocol between module1 and module3
module5 --> communication protocol between module3 and module2

Anything missing in my design strategy?

All comments are welcomed!

EDIT: Attachement removed!!!
 
Last edited:

djsfantasi

Joined Apr 11, 2010
9,156
There are commercial robot arm kits that could give you some ideas on how to design the arm. The ones I am thinking of have 6 degrees of freedom (use a minimum of six servos to control the motion). One in its base to rotate the arm left and right. Another in the base to move the upper arm back and forth. One at the elbow to move the forearm. Two at the wrist to move it up and down and rotate. And one in the "hand" to open/close the "fingers/claw".

I searched for "robot arm kits" and got several good hits. Another search, if I may suggest, is for "gambito the chess playing robot". It is a project similar to the one you are attempting.
 

Brownout

Joined Jan 10, 2012
2,390
Anything missing in my design strategy?
Almost everything.

If you're seriously going to attempt such a complicated project, may I suggest that the "chess engine" be an operator with a laptop, who knows how to play the game? Creating the program for chass strategy is an exercise in AI that could take a significant part of your lifetime to complete!

Here's what I would do: The operator enters moves into the laptop. The laptop is hte central controller for everything. The chess board has a round hole in every square and each piece has a short peg that fits into a hole. Each time a peg is inserted into the hole, it closes a switch for that hole. The laptop scans the switches to determine which pice has been moved and where. A program keeps track of where each piece is on the board ( I thought about implementing this as a way someone can play a game from his computer to a player who is using a board )

The laptop tells the arm where the piece is that needs to be moved, and where it needs to go. It uses a coordinate system to communicate to the arm, so the arm can be almost 'dumb' and just follow what the laptop tells it to do. Now, the arm might need to make very small adjustments to the coordinate system to accurately grasp the piece. So, some kind of sensor might be needed here.
 

Thread Starter

Eric007

Joined Aug 5, 2011
1,158
Thanks so much for this post!


Almost everything.
:D Not true...definitely some but not everything!

If you're seriously going to attempt such a complicated project, ....
I am!!!

may I suggest that the "chess engine" be an operator with a laptop, who knows how to play the game? Creating the program for chess strategy is an exercise in AI that could take a significant part of your lifetime to complete!
Definitely! I mentioned that in my first post. the chess engine already knows how to play chess and is an application running on a PC with a GUI to analyse the game. I am dealing with this! no worry but I am dealing with the hardware first and I have some serious questions about it. And it should be one step at a time otherwise we get lost!!


Here's what I would do: The operator enters moves into the laptop. The laptop is the central controller for everything. The chess board has a round hole in every square and each piece has a short peg that fits into a hole. Each time a peg is inserted into the hole, it closes a switch for that hole. The laptop scans the switches to determine which piece has been moved and where. A program keeps track of where each piece is on the board (I thought about implementing this as a way someone can play a game from his computer to a player who is using a board )
This part has been answered in the link i posted in post#1 but I have a question for you! which module does the scanning of the board!? the PC or the MCU?

coz to me the chessboard and the pieces CANNOT communicate directly with the PC (Chess engine). the chessboard and pieces need to be interfaced with a microcontroller and the MCU is the one responsible for the scanning and will transmit the state of the board to the PC and the chess engine will take over from there and it analyzes the game and decides on the next move and will transmit some kind of signal to the arm (that will do the actual lifting and moving of the pieces) corresponding to the moves wanted!!

The laptop tells the arm where the piece is that needs to be moved, and where it needs to go. It uses a coordinate system to communicate to the arm, so the arm can be almost 'dumb' and just follow what the laptop tells it to do. Now, the arm might need to make very small adjustments to the coordinate system to accurately grasp the piece. So, some kind of sensor might be needed here.
I agree with you here!

And I disagree about you saying that my design strategy misses everything! coz what you are discussing already is the detailed design (we getting there soon) BUT now all I am doing is planning and KNOWING THE MAJOR COMPONENT FOR EACH MODULE!
 
Last edited:

strantor

Joined Oct 3, 2010
6,782
instead of a robotic arm, would you consider a 2 axis electromagnet under the board? would make things simpler I would think. use small pieces and/or larger size board so the pieces have room to move past eachother without having to leave the board and go up and over. image a CNC machine, minus the Z-axis, upside down, underneath the board with an electromagnet on it.
 

Thread Starter

Eric007

Joined Aug 5, 2011
1,158
instead of a robotic arm, would you consider a 2 axis electromagnet under the board? would make things simpler I would think. use small pieces and/or larger size board so the pieces have room to move past eachother without having to leave the board and go up and over. image a CNC machine, minus the Z-axis, upside down, underneath the board with an electromagnet on it.

Thanks for your idea and I will think of that and get back to you BUT is the robotic arm 'feasible' (designing it for this purpose)?? coz I am thinking of designing it and having technicians build it and I will have to deal with the programming again...
 

djsfantasi

Joined Apr 11, 2010
9,156
The robotic arm certainly is feasible. Gambito is an example. In the posts on the robot forum where its designer discussed his project, someone suggested using small magnets in the board and the pieces so that they 'snap' to a uniform position when placed by the arm.
 

strantor

Joined Oct 3, 2010
6,782
Almost anything is feasible with enough money and time to throw at it. Laser guided chess pieces launched from a drone plane in the upper atmosphere onto the board is probably feasible (for the government), but also you should consider what is reasonable. It's my opinion that the best solution is the simplest solution that works. A 6 axis robotic arm does not seem like the simplest may to move a chess piece, to me. There is probably even a simpler way than the one I described, but I cannot think of any now.
 

BMorse

Joined Sep 26, 2009
2,675
When the Pic32 first launched, I was in a competition sponsored by Microchip where one of the contestants tried to do practically the same thing, basically he was designing a chess board where both players could be somewhere else and the board would move the pieces for each player.... well the site has been taken down now so I can not link to it.... He tried to move the pieces with an electromagnet from the bottom of the board with, the issues he ran into was that sometimes the board had to move other pieces out of the way to move the piece to its new position, so he added some extra space around the perimeter of the board to use for moving the players piece around the other pieces if necessary..... anyway, it got overly complicated quick because of the amount of software he had to write to accomplish this, and he dropped out of the competition in the second round....

Using a robotic arm would not only make things a little easier (you can just pick the piece up and move it over the other pieces...) and it would look "cooler" when moving pieces...... basically you need to start with the arm design (check out lynxmotion for examples) 6 DOF would definitely be cool, you can use RC servo motors to build and design this, as for the gripper, just a simple solenoid driven "clamp" would be sufficient to "grab" and "release" each piece.

Build this arm on a fixed position relative to the board (Meaning the arm should always be in the same place near the board all the time), then work on getting it to move to each grid coordinate first (see attached sample grid), this will all be done with a uC first, with no interaction from PC yet....

XY referrence chart.jpg

This will have very basic functionality built into it, basically it should just be able accept a simple command to move to a specified X,Y location and pick up a piece, then another simple function to move piece to another X,Y location and set it down. And also add a "teaching" routine, so you can "teach" it the grid locations (basically, manually move arm to location, press button to save coordinates, repeat for each grid position, etc.) that way, if you change board size, you can easily have the arm learn it.

once this is done, then you can move onto the PC comms, then all the Chess engine has to do is send 2 sets of grid coordinates, one for where to pickup piece, and second to where it needs to go.
 
Last edited:

Thread Starter

Eric007

Joined Aug 5, 2011
1,158
Almost anything is feasible with enough money and time to throw at it. Laser guided chess pieces launched from a drone plane in the upper atmosphere onto the board is probably feasible (for the government), but also you should consider what is reasonable. It's my opinion that the best solution is the simplest solution that works. A 6 axis robotic arm does not seem like the simplest may to move a chess piece, to me. There is probably even a simpler way than the one I described, but I cannot think of any now.
Yes the best solution is the simplest one!

Reducing the cost as much as possible and I must implement something reasonable!!! If any one with a simpler one, its welcomed! I think you described one in post #6...maybe you should elaborate more on that!

I am actually doing a feasibility study on the movement of the pieces before implementation!

Thanks!
 

Thread Starter

Eric007

Joined Aug 5, 2011
1,158
When the Pic32 first launched, I was in a competition sponsored by Microchip where one of the contestants tried to do practically the same thing, basically he was designing a chess board where both players could be somewhere else and the board would move the pieces for each player....


Wow

…well the site has been taken down now so I can not link to it.... He tried to move the pieces with an electromagnet from the bottom of the board with, the issues he ran into was that sometimes the board had to move other pieces out of the way to move the piece to its new position, so he added some extra space around the perimeter of the board to use for moving the players piece around the other pieces if necessary..... anyway, it got overly complicated quick because of the amount of software he had to write to accomplish this, and he dropped out of the competition in the second round....


Lol…I thought about this method as well BUT thought about complexity designing the chessboard with this feature…and discarded it

Using a robotic arm would not only make things a little easier (you can just pick the piece up and move it over the other pieces...) and it would look "cooler" when moving pieces...... basically you need to start with the arm design (check out lynxmotion for examples) 6 DOF would definitely be cool, you can use RC servo motors to build and design this, as for the gripper, just a simple solenoid driven "clamp" would be sufficient to "grab" and "release" each piece.


I like this paragraph! But my understanding is 6 DOF = 6 servo motors. How much is one servo motor? Anyway I am willing to spend MONEY on this project but of course reducing cost when possible! And if I get you well we won’t use a gripper but a solenoid to grap and drop pieces…that is cool coz that would reduce complexity!

Build this arm on a fixed position relative to the board (Meaning the arm should always be in the same place near the board all the time), then work on getting it to move to each grid coordinate first (see attached sample grid), this will all be done with a uC first, with no interaction from PC yet....


This makes PERFECT sense! I agree 100%

This will have very basic functionality built into it, basically it should just be able accept a simple command to move to a specified X,Y location and pick up a piece, then another simple function to move piece to another X,Y location and set it down. And also add a "teaching" routine, so you can "teach" it the grid locations (basically, manually move arm to location, press button to save coordinates, repeat for each grid position, etc.) that way, if you change board size, you can easily have the arm learn it.


Yes but for now as time is a bit critical…I would want it to be based on a fixed size board…and when everything is done I will be more Happy to improve features!

once this is done, then you can move onto the PC comms, then all the Chess engine has to do is send 2 sets of grid coordinates, one for where to pick up piece, and second to where it needs to go.


Exactly! That’s why in my design strategy I broke this down into different reasonable modules also mentioned about interfacing and communication between modules.

How much (roughly) would this arm cost? And what other major components will be involved?

I am actually reading around to understand better about designing arm so I can follow when members will be giving their inputs

Thanks
 

Thread Starter

Eric007

Joined Aug 5, 2011
1,158
I decided to add some of the comments I found interresting in the link I showed in post #1 as I want to use some of the ideas from there!

The general technique for detecting a large number of key-switches such as a computer keyboard is to arrange the keys in the form of a matrix and to use multiplexing techniques. A problem occurs if two or more switches are pressed simultaneously. If you are only interested in the static state of the switches then this is the simplest solution. You would only need 8 input pins and 8 output pins (two ports in total) for 64 switches.
Another technique is to use parallel input/serial output latches/shift registers. Eight 8-bit devices will give you the desired 64 inputs. The data can be shifted serially using a single bit input port of a MCU.
Either technique is best implemented using a micro-controller unit (MCU) interfaced to the PC.
If it is an 8x8 square, you don't need 64 switches.
Think rows and columns.
Put voltage on one row, and read the voltages on those 8 columns.
Put voltage on row #2 and read voltage on those columns
repeat through row 8
You now know the state of all 64 positions.
This scan can happen tens of thousands of times per second.

Here is a schematic to illustrate how you would interrogate four switches using the matrix scan method. This would require two output pins and two input pins for a total of four pins. Of course, you would not do this for only four switches. For 64 switches, you would use 8 input/output pins and 8 input pins for a total of 16 I/O pins.
The buffers shown are not actual circuits. They are there just to indicate which lines are outputs and which are inputs.
To begin the scan, all eight U1 lines are set to INPUT mode.
All eight bits read back at U2 will be HIGH.
If U1A alone is set to OUTPUT LOW, inputs at U2 will read back a LOW for every CLOSED switch on the U1A line.
Repeat this for every U1 line in order to scan all switches.
(Have to modify to make U1 lines into INPUT mode when not being used to send LOW).
If you've got 64 switches, 32 of which may be closed at one time, I would think you'd need a diode in series with each switch in order to prevent false switch readings through back signal paths through closed switches, yes, no?
Actually, not using switches, and using diodes only would be a great advantage here, now knowing the application.
Have the contacts to the switch a pad with a concentric ring around it. Then in each white piece, place a diode which is forward biased from the center pad to the concentric ring. In the black piece, have the diode forward biased from the concentric ring to the center pad.
Both the row and column would need to alternate between input and output to get the full status of the board. At the same time, the entire issue of multiple switches closed is gone, in addition to knowing which pieces are white and which are black.
Then apply movement rules for each move, and you know what the piece is, or you could add resistors to each piece for identification in addition to the diode and use all ADC for reading.
I realized this after I posted the circuit diagram. I have corrected the text to indicate that outputs are put into the INPUT state. Only one line is made OUTPUT LOW at any given time.
But wouldn't that only prevent shorting two outputs together? Without diodes on each switch you could still get false readings through multiple closed switches, couldn't you?
Yes, you are correct. Thanks for correcting me. Is this what you meant?
In which case the output port will remain as an output and all lines will be held HIGH with only one line at a time being set to LOW.
Picture a bullseye, you have a dot and a ring.
On the bottom of each chess piece is a central conductor and an outer conductor, placed so that if spun quickly, it too would appear like a dot and a ring as well. The reason for this is so the chess piece can be pointing any direction and still work.
The trick to it is to have a resistor and diode inside each chess piece. The two would be in series, and the contacts would be on the center pad and at the distance of the concentric ring.
The board would have a copper (or gold) bunch of concentric rings inset onto it for conductors/sensors
In white pieces, the diodes point one direction
In black pieces, the diodes point the other direction.
Then, instead of one sweep for a read, with all being outputs, you do one sweep with rows as outputs and columns as inputs, giving you the white piece locations.
The next sweep, the columns are the outputs, and rows are in the input state, which gives you the black pieces.
If you really wanted to get fancy, you'd put the output state high (+5V) and measure the current drop across each resistor (ADC read instead of digital) to find out which piece it is (pawn through King), using an extra resistor to ground for each ADC pin, and a different valued resistor for the 6 different pieces.
 

Attachments

Last edited:

Thread Starter

Eric007

Joined Aug 5, 2011
1,158
I have a few questions about post #14 but will ask in a few hour as it bedtime here...

Also the design of this arm will be done right after designing the chessboard and the pieces

Thanks so much!
 

BMorse

Joined Sep 26, 2009
2,675
Yes but for now as time is a bit critical…I would want it to be based on a fixed size board…and when everything is done I will be more Happy to improve features!
This most likely will need to be implemented to reduce the complexity of the controller code to move the arm to a specific position, if you do not include a "training" routine, you will have to have some sort of algorithm to calculate each individual servo movement to position the arm where you want it, which can get pretty complicated when dealing with a 6 DOF movement.... although for your project I believe you can do it with just a 5 DOF arm.

I like this paragraph! But my understanding is 6 DOF = 6 servo motors. How much is one servo motor? Anyway I am willing to spend MONEY on this project but of course reducing cost when possible! And if I get you well we won’t use a gripper but a solenoid to grap and drop pieces…that is cool coz that would reduce complexity!
If you shop around (like ebay) you should get a pretty good bargain on servo's like these >> http://www.ebay.com/itm/6x-MYSTERY-...Control_Parts_Accessories&hash=item255798abea
Most of the cost for the arm, will be in the servos, you can pretty much use any lightweight material to make the rest of the arm (Like some ABS plastic, or even balsa wood). The lighter the arm, the less your servos will have to work.....


As for the Chess engine, have you checked out GNUChess? Or is this what you are using already?
 

BMorse

Joined Sep 26, 2009
2,675
I have a few questions about post #14 but will ask in a few hour as it bedtime here...

Also the design of this arm will be done right after designing the chessboard and the pieces

Thanks so much!

Why not start with an off the shelf board and pieces? Then you can concentrate on the arm and chess engine, once you have that all out of the way, then you can make your own...... It's kind of like "re inventing the wheel" so to speak, there is no need for it right now....
 

Thread Starter

Eric007

Joined Aug 5, 2011
1,158
This most likely will need to be implemented to reduce the complexity of the controller code to move the arm to a specific position, if you do not include a "training" routine, you will have to have some sort of algorithm to calculate each individual servo movement to position the arm where you want it, which can get pretty complicated when dealing with a 6 DOF movement.... although for your project I believe you can do it with just a 5 DOF arm.
As Strantor said the best solution is the simplest one! I know everything is possible BUT ‘time’ is athe biggest constraint. I hope to be done with the arm (design + code + simulation) in 4 weeks maximum! Is it a reasonable time? I’ll have some technician build the physical arm (no time to do it on my own). Would you elaborate more on how this ‘training’ of the arm works? Coz when I think of the programming part of it, it makes me sick coz the arm needs to be able to reach the 64 locations in the board and after each move it must return to its initial position.

If you shop around (like ebay) you should get a pretty good bargain on servo's like these >> http://www.ebay.com/itm/6x-MYSTERY-9...item255798abea
Shopping is one of my hubbies…I been shopping on ebay for years…but when it comes to electronic components I prefer Digi-Key (shipping time ->1 week ) and others…
Most of the cost for the arm, will be in the servos, you can pretty much use any lightweight material to make the rest of the arm (Like some ABS plastic, or even balsa wood). The lighter the arm, the less your servos will have to work.....
OK! But I know there will be some calculations involved based on the weight of the pieces, size of the board (workspace of the arm), linkage length, the appropriate servo motor (power,…)
As for the Chess engine, have you checked out GNUChess? Or is this what you are using already?
Well, I am still investigating which chess engine to use and which GUI…any suggestion? I read those chess engine and associated GUI are free but I would like to know where is programming taking place?? (I am not talking about communication about chessboard or arm). What are we really programming here?
Why not start with an off the shelf board and pieces? Then you can concentrate on the arm and chess engine, once you have that all out of the way, then you can make your own...... It's kind of like "re inventing the wheel" so to speak, there is no need for it right now....
I am not trying to re-invent the wheel and I can even buy a chessboard with pieces but do you agree with me that I will have to customized it for it to communicate with the PC? Coz it will provide the inputs to the PC (chess engine) which will be listening to a port!
Another thing is while designing/making this. I must answer/solve for the following: how to recognise pieces by feature, ie I must come up with a way to differentiate between black and white pieces, and in each black/white I also need to differentiate between king, queen,…
And I don’t want to use camera + image processing as not my area + not interested! That ‘s why post #14 is just perfect IMO but I still have to understand a few thing in there!

Thanks
 

BMorse

Joined Sep 26, 2009
2,675
Well, so the pieces need to be customized too, but it can be done with existing pieces on the market, most are made up of some sort of plastic material, and can be easilly hollowed..... now, as for it differentiating between pieces and color, a color sensor could be implemented in the actual gripper, by using a white LED(or any color for that matter, but white would work well with black and white pieces) and a CDS photo cell, black pieces will reflect back less light than the white ones. Or, if you really want a way to ID each piece to include color, and shape, etc., then using RFID will be another way to go, the RFID reader can be located on the gripper, with RFID tags imbedded in each piece (this will also allow each piece to not have its own power source too), and a specific unique # ID assigned to each one, then the uC can "identify" each one as it interacts with it then just remember what location it placed that piece in, so it has a way to inform the Chess Engine on where each piece is at on the board..... if you want the board to also verify that there is a piece in that location, then you can place a CDS photocell on each square (light present = no piece, light not present = piece is there, etc.) and use an IC such as the 4051 Analog Demultiplexer IC (for example) to multiplex each grid position to only a few analog channels on the uC. (I am sure there are better demux's out there for the task), or creating an 8x8 matrix with actual switches should not be too complex, but it would be a lot easier than using the CDS photocells, but tactile switches wear out and your pieces would have to weight so much to press the switch, when there is no mechanical parts or contacts to wear out on CDS photcells.....
 

BMorse

Joined Sep 26, 2009
2,675
Would you elaborate more on how this ‘training’ of the arm works? Coz when I think of the programming part of it, it makes me sick coz the arm needs to be able to reach the 64 locations in the board and after each move it must return to its initial position.
Well, with the "training" like most industrial robots, would be done with a "pendant" or a way to manually control each axis, so for a 5 DOF arm you would need a way to move each segment with switches, and 1 button for telling the controller to "remember" this position, so you would have a switch for up, and down for each axis (or just have 1 set of switches to use on all axis', and just have the uC switch the input to which ever axis you are controlling), the pendant is usually connected to the actual controller for the arm, so when you "move it" you are just telling the uC to move the servo so many steps in either direction, this way the uC knows how many steps to get to where it is at, so you would manually move each axis until the arm is in position over the piece and once it is in place press the "train" button, then uC will store this data in the appropriate array to use later, the array data will also include the grid X,Y coordinates........
 
Top