Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

Driving an RCB4

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

Green LED

Post by keukpa » Wed Oct 26, 2011 1:23 pm

Post by keukpa
Wed Oct 26, 2011 1:23 pm

Ok, I've managed to write a function to switch the green LED on and Off and this works perfectly.

I did this by constructing a swap[] with the following data:

09 00 02 00 00 1F 80 AA

and sending this directly to the board via kondo_trx(...)

I've noticed that when using the HeartToHeart4 program before you can move any Servos you need to click on the 'RAM' button, which then according to the console output sends LOADS of data to the board, it sends 34 lines of a particular byte code which I assume inits the servos in some way??

So my question is thus, with libkondo4, before I can move the servos, do I not need to first init the servos and the board in the same way the RAM button on the HeartToHeart4 program does? kondo_init() seems to just init the serial comms to the RCB4 not actually inform the EEPROM where the servos are, etc.....

Cheers,

Keukpa
Ok, I've managed to write a function to switch the green LED on and Off and this works perfectly.

I did this by constructing a swap[] with the following data:

09 00 02 00 00 1F 80 AA

and sending this directly to the board via kondo_trx(...)

I've noticed that when using the HeartToHeart4 program before you can move any Servos you need to click on the 'RAM' button, which then according to the console output sends LOADS of data to the board, it sends 34 lines of a particular byte code which I assume inits the servos in some way??

So my question is thus, with libkondo4, before I can move the servos, do I not need to first init the servos and the board in the same way the RAM button on the HeartToHeart4 program does? kondo_init() seems to just init the serial comms to the RCB4 not actually inform the EEPROM where the servos are, etc.....

Cheers,

Keukpa
keukpa
Robot Builder
Robot Builder
Posts: 15
Joined: Wed Feb 23, 2011 11:29 pm

Post by amuthelet » Thu Oct 27, 2011 11:23 pm

Post by amuthelet
Thu Oct 27, 2011 11:23 pm

Hello Keupka,

Did you double check your baud rate ? Most problems I had with libkondo where related to erroneous baud rates. You may want to check that RCB4_BAUD is set to the same value as the one you defined inside HeartToHeart:

#define RCB4_BAUD 1250000 (or else)

By the way, here is a (not very optimized) function I added to libkondo to send servo pos by servo ID:

int kondo_set_servo_pos(KondoRef ki, UINT servo_id, UINT frame)
{
assert(ki);

// init array
UCHAR servos[5];
int no;
for(no=0; no<5; no++)
servos[no] = 0b0000000;

div_t divresult;
divresult = div (servo_id,8);
servos[4 - divresult.quot] = 0b00000001 << divresult.rem;

return kondo_send_ics_pos(ki, servos, frame);

}

Servo IDs being as shown in the attached picture.

Hope this can help,
Cheers,
Arnaud.
Hello Keupka,

Did you double check your baud rate ? Most problems I had with libkondo where related to erroneous baud rates. You may want to check that RCB4_BAUD is set to the same value as the one you defined inside HeartToHeart:

#define RCB4_BAUD 1250000 (or else)

By the way, here is a (not very optimized) function I added to libkondo to send servo pos by servo ID:

int kondo_set_servo_pos(KondoRef ki, UINT servo_id, UINT frame)
{
assert(ki);

// init array
UCHAR servos[5];
int no;
for(no=0; no<5; no++)
servos[no] = 0b0000000;

div_t divresult;
divresult = div (servo_id,8);
servos[4 - divresult.quot] = 0b00000001 << divresult.rem;

return kondo_send_ics_pos(ki, servos, frame);

}

Servo IDs being as shown in the attached picture.

Hope this can help,
Cheers,
Arnaud.
amuthelet
Savvy Roboteer
Savvy Roboteer
Posts: 27
Joined: Tue Jun 08, 2010 12:33 pm

Post by amuthelet » Thu Oct 27, 2011 11:28 pm

Post by amuthelet
Thu Oct 27, 2011 11:28 pm

Image
Image
amuthelet
Savvy Roboteer
Savvy Roboteer
Posts: 27
Joined: Tue Jun 08, 2010 12:33 pm

Sucess

Post by keukpa » Fri Oct 28, 2011 10:49 pm

Post by keukpa
Fri Oct 28, 2011 10:49 pm

amuthelet,

No, that code does not work for me either!

I do not see how libkondo4 can even work, it misses out a LOT of servo, EEPROM and RCB4 initialisation. Unless I'm missing some command here (and please tell me if I am), I fail to see how it works.

When you run Heart2Heart 4, before you can even contemplate moving the servos, you have to click the RAM button. This initialises all the servos and the RCB4 board by telling the board, exactly which servos are active, and their address on the bus. libkondo4 doesn't seem to do this.

Myself and a colleague have spent the past week reverse engineering the HeartToHeart4 program, and we now have a fully working program that can easily drive any servo on any SIO# we choose. We can even do this without the need for the ftdi header. You just address the com port directly (windows and linux).

Thanks for all the support you guys have provided tho. But now we've sorted the byte codes out, it is surprisingly easy to control these servos.

Cheers,

Keukpa
amuthelet,

No, that code does not work for me either!

I do not see how libkondo4 can even work, it misses out a LOT of servo, EEPROM and RCB4 initialisation. Unless I'm missing some command here (and please tell me if I am), I fail to see how it works.

When you run Heart2Heart 4, before you can even contemplate moving the servos, you have to click the RAM button. This initialises all the servos and the RCB4 board by telling the board, exactly which servos are active, and their address on the bus. libkondo4 doesn't seem to do this.

