Driving an RCB4

KHR-1, KHR-2HV, KHR-3HV, ICS servos, RCB controllers and other Kondo products
37 postsPage 1 of 31, 2, 3
37 postsPage 1 of 31, 2, 3

Driving an RCB4

Post by Ausrobo » Mon Feb 15, 2010 11:59 pm

Post by Ausrobo
Mon Feb 15, 2010 11:59 pm

Does anybody know how to drive the serial com port of the RCB4? I am looking at using a Roboboard to drive the RCB and it in turn the servos.

I am looing for info on the electrical connection and also the commands I might use to do this?

Thanks,

Peter
Does anybody know how to drive the serial com port of the RCB4? I am looking at using a Roboboard to drive the RCB and it in turn the servos.

I am looing for info on the electrical connection and also the commands I might use to do this?

Thanks,

Peter
Ausrobo offline
Savvy Roboteer
Savvy Roboteer
Posts: 35
Joined: Sun Sep 27, 2009 10:05 pm

Post by chrisvo » Tue Feb 16, 2010 7:04 pm

Post by chrisvo
Tue Feb 16, 2010 7:04 pm

I wrote an C library called libkondo4 that will do this. I figured out how the serial protocol works when I did all the reverse engineering to translate the HTH4 program to English.

Here it is:
https://bitbucket.org/vo/libkondo4/

It's a very small, simple library which should compile just fine on the RoBoard. I don't have a RoBoard though, so I cannot test. The only prerequisite you will need is libusb. You just plug in your Kondo USB adapter to the RoBoard and you will be able to control the RCB-4. Right now, the only implemented functions are playing a motion (you tell it which motion you want to play by just giving the number 0 through 49), getting and setting options, and emulating button press / release (which lets you do just about anything you can do with the KRI-3 remote control unit).

As I mentioned, it uses the Kondo USB adapter right now, however, it is easily adaptable for use with standard serial port communications instead (there are several serial ports and digital I/Os on the RoBoard). However, you will need an additional low-voltage signal inversion circuit. I have a schematic that works if you are interested. It took a lot of trial and error, but I found a chip and resistor value that works.

I want to eventually create my own RCB-4 replacement (potentially as a daughterboard for the RoBoard). The ICS 3.0 protocol to directly control the servos is very simple and it's fully documented by Kondo. The reason why I am developing a replacement is so I can do high speed, parallel processing of sensor data (filtering, etc) and apply it to the control of the robot, including adding force sensors to the 3HV's feet. However, I may have to wait until later this year to do that. It's part of my research work.
I wrote an C library called libkondo4 that will do this. I figured out how the serial protocol works when I did all the reverse engineering to translate the HTH4 program to English.

Here it is:
https://bitbucket.org/vo/libkondo4/

It's a very small, simple library which should compile just fine on the RoBoard. I don't have a RoBoard though, so I cannot test. The only prerequisite you will need is libusb. You just plug in your Kondo USB adapter to the RoBoard and you will be able to control the RCB-4. Right now, the only implemented functions are playing a motion (you tell it which motion you want to play by just giving the number 0 through 49), getting and setting options, and emulating button press / release (which lets you do just about anything you can do with the KRI-3 remote control unit).

As I mentioned, it uses the Kondo USB adapter right now, however, it is easily adaptable for use with standard serial port communications instead (there are several serial ports and digital I/Os on the RoBoard). However, you will need an additional low-voltage signal inversion circuit. I have a schematic that works if you are interested. It took a lot of trial and error, but I found a chip and resistor value that works.

I want to eventually create my own RCB-4 replacement (potentially as a daughterboard for the RoBoard). The ICS 3.0 protocol to directly control the servos is very simple and it's fully documented by Kondo. The reason why I am developing a replacement is so I can do high speed, parallel processing of sensor data (filtering, etc) and apply it to the control of the robot, including adding force sensors to the 3HV's feet. However, I may have to wait until later this year to do that. It's part of my research work.
chrisvo offline
Savvy Roboteer
Savvy Roboteer
Posts: 132
Joined: Mon Nov 02, 2009 10:24 pm

