Welcome, Guest. Please Login.
Surveyor Corporation Surveyor SRV-1
Home Help Search Login

Surveyor Robotics Forum

Welcome to the user support forum for Surveyor SRV-1 robots, SRV-1 robot controllers and SVS stereo vision systems. To register for this forum, please send an email to support@surveyor.com which includes your desired forum user name, your registration email address, and a brief explanation of why you wish to join, and we will create a forum account for you.

Please note that there is a Search button in the forum toolbar for forum topics. Another effective search method for the entire surveyor.com site is to use Google, e.g. "xyz site://www.surveyor.com" where "xyz" is the search topic.



Pages: 1
Send Topic Print
Latest firmware - srv-blackfin-122908 - adds chess (Read 4085 times)
admin
YaBB Administrator
*****




Posts: 3676
Latest firmware - srv-blackfin-122908 - adds chess
12/26/08 at 9:54am
 
http://www.surveyor.com/blackfin/srv-blackfin-122908.zip
    or
http://code.google.com/p/surveyor-srv1-firmware/
 
The latest SRV-1 firmware includes something unexpected - a very compact, portable chess engine called TSCP ( http://www.tckerrigan.com/Chess/TSCP ).  The TSCP program code fits into slightly more than 9kB.  It resides in SDRAM, but could instead be loaded into L1 cache for significantly better performance.  
 
Besides being an interesting exercise in porting new functions to the SRV-1, part of the concept was that someone might eventually want to add vision processing functions to actually recognize chess piece positions on a board and even a manipulator to move the pieces.  If someone went to that much trouble, they might want a stronger chess engine or an adaptive engine that learned, but TSCP is a good starting point.
 
In order to support the book.txt book openings used with TSCP, we added some firmware commands to read/write the SRV-1's flash memory.  The commands 'zWxx' and 'zRxx', where xx is the 64kB sector numbered from 02-63 (00 and 01 are the boot sectors, and are blocked from access).  We set up TSCP to automatically load the book openings from sector 05, so book.txt needs to be uploaded via XMODEM and then written to flash using 'zW05'
 
The other significant change to this version of firmware is a fix for the motor direction function setPWM() which caused problems with RoboRealm.
 
=============
update - the latest version of srv-blackfin-122908.zip runs chess from L1 and fixes serious memory indexing problem.  also, book openings now work properly
Back to top
 
« Last Edit: 12/31/08 at 9:37am by admin »  

SRV-1 Development Team
Surveyor Corporation
Email WWW   IP Logged
mshapiro
Full Member
***




Posts: 145
Re: Latest firmware - srv-blackfin-122608 - adds c
Reply #1 - 12/28/08 at 10:44am
 
I just got the latest firmware through svn and tried to compile it, but I got a long series of errors when trying to compile the chess module.  It started with not finding chess.h and then many errors of undefined functions (which are, no doubt, in chess.h).
Back to top
 
 
  IP Logged
admin
YaBB Administrator
*****




Posts: 3676
Re: Latest firmware - srv-blackfin-122608 - adds c
Reply #2 - 12/28/08 at 11:23am
 
Sorry - it was in the zip archives but we forgot to add it to the svn archive.  It's there now -
    http://code.google.com/p/surveyor-srv1-firmware/source/browse/trunk/blackfin/srv /chess.h
 
I need to note that the chess move generator is misbehaving, and I have not isolated the problem.  At first, I thought it might be the rand() function, and changed to a linear feedback shift register with a period of 2^32, but it's still happening. TSCP is mature code, so we must somehow be clobbering memory to cause this problem.
Back to top
 
 

SRV-1 Development Team
Surveyor Corporation
Email WWW   IP Logged
admin
YaBB Administrator
*****




Posts: 3676
Re: Latest firmware - srv-blackfin-122908 w/chess
Reply #3 - 12/29/08 at 7:11am
 
Chess engine issues are hopefully now all resolved -
     http://code.google.com/p/surveyor-srv1-firmware/
            or
     http://www.surveyor.com/blackfin/srv-blackfin-122908.zip
 
The original TSCP code used multi-dimension static arrays, eg history[][], and these had to be dynamically allocated using malloc() because of limited Blackfin L1 memory.  In theory, the pointer type "int **history" could be used to replace "int history[][]", but this turns out generate some bogus addresses.  So the dynamically allocated arrays in chess.c are now single dimension, and the program seems to be working properly.  Book openings now work as well.
 
For testing, you can let the robot play itself by entering the "on" command for each move.
 
Don't forget to upload and save the book openings.  Use a script like "send1" or a terminal program such as TeraTerm to upload "book.txt" via XMODEM, confirm that it arrived in the flash buffer using "zd" - you'll see stuff like this -
 
g1f3 g8f6 c2c4 b7b6 g2g3
g1f3 g8f6 c2c4 c7c5 b1c3 b8c6
g1f3 g8f6 c2c4 c7c5 b1c3 e7e6 g2g3 b7b6 f1g2 c8b7 e1g1 f8e7
g1f3 g8f6 c2c4 c7c5 g2g3
g1f3 g8f6 c2c4 e7e6 b1c3 d7d5 d2d4 b8d7
g1f3 g8f6 c2c4 e7e6 b1c3 d7d5 d2d4 f8e7 c1f4 e8g8 e2e3
g1f3 g8f6 c2c4 e7e6 b1c3 d7d5 d2d4 f8e7 c1g5 h7h6 g5h4 e8g8 e2e3 b7b6
 
Then save it to flash sector 5 with "zW05"
 
You can confirm that it arrived by clearing the buffer with "zc", then read with "zR05", then view again with "zd"
Back to top
 
« Last Edit: 12/29/08 at 7:16am by admin »  

SRV-1 Development Team
Surveyor Corporation
Email WWW   IP Logged
Pages: 1
Send Topic Print