Myself and a colleague have spent the past week reverse engineering the HeartToHeart4 program, and we now have a fully working program that can easily drive any servo on any SIO# we choose. We can even do this without the need for the ftdi header. You just address the com port directly (windows and linux).

Thanks for all the support you guys have provided tho. But now we've sorted the byte codes out, it is surprisingly easy to control these servos.

Cheers,

Keukpa
keukpa
Robot Builder
Robot Builder
Posts: 15
Joined: Wed Feb 23, 2011 11:29 pm

Post by chrisvo » Mon Nov 28, 2011 11:46 am

Post by chrisvo
Mon Nov 28, 2011 11:46 am

The RCB4 needs to know which servos are active and their address on the bus, but it's all saved to ROM so that you can power it up and use the remote control as intended by Kondo.

You don't need to reverse engineer Heart2Heart4 anymore by the way, the manual with all memory addresses and commands and their meanings is available from Kondo directly on their web site.

Libkondo4 also mentions in the docs that you do not need the ftdi header, example code is included for addressing the COM port directly.
The RCB4 needs to know which servos are active and their address on the bus, but it's all saved to ROM so that you can power it up and use the remote control as intended by Kondo.

You don't need to reverse engineer Heart2Heart4 anymore by the way, the manual with all memory addresses and commands and their meanings is available from Kondo directly on their web site.

Libkondo4 also mentions in the docs that you do not need the ftdi header, example code is included for addressing the COM port directly.
chrisvo
Savvy Roboteer
Savvy Roboteer
Posts: 132
Joined: Mon Nov 02, 2009 10:24 pm

RCB4 Access

Post by keukpa » Mon Nov 28, 2011 12:39 pm

Post by keukpa
Mon Nov 28, 2011 12:39 pm

Hi Chris,

but it's all saved to ROM so that you can power it up and use the remote control as intended by Kondo


Yeah, I saw this, this is where I got all the init byte codes from for comtolling a specific servo, you also only need to specify the servos that are active but these init must be sent for the RCB4 to talk to the servos.

the manual with all memory addresses and commands and their meanings is available from Kondo directly on their web site.


Is this available in English? All the documents I found were in Japanese, and so not really any use. Although I found it pretty straight forward to reverse engineer HtH4 once I knew the stucture of the codes.

example code is included for addressing the COM port directly


This on your github? I've put all my code on my bitbucket page if you want to take a look.

Thanks muchly,

John
Hi Chris,

but it's all saved to ROM so that you can power it up and use the remote control as intended by Kondo


Yeah, I saw this, this is where I got all the init byte codes from for comtolling a specific servo, you also only need to specify the servos that are active but these init must be sent for the RCB4 to talk to the servos.

the manual with all memory addresses and commands and their meanings is available from Kondo directly on their web site.


Is this available in English? All the documents I found were in Japanese, and so not really any use. Although I found it pretty straight forward to reverse engineer HtH4 once I knew the stucture of the codes.

example code is included for addressing the COM port directly


This on your github? I've put all my code on my bitbucket page if you want to take a look.

Thanks muchly,

John
keukpa
Robot Builder
Robot Builder
Posts: 15
Joined: Wed Feb 23, 2011 11:29 pm

Post by chrisvo » Mon Nov 28, 2011 1:39 pm

Post by chrisvo
Mon Nov 28, 2011 1:39 pm

Yeah, I saw this, this is where I got all the init byte codes from for comtolling a specific servo, you also only need to specify the servos that are active but these init must be sent for the RCB4 to talk to the servos.


The lack of init for configuring which servos are enabled is a limitation of libkondo4 and I'll add it to my todo list.

In general though, if the configuration is saved to ROM in HTH4, then there should be no problems either commanding the servos or running motions right after startup. We know about this especially because if we lose power or swap batteries in our robot, we definitely don't want to have to re-initialize (or signal our software to re-init) in order to keep moving.

Is this available in English? All the documents I found were in Japanese, and so not really any use. Although I found it pretty straight forward to reverse engineer HtH4 once I knew the stucture of the codes.


Google translate worked perfectly on it. But yeah, libkondo4 also came out of reverse engineering HTH4, before the documentation was available.

This on your github? I've put all my code on my bitbucket page if you want to take a look.


Yeah it's on my bitbucket. It uses the linux serial stuff e.g. /dev/tty*

Thanks for your contributions
Yeah, I saw this, this is where I got all the init byte codes from for comtolling a specific servo, you also only need to specify the servos that are active but these init must be sent for the RCB4 to talk to the servos.


The lack of init for configuring which servos are enabled is a limitation of libkondo4 and I'll add it to my todo list.

In general though, if the configuration is saved to ROM in HTH4, then there should be no problems either commanding the servos or running motions right after startup. We know about this especially because if we lose power or swap batteries in our robot, we definitely don't want to have to re-initialize (or signal our software to re-init) in order to keep moving.

Is this available in English? All the documents I found were in Japanese, and so not really any use. Although I found it pretty straight forward to reverse engineer HtH4 once I knew the stucture of the codes.


Google translate worked perfectly on it. But yeah, libkondo4 also came out of reverse engineering HTH4, before the documentation was available.

This on your github? I've put all my code on my bitbucket page if you want to take a look.


Yeah it's on my bitbucket. It uses the linux serial stuff e.g. /dev/tty*

Thanks for your contributions
chrisvo
Savvy Roboteer
Savvy Roboteer
Posts: 132
Joined: Mon Nov 02, 2009 10:24 pm

Previous
37 postsPage 3 of 31, 2, 3
37 postsPage 3 of 31, 2, 3