Post by Ausrobo » Sat Feb 20, 2010 7:14 am

Post by Ausrobo
Sat Feb 20, 2010 7:14 am

Chris,

Great and thanks. I think perhaps Kondo need to put you on the payroll. :lol:

I will have a play with this over the coming weeks on a PC and let you know how I am getting on.

Do you have any links to the ICS command documentation. I have found one site but it’s very hard to work out from Japanese.

Thanks again for all you help!

Peter
Chris,

Great and thanks. I think perhaps Kondo need to put you on the payroll. :lol:

I will have a play with this over the coming weeks on a PC and let you know how I am getting on.

Do you have any links to the ICS command documentation. I have found one site but it’s very hard to work out from Japanese.

Thanks again for all you help!

Peter
Ausrobo offline
Savvy Roboteer
Savvy Roboteer
Posts: 35
Joined: Sun Sep 27, 2009 10:05 pm

Post by chrisvo » Sat Feb 20, 2010 7:47 am

Post by chrisvo
Sat Feb 20, 2010 7:47 am

Kondo hasn't even sent me a RCB-4 to fix the one that blew up yet...

The ICS 3.0 command reference is here:
http://kondo-robot.com/pdf/ICS30CommandRef.pdf
It's pretty simple, setting servo position is just sending 3 bytes (the id, and 2 bytes for the position). Getting most parameters (position, temperature, etc) is sending 2 bytes (the id, and the desired parameter).
Kondo hasn't even sent me a RCB-4 to fix the one that blew up yet...

The ICS 3.0 command reference is here:
http://kondo-robot.com/pdf/ICS30CommandRef.pdf
It's pretty simple, setting servo position is just sending 3 bytes (the id, and 2 bytes for the position). Getting most parameters (position, temperature, etc) is sending 2 bytes (the id, and the desired parameter).
chrisvo offline
Savvy Roboteer
Savvy Roboteer
Posts: 132
Joined: Mon Nov 02, 2009 10:24 pm

Post by neuralgorithm » Tue Sep 14, 2010 11:24 am

Post by neuralgorithm
Tue Sep 14, 2010 11:24 am

Kondo has published a reference manual for RCB4, which includes description of serial commands to drive multiple servos simultaneously.

http://kondo-robot.com/sys/archives/2477
Kondo has published a reference manual for RCB4, which includes description of serial commands to drive multiple servos simultaneously.

http://kondo-robot.com/sys/archives/2477
neuralgorithm offline
Newbie
Newbie
Posts: 1
Joined: Tue Sep 14, 2010 11:17 am

Post by chrisvo » Tue Sep 14, 2010 12:50 pm

Post by chrisvo
Tue Sep 14, 2010 12:50 pm

Yes, I intend to add the extra functionality to libkondo4 soon too, to make it implement 100% of the functionality. In particular, I want to add more of the ICS pass-through, figure out how to manage motion files (e.g. upload motions to memory), and also play dynamically-generated motions. I have an update already which I may upload soon which implements all of ICS 3 (for direct communication with servos).
Yes, I intend to add the extra functionality to libkondo4 soon too, to make it implement 100% of the functionality. In particular, I want to add more of the ICS pass-through, figure out how to manage motion files (e.g. upload motions to memory), and also play dynamically-generated motions. I have an update already which I may upload soon which implements all of ICS 3 (for direct communication with servos).
chrisvo offline
Savvy Roboteer
Savvy Roboteer
Posts: 132
Joined: Mon Nov 02, 2009 10:24 pm

Troubles running your libKondo4

Post by amuthelet » Sat Oct 02, 2010 4:04 pm

Post by amuthelet
Sat Oct 02, 2010 4:04 pm

Hello chrisvo,
Thanks very much for sharing your lib ! I'm trying to use it, but couldn't ping my RCB4 controller.

