by PedroR » Thu Feb 05, 2009 5:09 am
by PedroR
Thu Feb 05, 2009 5:09 am
Hi
As you may have noticed from other threads I have been working on creating DLLs to encapsulate communication with Robobuilder.
Having completed a DLL to emulate the protocol of the Remote control and creating a demo using a (PS2) joystick to control the robot, I have moved on to implementing the native wCK protocol.
Here is a screenshot of the test program I wrote:
The DLL and sample code can be downloaded here:
http://robosavvy.com/Builders/PedroR/wC ... l_test.zip
There are a few known issues/limitations at this point:
1)
The library I am using to do serial communication is the well known MSCOMM.OCX from microsoft. However it can only go up to about 200kps (in the sample it is set to 115 200, the default for Robobuilder). I intend to upgrade the code to use Native Windows API to do the serial communication. This should allow much faster speeds and much lower latency.
2)
When sending the commands to the RBC, if I then call the MSCOMM.OCX to retrieve the answer too fast, it will return an Empty buffer. The code has a built in delay of 200ms to allow the buffer to fill.
Again, I expect to solve this once I replace MSCOMM with native windows API calls.
3)
The compiled (EXE) file was not running properly on my Windows Vista Machine (could not open the COM port). However, when I load the VBP file in VB6 and run the project it works fine.
I am not sure if you will encounter the same problem....
4)
Only part of the wCK protocol is implemented. I have implemented the commands to set and retrieve wCK positions, rotate 360º, set the values of the IO ports, release torque and power down/dynamic break.
Here are my interesting findings so far:
1)
The wCK modules have 3 states:
a) No torque (you can move them freely)
b) Power Down/Dynamic Break: according to the docs, the servo is powered down but it retains it's position and some torque. It's harder to move than in mode a) but it's possible to move it.
c) Position Set: the servo's are powered and it applies torque to retain it's position. In this mode it's very hard to move the servo.
[u]
I was surprised to learn about mode b)[/u]
2)
The LEDs in the transparent Robobuilder are connected to digital IO ports 1 e 2 (please see page 31 of the wCK manual).
Basically you set the ports to 1 and the leds light up; then set it to 0 and they power down.
I still want to test and try with the A/D port of the servo. That's not yet implemented on the DLL.
3)
When you issue a 360º command - to make the servo rotate 360 deg - the servo actually keeps spinning.
I expected it to do 1 revolution and stop but instead it just keeps spinning until you issue a command to set position, release torque or power down/dynamic break.
It has the nice feature of maintaining a counter of how many revolutions it has done.
I believe the DLL library is quite simple to use but I appreciate your feedback. I will post some sample code bellow.
Pedro.
Hi
As you may have noticed from other threads I have been working on creating DLLs to encapsulate communication with Robobuilder.
Having completed a DLL to emulate the protocol of the Remote control and creating a demo using a (PS2) joystick to control the robot, I have moved on to implementing the native wCK protocol.
Here is a screenshot of the test program I wrote:
The DLL and sample code can be downloaded here:
http://robosavvy.com/Builders/PedroR/wC ... l_test.zip
There are a few known issues/limitations at this point:
1)
The library I am using to do serial communication is the well known MSCOMM.OCX from microsoft. However it can only go up to about 200kps (in the sample it is set to 115 200, the default for Robobuilder). I intend to upgrade the code to use Native Windows API to do the serial communication. This should allow much faster speeds and much lower latency.
2)
When sending the commands to the RBC, if I then call the MSCOMM.OCX to retrieve the answer too fast, it will return an Empty buffer. The code has a built in delay of 200ms to allow the buffer to fill.
Again, I expect to solve this once I replace MSCOMM with native windows API calls.
3)
The compiled (EXE) file was not running properly on my Windows Vista Machine (could not open the COM port). However, when I load the VBP file in VB6 and run the project it works fine.
I am not sure if you will encounter the same problem....
4)
Only part of the wCK protocol is implemented. I have implemented the commands to set and retrieve wCK positions, rotate 360º, set the values of the IO ports, release torque and power down/dynamic break.
Here are my interesting findings so far:
1)
The wCK modules have 3 states:
a) No torque (you can move them freely)
b) Power Down/Dynamic Break: according to the docs, the servo is powered down but it retains it's position and some torque. It's harder to move than in mode a) but it's possible to move it.
c) Position Set: the servo's are powered and it applies torque to retain it's position. In this mode it's very hard to move the servo.
[u]
I was surprised to learn about mode b)[/u]
2)
The LEDs in the transparent Robobuilder are connected to digital IO ports 1 e 2 (please see page 31 of the wCK manual).
Basically you set the ports to 1 and the leds light up; then set it to 0 and they power down.
I still want to test and try with the A/D port of the servo. That's not yet implemented on the DLL.
3)
When you issue a 360º command - to make the servo rotate 360 deg - the servo actually keeps spinning.
I expected it to do 1 revolution and stop but instead it just keeps spinning until you issue a command to set position, release torque or power down/dynamic break.
It has the nice feature of maintaining a counter of how many revolutions it has done.
I believe the DLL library is quite simple to use but I appreciate your feedback. I will post some sample code bellow.
Pedro.
Last edited by PedroR on Thu Feb 05, 2009 1:51 pm, edited 2 times in total.