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
navboard help (Read 1907 times)
radical
YaBB Newbies
*




Posts: 5
navboard help
10/12/09 at 11:31am
 
After connecting the navboard I was wondering what are the units of the tilt sensor and compass output and how the functions handle negative tilt. Also the compass command '$C' has been sending back the same output, 6553, regardless of the orientation of the srv-1.  
 
The current setup on the breakout board is as follows:
 
TP => TMR3
RX => UART1_RX
TX => UART1_TX
GND => I2C_GND
3.3V => I2C_3.3V
SDA => I2C_SDA
SCL => I2C_SCL
 
Any help would be greatly appreciated.
Back to top
 
 
  IP Logged
admin
YaBB Administrator
*****




Posts: 3676
Re: navboard help
Reply #1 - 10/12/09 at 12:25pm
 
Sorry - we haven't updated the firmware for the $C command, so it still expects a 2-axis HMC6352 rather than 3-axis HMC5843.
 
The I2C address of the HMC5843 is 0x1E.  To set up the HMC5843, you need to write the following
 
reg 00  0x20
reg 01  0x20
reg 02  0x00
 
Then, you can read the 3 axis in sequence by reading registers, 03 & 04, 05 & 06, 07 & 08.  The data is 16-bit, and I believe the high order byte comes first.
 
As regards the tilt sensor, the numbers range from approx -1000 to +1000 on each axis, so an axis that is level (perpendicular to the gravity vector) will show approximately 0.
 
Back to top
 
 

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




Posts: 168
Re: navboard help
Reply #2 - 10/13/09 at 4:35pm
 
int compass_inited = 0;
void read_compass() {
    unsigned char i2c_data[12];
    short ix, i, head, pitch, roll;
    unsigned char addr;
 
    // HMC5843
    addr = 0x1E;
    if (compass_inited == 0) {
     i2c_data[0] = 0x00; i2c_data[1] = 0x20; i2cwrite(addr, (unsigned char *)i2c_data, 2, SCCB_ON);
     i2c_data[0] = 0x01; i2c_data[1] = 0x20; i2cwrite(addr, (unsigned char *)i2c_data, 2, SCCB_ON);
     i2c_data[0] = 0x02; i2c_data[1] = 0x00; i2cwrite(addr, (unsigned char *)i2c_data, 2, SCCB_ON);
     delayMS(10);
     compass_inited = 1;
    }
    for(i = 0; i < 6; i++) i2c_data[i] = 0x00;
    i2c_data[0] = 0x03;
    i2cread(addr, (unsigned char *)i2c_data, 6, SCCB_ON);
    head = ((short) (i2c_data[0] * 256 + i2c_data[1]));
    pitch = ((short) (i2c_data[2] * 256 + i2c_data[3]));
    roll = ((short) (i2c_data[4] * 256 + i2c_data[5]));
    printf("##C x=%d y=%d z=%d [%d %d %d %d %d %d]\r\n", head, pitch, roll,
     i2c_data[0], i2c_data[1], i2c_data[2], i2c_data[3], i2c_data[4], i2c_data[5]);
}
Back to top
 
 
  IP Logged
admin
YaBB Administrator
*****




Posts: 3676
Re: navboard help
Reply #3 - 10/17/09 at 5:08pm
 
Andrei -  
 
Thanks for taking the trouble to post this.  I will add a $C command for HMC5843 so that the $c command will still work with HMC6352.  Not certain yet what the corresponding picoC command will be.
Back to top
 
 

SRV-1 Development Team
Surveyor Corporation
Email WWW   IP Logged
radical
YaBB Newbies
*




Posts: 5
Re: navboard help
Reply #4 - 10/19/09 at 10:11am
 
Thanks the code worked when I recompiled the firmware, I was wondering if I could use the same code to create a function in the picoc library? Also from the source it says that the y axis is pitch however it varies greatly when the heading of my SRV-1 changes. I don't really understand why the pitch would change with the heading changes while driving the SRV on a flat surface. Thanks for your help.
Back to top
 
 
  IP Logged
AndreiSk
Full Member
***




Posts: 168
Re: navboard help
Reply #5 - 10/19/09 at 10:36am
 
I have no idea, what size of rover you have,
I have good results when I moved compas away from body by long carbon pipe.
Compas at the end of pipe almost at top of picture
http://81.17.152.8/download/test/CIMG1918.JPG
 
I suspect with original SRV1 you will have big troubles with compas values.
Back to top
 
 
  IP Logged
admin
YaBB Administrator
*****




Posts: 3676
Re: navboard help
Reply #6 - 11/05/09 at 10:02am
 
Andrey's changes have been added to the latest firmware -  
    http://code.google.com/p/surveyor-srv1-firmware/downloads/list
 
The "$c" command accesses the HMC5843 raw data, though we still need to add some code to compute an actual heading.
Back to top
 
 

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