When running run_motion.exe, it loops forever inside the do..while of kondo_read_timeout function.
I run Ubuntu 9.10 and installed libusb as described.

My RCB4 is ok, communication is fine inside HTH4 / Windows (thanks to your translation !). I'm a bit stucked..

Sorry for bothering, but would you have any idea of my problem here ?

Cheers,
Arnaud.

CallStack just in case..
#0 ( kondo_read_timeout(ki=0x804a060, n=4, usecs=1000000) (/home/arnaud/Documents/Robotics/libkondo4/rcb4.c:129)
#1 0x56eb8f kondo_trx(ki=0x804a060, out_bytes=4, in_bytes=4) (/home/arnaud/Documents/Robotics/libkondo4/rcb4.c:231)
#2 0x56ec71 kondo_ack(ki=0x804a060) (/home/arnaud/Documents/Robotics/libkondo4/rcb4.c:261)
#3 0x56e44a kondo_init_custom(ki=0x804a060, baud=115200, vid=5724, pid=7, interface=0) (/home/arnaud/Documents/Robotics/libkondo4/rcb4.c:54)
#4 0x56e235 kondo_init(ki=0x804a060) (/home/arnaud/Documents/Robotics/libkondo4/rcb4.c:17)
#5 0x8048713 main(argc=2, argv=0xbffff784) (/home/arnaud/Documents/Robotics/libkondo4/utils/run_motion.c:20)
Hello chrisvo,
Thanks very much for sharing your lib ! I'm trying to use it, but couldn't ping my RCB4 controller.

When running run_motion.exe, it loops forever inside the do..while of kondo_read_timeout function.
I run Ubuntu 9.10 and installed libusb as described.

My RCB4 is ok, communication is fine inside HTH4 / Windows (thanks to your translation !). I'm a bit stucked..

Sorry for bothering, but would you have any idea of my problem here ?

Cheers,
Arnaud.

CallStack just in case..
#0 ( kondo_read_timeout(ki=0x804a060, n=4, usecs=1000000) (/home/arnaud/Documents/Robotics/libkondo4/rcb4.c:129)
#1 0x56eb8f kondo_trx(ki=0x804a060, out_bytes=4, in_bytes=4) (/home/arnaud/Documents/Robotics/libkondo4/rcb4.c:231)
#2 0x56ec71 kondo_ack(ki=0x804a060) (/home/arnaud/Documents/Robotics/libkondo4/rcb4.c:261)
#3 0x56e44a kondo_init_custom(ki=0x804a060, baud=115200, vid=5724, pid=7, interface=0) (/home/arnaud/Documents/Robotics/libkondo4/rcb4.c:54)
#4 0x56e235 kondo_init(ki=0x804a060) (/home/arnaud/Documents/Robotics/libkondo4/rcb4.c:17)
#5 0x8048713 main(argc=2, argv=0xbffff784) (/home/arnaud/Documents/Robotics/libkondo4/utils/run_motion.c:20)
amuthelet offline
Savvy Roboteer
Savvy Roboteer
Posts: 27
Joined: Tue Jun 08, 2010 12:33 pm

Post by chrisvo » Sat Oct 02, 2010 4:55 pm

Post by chrisvo
Sat Oct 02, 2010 4:55 pm

amuthelet:

In the init function, it sends an ACK to the rcb4 and waits for at most 1000000 microseconds (1 second) for a response. To wait for the data, it polls the USB device repeatedly until 1 second has elapsed. This may be too fast for your system.

Try putting a usleep at the end of that kondo_read_timeout loop so that it doesn't poll fast. I suggest trying around 15ms or so, maybe higher.
e.g.
usleep(15000); // 15 ms

I may try to find a more reasonable way to wait for incoming data besides polling...
amuthelet:

In the init function, it sends an ACK to the rcb4 and waits for at most 1000000 microseconds (1 second) for a response. To wait for the data, it polls the USB device repeatedly until 1 second has elapsed. This may be too fast for your system.

Try putting a usleep at the end of that kondo_read_timeout loop so that it doesn't poll fast. I suggest trying around 15ms or so, maybe higher.
e.g.
usleep(15000); // 15 ms

I may try to find a more reasonable way to wait for incoming data besides polling...
chrisvo offline
Savvy Roboteer
Savvy Roboteer
Posts: 132
Joined: Mon Nov 02, 2009 10:24 pm

Post by amuthelet » Mon Oct 18, 2010 12:06 pm

Post by amuthelet
Mon Oct 18, 2010 12:06 pm

Hi,
Thanks for your response.
The usleep don't solve the issue unfortunately. I tried on another PC, and also tried a different linux distrib (Fedora): I have the same pb. Do I miss somthing in my system prereqs ? I didn't install any specific sw on my system (except lib usb), as I believe fdti lib is independant from kernel drivers (I read some posts in this forum about flashing the eeprom with different VID/PID to make the interface visible from standard drivers:I didn't do that, but I suppose this is not required when using ftdi lib. Am I right ?).

Strangely enough I have the exact same behavior (infinite loop inside kondo_read_timeout) when robot power is on or off ..Really looks like there is no communication at all with my rcb4 controller, which works fine under Windows.

usb_bulk_read seems to fail retrieving any value. I have a couple of warnings on usb_bulk_read when building ftdi (signedness mismatch / unsigned char vs. char) but I assume there is no major issue here. I can run ftdi_read_chipid successfully. I tried to run kondo_read instead of kondo_read_timeout, the read values are always 0.

I'm running out of ideas...Would you have other suggestions ?
Thanks !
Cheers,
Arnaud.
Hi,
Thanks for your response.
The usleep don't solve the issue unfortunately. I tried on another PC, and also tried a different linux distrib (Fedora): I have the same pb. Do I miss somthing in my system prereqs ? I didn't install any specific sw on my system (except lib usb), as I believe fdti lib is independant from kernel drivers (I read some posts in this forum about flashing the eeprom with different VID/PID to make the interface visible from standard drivers:I didn't do that, but I suppose this is not required when using ftdi lib. Am I right ?).

Strangely enough I have the exact same behavior (infinite loop inside kondo_read_timeout) when robot power is on or off ..Really looks like there is no communication at all with my rcb4 controller, which works fine under Windows.

usb_bulk_read seems to fail retrieving any value. I have a couple of warnings on usb_bulk_read when building ftdi (signedness mismatch / unsigned char vs. char) but I assume there is no major issue here. I can run ftdi_read_chipid successfully. I tried to run kondo_read instead of kondo_read_timeout, the read values are always 0.

I'm running out of ideas...Would you have other suggestions ?
Thanks !
Cheers,
Arnaud.
amuthelet offline
Savvy Roboteer
Savvy Roboteer
Posts: 27
Joined: Tue Jun 08, 2010 12:33 pm

Post by chrisvo » Mon Oct 18, 2010 2:34 pm

Post by chrisvo
Mon Oct 18, 2010 2:34 pm

You are correct, flashing the VID/PID is NOT necessary for libftdi. We use the adapters as they came from Kondo. However, if you do flash the VID/PID, it will also work, if you kondo_init with the correct VID/PID combination.

What baud rate do you have the RCB-4 set to in Windows Heart2Heart? libkondo4 by default is set up for 115200 only.

We use libkondo4 on many machines, actually, Ubuntu 9.04, 9.10, 10.10; even Mac OS X with no issues. However, all of the machines are Intel x86. Are you using a different architecture, like ARM? I have compiled and executed libkondo4 programs on several ARM platforms as well, but there might be an architecture that it doesn't work for, perhaps because of endianness.

In kondo_init_custom, you might notice that it initializes ki->debug to 0 at the top of the function, try setting that to 1 and see if it outputs anything. Looking at that output can give us an idea if it is having a problem constructing the packets, and why an infinite loop might be happening.

Also, try the official release of libftdi too:
http://www.intra2net.com/en/developer/libftdi/

I will also investigate the infinite loop issue some more when i get to the lab today.
You are correct, flashing the VID/PID is NOT necessary for libftdi. We use the adapters as they came from Kondo. However, if you do flash the VID/PID, it will also work, if you kondo_init with the correct VID/PID combination.

What baud rate do you have the RCB-4 set to in Windows Heart2Heart? libkondo4 by default is set up for 115200 only.

We use libkondo4 on many machines, actually, Ubuntu 9.04, 9.10, 10.10; even Mac OS X with no issues. However, all of the machines are Intel x86. Are you using a different architecture, like ARM? I have compiled and executed libkondo4 programs on several ARM platforms as well, but there might be an architecture that it doesn't work for, perhaps because of endianness.

In kondo_init_custom, you might notice that it initializes ki->debug to 0 at the top of the function, try setting that to 1 and see if it outputs anything. Looking at that output can give us an idea if it is having a problem constructing the packets, and why an infinite loop might be happening.

Also, try the official release of libftdi too:
http://www.intra2net.com/en/developer/libftdi/

I will also investigate the infinite loop issue some more when i get to the lab today.
chrisvo offline
Savvy Roboteer
Savvy Roboteer
Posts: 132
Joined: Mon Nov 02, 2009 10:24 pm

Post by chrisvo » Mon Oct 18, 2010 6:31 pm

Post by chrisvo
Mon Oct 18, 2010 6:31 pm

I have discovered one of the flaws, if you put a timeout into kondo_read_timeout that is greater than 1 second (1000000 microseconds) it will infinite loop. I'm fixing that now. Thanks!
I have discovered one of the flaws, if you put a timeout into kondo_read_timeout that is greater than 1 second (1000000 microseconds) it will infinite loop. I'm fixing that now. Thanks!
chrisvo offline
Savvy Roboteer
Savvy Roboteer
Posts: 132
Joined: Mon Nov 02, 2009 10:24 pm

Post by amuthelet » Mon Oct 18, 2010 11:22 pm

Post by amuthelet
Mon Oct 18, 2010 11:22 pm

Many thanks for your lightning speed answers !!
Well it's better with smaller timeout values indeed, ..but still could not launch any motion / read analog value (I have infrared sensor plugged to AD1, but the returned value is always 64)

$ sudo ./run_motion 0
send 19 bytes: 13 0 2 0 0 0 21 0 fd 3 0 0 0 0 0 0 0 0 36
recv 0 bytes:
send 7 bytes: 7 c b8 b 0 0 d6
recv 0 bytes:
ERROR: kondo_play_motion: Bad response trying to call the motion.

$ sudo ./test_analog
Analog value of AD1: 64
Analog value of AD1: 64
Analog value of AD1: 64

..same results whether power is OFF or ON on the robot...

I already tested with latest ftdi release, without any success.
My hardware is a Dell M90 laptop (x86).
Baud rate on Windows is also set to 115200. By the way under HTH I also define COM port to COM5. Is there something in your code I should change ? I see a couple of defines:
#define RCB4_DEV_RAM 0x00 // RAM
#define RCB4_DEV_DEV 0x01 // Device
#define RCB4_DEV_COM 0x02 // COM port
#define RCB4_DEV_ROM 0x03 // ROM

but the don't seem to be used...

The warnings I get when building code:

/home/arnaud/Documents/libftdi-0.18/src/ftdi.c:1567: warning: pointer targets in passing argument 3 of ‘usb_bulk_read’ differ in signedness
/usr/local/include/usb.h:299: note: expected ‘char *’ but argument is of type ‘unsigned char *’
/home/arnaud/Documents/libftdi-0.18/src/ftdi.c: In function ‘ftdi_eeprom_decode’:
/home/arnaud/Documents/libftdi-0.18/src/ftdi.c:2355: warning: unused variable ‘size_check’
/home/arnaud/Documents/libftdi-0.18/src/ftdi.c: In function ‘ftdi_read_eeprom’:
/home/arnaud/Documents/libftdi-0.18/src/ftdi.c:2547: warning: pointer targets in passing argument 6 of ‘usb_control_msg’ differ in signedness
/usr/local/include/usb.h:305: note: expected ‘char *’ but argument is of type ‘unsigned char *’
/home/arnaud/Documents/libftdi-0.18/src/ftdi.c: In function ‘ftdi_read_eeprom_getsize’:
/home/arnaud/Documents/libftdi-0.18/src/ftdi.c:2631: warning: pointer targets in passing argument 6 of ‘usb_control_msg’ differ in signedness
/usr/local/include/usb.h:305: note: expected ‘char *’ but argument is of type ‘unsigned char *’
Compiling: ../../libkondo4/ics.c
/home/arnaud/libkondo4/ics.c: In function ‘ics_init’:
/home/arnaud/libkondo4/ics.c:12: warning: unused variable ‘i’
/home/arnaud/libkondo4/ics.c: In function ‘ics_read_timeout’:
/home/arnaud/libkondo4/ics.c:95: warning: implicit declaration of function ‘gettimeofday’
Compiling: ../../libkondo4/rcb4.c
/home/arnaud/libkondo4/rcb4.c: In function ‘kondo_read_timeout’:
/home/arnaud/libkondo4/rcb4.c:123: warning: implicit declaration of function ‘gettimeofday’
/home/arnaud/libkondo4/rcb4.c: In function ‘kondo_load_asciihex’:
/home/arnaud/libkondo4/rcb4.c:187: warning: implicit declaration of function ‘isxdigit’
/home/arnaud/libkondo4/rcb4.c:181: warning: unused variable ‘result’
/home/arnaud/libkondo4/rcb4.c: In function ‘kondo_set_counter’:
/home/arnaud/libkondo4/rcb4.c:757: warning: control reaches end of non-void function
/home/arnaud/libkondo4/rcb4.c: In function ‘kondo_write_pio’:
/home/arnaud/libkondo4/rcb4.c:725: warning: control reaches end of non-void function
/home/arnaud/libkondo4/rcb4.c: In function ‘kondo_set_pio_direction’:
/home/arnaud/libkondo4/rcb4.c:650: warning: control reaches end of non-void function
Many thanks for your lightning speed answers !!
Well it's better with smaller timeout values indeed, ..but still could not launch any motion / read analog value (I have infrared sensor plugged to AD1, but the returned value is always 64)

$ sudo ./run_motion 0
send 19 bytes: 13 0 2 0 0 0 21 0 fd 3 0 0 0 0 0 0 0 0 36
recv 0 bytes:
send 7 bytes: 7 c b8 b 0 0 d6
recv 0 bytes:
ERROR: kondo_play_motion: Bad response trying to call the motion.

$ sudo ./test_analog
Analog value of AD1: 64
Analog value of AD1: 64
Analog value of AD1: 64

..same results whether power is OFF or ON on the robot...

I already tested with latest ftdi release, without any success.
My hardware is a Dell M90 laptop (x86).
Baud rate on Windows is also set to 115200. By the way under HTH I also define COM port to COM5. Is there something in your code I should change ? I see a couple of defines:
#define RCB4_DEV_RAM 0x00 // RAM
#define RCB4_DEV_DEV 0x01 // Device
#define RCB4_DEV_COM 0x02 // COM port
#define RCB4_DEV_ROM 0x03 // ROM

but the don't seem to be used...

The warnings I get when building code:

/home/arnaud/Documents/libftdi-0.18/src/ftdi.c:1567: warning: pointer targets in passing argument 3 of ‘usb_bulk_read’ differ in signedness
/usr/local/include/usb.h:299: note: expected ‘char *’ but argument is of type ‘unsigned char *’
/home/arnaud/Documents/libftdi-0.18/src/ftdi.c: In function ‘ftdi_eeprom_decode’:
/home/arnaud/Documents/libftdi-0.18/src/ftdi.c:2355: warning: unused variable ‘size_check’
/home/arnaud/Documents/libftdi-0.18/src/ftdi.c: In function ‘ftdi_read_eeprom’:
/home/arnaud/Documents/libftdi-0.18/src/ftdi.c:2547: warning: pointer targets in passing argument 6 of ‘usb_control_msg’ differ in signedness
/usr/local/include/usb.h:305: note: expected ‘char *’ but argument is of type ‘unsigned char *’
/home/arnaud/Documents/libftdi-0.18/src/ftdi.c: In function ‘ftdi_read_eeprom_getsize’:
/home/arnaud/Documents/libftdi-0.18/src/ftdi.c:2631: warning: pointer targets in passing argument 6 of ‘usb_control_msg’ differ in signedness
/usr/local/include/usb.h:305: note: expected ‘char *’ but argument is of type ‘unsigned char *’
Compiling: ../../libkondo4/ics.c
/home/arnaud/libkondo4/ics.c: In function ‘ics_init’:
/home/arnaud/libkondo4/ics.c:12: warning: unused variable ‘i’
/home/arnaud/libkondo4/ics.c: In function ‘ics_read_timeout’:
/home/arnaud/libkondo4/ics.c:95: warning: implicit declaration of function ‘gettimeofday’
Compiling: ../../libkondo4/rcb4.c
/home/arnaud/libkondo4/rcb4.c: In function ‘kondo_read_timeout’:
/home/arnaud/libkondo4/rcb4.c:123: warning: implicit declaration of function ‘gettimeofday’
/home/arnaud/libkondo4/rcb4.c: In function ‘kondo_load_asciihex’:
/home/arnaud/libkondo4/rcb4.c:187: warning: implicit declaration of function ‘isxdigit’
/home/arnaud/libkondo4/rcb4.c:181: warning: unused variable ‘result’
/home/arnaud/libkondo4/rcb4.c: In function ‘kondo_set_counter’:
/home/arnaud/libkondo4/rcb4.c:757: warning: control reaches end of non-void function
/home/arnaud/libkondo4/rcb4.c: In function ‘kondo_write_pio’:
/home/arnaud/libkondo4/rcb4.c:725: warning: control reaches end of non-void function
/home/arnaud/libkondo4/rcb4.c: In function ‘kondo_set_pio_direction’:
/home/arnaud/libkondo4/rcb4.c:650: warning: control reaches end of non-void function
amuthelet offline
Savvy Roboteer
Savvy Roboteer
Posts: 27
Joined: Tue Jun 08, 2010 12:33 pm

Post by chrisvo » Mon Oct 18, 2010 11:45 pm

Post by chrisvo
Mon Oct 18, 2010 11:45 pm

Please update your copy of libkondo4, I have uploaded a new version with some bug fixes.

amuthelet wrote:send 7 bytes: 7 c b8 b 0 0 d6
recv 0 bytes:
ERROR: kondo_play_motion: Bad response trying to call the motion.


This is what happens when the robot is not connected or isn't responding. libkondo4 made the correct packets and then tried to send them out the serial port but got no response from the robot. This is a problem somewhere in the serial communication, either in libftdi, libusb, or in the physical connection between the USB serial adapter and the RCB-4HV.

If you have access to an oscilloscope, I highly recommend probing the middle pin of the three-pin connector to see if any bytes are coming out of the USB-serial adapter when you run the code.

Is there something in your code I should change ? I see a couple of defines:


No, you should not have to change any of that. The only defines you might change are maybe the VID/PID if you are using a different FTDI device or if you have modified the VID/PID of the usb-serial adapter.

Code: Select all
The warnings I get when building code:


I am worried about these, I'm not sure why you are getting those yet. I have a feeling you're missing the -dev version of some set of libraries or something. I'll look further to see what I can find but right now I have never seen this before.

In particular, "implicit declaration" is a bad sign because it usually means it couldn't find the definition of those functions so it implicitly declared them instead...
Please update your copy of libkondo4, I have uploaded a new version with some bug fixes.

amuthelet wrote:send 7 bytes: 7 c b8 b 0 0 d6
recv 0 bytes:
ERROR: kondo_play_motion: Bad response trying to call the motion.


This is what happens when the robot is not connected or isn't responding. libkondo4 made the correct packets and then tried to send them out the serial port but got no response from the robot. This is a problem somewhere in the serial communication, either in libftdi, libusb, or in the physical connection between the USB serial adapter and the RCB-4HV.

If you have access to an oscilloscope, I highly recommend probing the middle pin of the three-pin connector to see if any bytes are coming out of the USB-serial adapter when you run the code.

Is there something in your code I should change ? I see a couple of defines:


No, you should not have to change any of that. The only defines you might change are maybe the VID/PID if you are using a different FTDI device or if you have modified the VID/PID of the usb-serial adapter.

Code: Select all
The warnings I get when building code:


I am worried about these, I'm not sure why you are getting those yet. I have a feeling you're missing the -dev version of some set of libraries or something. I'll look further to see what I can find but right now I have never seen this before.

In particular, "implicit declaration" is a bad sign because it usually means it couldn't find the definition of those functions so it implicitly declared them instead...
chrisvo offline
Savvy Roboteer
Savvy Roboteer
Posts: 132
Joined: Mon Nov 02, 2009 10:24 pm

Post by amuthelet » Sun Oct 24, 2010 2:28 pm

Post by amuthelet
Sun Oct 24, 2010 2:28 pm

Hi chrisvo,
Finally made it work by changing baud rate from 115200 to 1250000 (?):
#define RCB4_BAUD 1250000

I now receive a correct ack from my metallic buddy, and can get correct analog value and play motion correctly.

Still have problems to connect to ICS device though. test_ics returns:
"Could not init: ERROR: ics_init (open usb device): device not found"

I'm working on it.. but couldn't see any device with corresponding PID (0x6011 / VID (0x0403) when running libusb tools such as /libusb-0.1.12/tests/testlibusb or /libusb-0.1.12/tests/descriptor_test.

Cheers,
Arnaud.
Hi chrisvo,
Finally made it work by changing baud rate from 115200 to 1250000 (?):
#define RCB4_BAUD 1250000

I now receive a correct ack from my metallic buddy, and can get correct analog value and play motion correctly.

Still have problems to connect to ICS device though. test_ics returns:
"Could not init: ERROR: ics_init (open usb device): device not found"

I'm working on it.. but couldn't see any device with corresponding PID (0x6011 / VID (0x0403) when running libusb tools such as /libusb-0.1.12/tests/testlibusb or /libusb-0.1.12/tests/descriptor_test.

Cheers,
Arnaud.
amuthelet offline
Savvy Roboteer
Savvy Roboteer
Posts: 27
Joined: Tue Jun 08, 2010 12:33 pm

Post by amuthelet » Sun Oct 24, 2010 7:15 pm

Post by amuthelet
Sun Oct 24, 2010 7:15 pm

mmh well ok if PID / VID is different in your code, I was just wondering if it's not because I need a different FTDI device to send ICS packet to servos through RCB4 ? Or can I "play" ICS with my standard Kondo USB HS device ?
A/
mmh well ok if PID / VID is different in your code, I was just wondering if it's not because I need a different FTDI device to send ICS packet to servos through RCB4 ? Or can I "play" ICS with my standard Kondo USB HS device ?
A/
amuthelet offline
Savvy Roboteer
Savvy Roboteer
Posts: 27
Joined: Tue Jun 08, 2010 12:33 pm

Next
Next
37 postsPage 1 of 31, 2, 3
37 postsPage 1 of 31, 2, 3