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

changing the code in the MR-C3024

Hitec robotics including ROBONOVA humanoid, HSR-8498HB servos, MR C-3024 Controllers and RoboBasic
223 postsPage 1 of 151, 2, 3, 4, 5 ... 15
223 postsPage 1 of 151, 2, 3, 4, 5 ... 15

changing the code in the MR-C3024

Post by bearclaw » Sun May 14, 2006 8:29 pm

Post by bearclaw
Sun May 14, 2006 8:29 pm

Hi,
I was wondering if anybody knew a way to change the code inside the MR-C3204? I tryed connecting to the JTAG interface, but it didn't work.
What I want to do is to control/read the position of all the servos in realtime through the serial link (at at least 20 Hz).
The avr inside is perfectly able to do that, but when I try with the (revere-engineered) serial protocol used by their code, it takes 500 ms to read all the servo values, and the same time to set them.
Hi,
I was wondering if anybody knew a way to change the code inside the MR-C3204? I tryed connecting to the JTAG interface, but it didn't work.
What I want to do is to control/read the position of all the servos in realtime through the serial link (at at least 20 Hz).
The avr inside is perfectly able to do that, but when I try with the (revere-engineered) serial protocol used by their code, it takes 500 ms to read all the servo values, and the same time to set them.
bearclaw
Robot Builder
Robot Builder
User avatar
Posts: 10
Joined: Sun May 14, 2006 1:00 am

Post by limor » Mon May 15, 2006 8:29 am

Post by limor
Mon May 15, 2006 8:29 am

Do you mean that you managed to read all 16 servo positions in 500ms while they were transitioning from say position A to position B ? (ie: while they were moving ?)
Do you mean that you managed to read all 16 servo positions in 500ms while they were transitioning from say position A to position B ? (ie: while they were moving ?)
limor
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1845
Joined: Mon Oct 11, 2004 1:00 am
Location: London, UK

Post by bearclaw » Mon May 15, 2006 3:03 pm

Post by bearclaw
Mon May 15, 2006 3:03 pm

No, the servos where not moving, but I don't think it changes anything regarding the time required to get the values.
No, the servos where not moving, but I don't think it changes anything regarding the time required to get the values.
bearclaw
Robot Builder
Robot Builder
User avatar
Posts: 10
Joined: Sun May 14, 2006 1:00 am

Post by limor » Mon May 15, 2006 5:36 pm

Post by limor
Mon May 15, 2006 5:36 pm

I'm not sure about the Hitec servos but they have coppied most of the stuff from the KHR-1 so if they also coppied the position feedback trick then 500ms does makes sense.

The way Kondo ICS servos relay their position is by invoking a PWM pulse cycle. As you know, classic RC-servos are passive components that read PWM cycles from the controller that tell the servo at what angle it should be. Every 20ms the controler issues a +5V pulse of length .7ms to 2.3ms depending on the target angle and the rest of the 18ms or so are 0V.

Kondo ICS servos use the empty 18ms and create their own PWM cycle, bringing the voltage up for a period of .7ms to 2.3ms to convey the current servo position.
To induce this behaviour, the controler has to send an unconventional pulse length of 0.1ms to the servo. When the Kondo ICS servo reads an unusually short pulse length at a PWM cycle, it assumes that this is a "special" command.

You can read more about the special commands of Kondo ICS here:
http://robosavvy.com/Support/images/krsmanual_e.pdf


Hence if the controler needs to read all 16 servos one after the other that makes up for up to 320ms. It may do so a couple of times for error correction purpose or it may do it inneficiently, either way 500ms is in the right order of magnitude.


BTW: Robotis servos, by-the-way, are contolled by a serial link not by these backwards-compatibility PWM tricks.
I'm not sure about the Hitec servos but they have coppied most of the stuff from the KHR-1 so if they also coppied the position feedback trick then 500ms does makes sense.

The way Kondo ICS servos relay their position is by invoking a PWM pulse cycle. As you know, classic RC-servos are passive components that read PWM cycles from the controller that tell the servo at what angle it should be. Every 20ms the controler issues a +5V pulse of length .7ms to 2.3ms depending on the target angle and the rest of the 18ms or so are 0V.

Kondo ICS servos use the empty 18ms and create their own PWM cycle, bringing the voltage up for a period of .7ms to 2.3ms to convey the current servo position.
To induce this behaviour, the controler has to send an unconventional pulse length of 0.1ms to the servo. When the Kondo ICS servo reads an unusually short pulse length at a PWM cycle, it assumes that this is a "special" command.

You can read more about the special commands of Kondo ICS here:
http://robosavvy.com/Support/images/krsmanual_e.pdf


Hence if the controler needs to read all 16 servos one after the other that makes up for up to 320ms. It may do so a couple of times for error correction purpose or it may do it inneficiently, either way 500ms is in the right order of magnitude.


BTW: Robotis servos, by-the-way, are contolled by a serial link not by these backwards-compatibility PWM tricks.
limor
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1845
Joined: Mon Oct 11, 2004 1:00 am
Location: London, UK

Post by bearclaw » Mon May 15, 2006 9:17 pm

Post by bearclaw
Mon May 15, 2006 9:17 pm

Yup, same trick for hitech servos.
cf http://www.hitecrobotics.com/Tony%20inf ... otocol.pdf

however....who said you had to read them one after the other? you can read them all at the same time, and send all pwms at the same time!
Yup, same trick for hitech servos.
cf http://www.hitecrobotics.com/Tony%20inf ... otocol.pdf

however....who said you had to read them one after the other? you can read them all at the same time, and send all pwms at the same time!
bearclaw
Robot Builder
Robot Builder
User avatar
Posts: 10
Joined: Sun May 14, 2006 1:00 am

Post by limor » Tue May 16, 2006 1:07 am

Post by limor
Tue May 16, 2006 1:07 am

bearclaw wrote:Yup, same trick for hitech servos.
cf http://www.hitecrobotics.com/Tony%20inf ... otocol.pdf

Unbelievable!! these guys have no shame.. they even coppied the documentation :lol:
however....who said you had to read them one after the other? you can read them all at the same time, and send all pwms at the same time!

Thats right in theory, since each servo is connected individually to the controller. However, dealing with 16 or more asynchronous PWM sources would require some tricky race-condition handling which i somehow doubt they would opt to do.
bearclaw wrote:Yup, same trick for hitech servos.
cf http://www.hitecrobotics.com/Tony%20inf ... otocol.pdf

Unbelievable!! these guys have no shame.. they even coppied the documentation :lol:
however....who said you had to read them one after the other? you can read them all at the same time, and send all pwms at the same time!

Thats right in theory, since each servo is connected individually to the controller. However, dealing with 16 or more asynchronous PWM sources would require some tricky race-condition handling which i somehow doubt they would opt to do.
limor
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1845
Joined: Mon Oct 11, 2004 1:00 am
Location: London, UK

Post by bearclaw » Tue May 16, 2006 11:01 am

Post by bearclaw
Tue May 16, 2006 11:01 am

Well, I just bought the necessary component to build a new controller (atmega 16, max232...), I'll mount everything, write the code to read/write servos in //, and keep you posted :)
Well, I just bought the necessary component to build a new controller (atmega 16, max232...), I'll mount everything, write the code to read/write servos in //, and keep you posted :)
bearclaw
Robot Builder
Robot Builder
User avatar
Posts: 10
Joined: Sun May 14, 2006 1:00 am

Post by i-Bot » Wed May 17, 2006 6:02 pm

Post by i-Bot
Wed May 17, 2006 6:02 pm

The Hitec HMI protocol has only partly been disclosed in the document described above.

The conventional and new 8) PWM modes described are just part of the multi-protocol interface.

The PWM obviously does not perform the full features in the servo specification, like address 32 devices, read the current/voltage, etc.

When the HMI programming software and serial programming cable for the servo is released, it will not use only PWM, but most likely a direct serial protocol to the servo. Then we should see the full capabilities.

In fact all other Hitec digital servos can be powered up into a serial mode for programming by the HFP-10, and this also allows for setting and reading of servo position in serial mode from a microcontroller. This is not for the faint hearted though !

The HSR8498HB has a different interface to the other Hitec digital servos and is not compatible with the HFP-10. so we need to wait a little as this software and cable are released and hopefully the full HMI protocol is disclosed.
The Hitec HMI protocol has only partly been disclosed in the document described above.

The conventional and new 8) PWM modes described are just part of the multi-protocol interface.

The PWM obviously does not perform the full features in the servo specification, like address 32 devices, read the current/voltage, etc.

When the HMI programming software and serial programming cable for the servo is released, it will not use only PWM, but most likely a direct serial protocol to the servo. Then we should see the full capabilities.

In fact all other Hitec digital servos can be powered up into a serial mode for programming by the HFP-10, and this also allows for setting and reading of servo position in serial mode from a microcontroller. This is not for the faint hearted though !

The HSR8498HB has a different interface to the other Hitec digital servos and is not compatible with the HFP-10. so we need to wait a little as this software and cable are released and hopefully the full HMI protocol is disclosed.
i-Bot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by limor » Wed May 17, 2006 6:26 pm

Post by limor
Wed May 17, 2006 6:26 pm

Hi i-Bot,
So what you are saying is that the HSR8498HB servos can operate in both PWM++ mode and in serial mode..
Does that mean that one could develop a controler for Robonova that has no PWM and only communicates with the servos using serial interfaces?
You also refer to 32 addressable devices, do you mean that 32 servos can be placed on the same serial interface ie:daisy-chain the servos?

:?
Hi i-Bot,
So what you are saying is that the HSR8498HB servos can operate in both PWM++ mode and in serial mode..
Does that mean that one could develop a controler for Robonova that has no PWM and only communicates with the servos using serial interfaces?
You also refer to 32 addressable devices, do you mean that 32 servos can be placed on the same serial interface ie:daisy-chain the servos?

:?
limor
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1845
Joined: Mon Oct 11, 2004 1:00 am
Location: London, UK

Post by i-Bot » Thu May 18, 2006 8:22 am

Post by i-Bot
Thu May 18, 2006 8:22 am

Hi,

Sorry it is 128 not 32 !

As you see from the following spec at Tower hobbies
"
HMI (HiTEC Multi-protocol Interface):
- Data feedback: current, voltage, position
- PWM interface (RC standard)
Parameter setting capabilities.
RS-232C Daisy Chain interface up to 128 servos.
REQUIRES: HMI Servo Programmer Kit


"
Also in the Hitec 2006 robotics catalog

http://www.hitecrobotics.com/products/2 ... atalog.pdf

This HMI mode is described.

As I said, I already use serial mode on other hitec digital servos, but there are some limitations since they do not measure current, or allow the h-bridge for the motor to be completely turned off. I hope this is fixed on the new servo.

Software and cable are quoted as being "shortly available ". I hope very shortly.
Hi,

Sorry it is 128 not 32 !

As you see from the following spec at Tower hobbies
"
HMI (HiTEC Multi-protocol Interface):
- Data feedback: current, voltage, position
- PWM interface (RC standard)
Parameter setting capabilities.
RS-232C Daisy Chain interface up to 128 servos.
REQUIRES: HMI Servo Programmer Kit


"
Also in the Hitec 2006 robotics catalog

http://www.hitecrobotics.com/products/2 ... atalog.pdf

This HMI mode is described.

As I said, I already use serial mode on other hitec digital servos, but there are some limitations since they do not measure current, or allow the h-bridge for the motor to be completely turned off. I hope this is fixed on the new servo.

Software and cable are quoted as being "shortly available ". I hope very shortly.
i-Bot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by bearclaw » Thu May 18, 2006 11:03 pm

Post by bearclaw
Thu May 18, 2006 11:03 pm

Yeah, but since I have an AVR that has nothing else to do than controling servos, I think controlling them in parallel will be more efficient than putting them all on the same serial line.

I'm almost done, except I can't make this ##$*%%!! MAX232 work.
Yeah, but since I have an AVR that has nothing else to do than controling servos, I think controlling them in parallel will be more efficient than putting them all on the same serial line.

I'm almost done, except I can't make this ##$*%%!! MAX232 work.
bearclaw
Robot Builder
Robot Builder
User avatar
Posts: 10
Joined: Sun May 14, 2006 1:00 am

Post by subpilot » Thu May 25, 2006 9:31 am

Post by subpilot
Thu May 25, 2006 9:31 am

I don't beleive that the servos will work with RS-232C. There are only 3 pins (1 for data) and a 2 way RS232 interface would require two data lines.
I don't beleive that the servos will work with RS-232C. There are only 3 pins (1 for data) and a 2 way RS232 interface would require two data lines.
subpilot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 146
Joined: Sat Feb 25, 2006 1:00 am
Location: Lake Arrowhead, Ca,USA

Post by bearclaw » Wed Jun 07, 2006 4:47 pm

Post by bearclaw
Wed Jun 07, 2006 4:47 pm

Ok, serial line is working, and my code can write to all servos at the same time.
But I have a problem using the feedback feature of the servos: the servo input pin is directly connected to an i/o pin of the atmel.
I send a 5V 50µs pulse, set the line to input, pull-up, as the doc says, and wait.
Then the servo sends a pulse whose width depends on its current position.
It works fine, except the pulse sent by the servo is only at 2V, and the atmel doesn't detect it.
What could I do to solve this?
Ok, serial line is working, and my code can write to all servos at the same time.
But I have a problem using the feedback feature of the servos: the servo input pin is directly connected to an i/o pin of the atmel.
I send a 5V 50µs pulse, set the line to input, pull-up, as the doc says, and wait.
Then the servo sends a pulse whose width depends on its current position.
It works fine, except the pulse sent by the servo is only at 2V, and the atmel doesn't detect it.
What could I do to solve this?
bearclaw
Robot Builder
Robot Builder
User avatar
Posts: 10
Joined: Sun May 14, 2006 1:00 am

Post by i-Bot » Wed Jun 07, 2006 5:44 pm

Post by i-Bot
Wed Jun 07, 2006 5:44 pm

Hi,

I noticed on the C3024 to servo, the position feedback is significantly lower level than the initial 50microsec pulse. I sort of ignored that, thinking that would meet the high input level of the C3024. From the data sheet it looks like the ATmega needs a high of 3 volts ( 5V * .6), when operating at 5V

I don't know what limits the high level, you say you have pullups, do they make a difference ?

I can send you my internal schematic of the servo, but it is a simple open collector output from a digital transistor driven from the servo processor.
Hi,

I noticed on the C3024 to servo, the position feedback is significantly lower level than the initial 50microsec pulse. I sort of ignored that, thinking that would meet the high input level of the C3024. From the data sheet it looks like the ATmega needs a high of 3 volts ( 5V * .6), when operating at 5V

I don't know what limits the high level, you say you have pullups, do they make a difference ?

I can send you my internal schematic of the servo, but it is a simple open collector output from a digital transistor driven from the servo processor.
i-Bot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by bearclaw » Fri Jun 09, 2006 11:46 pm

Post by bearclaw
Fri Jun 09, 2006 11:46 pm

I get only 2V for the pulse. It seems enough to trigger the atmel (there was a bug in the code :) ), although it shouldn't (datashit says 3V is required) .

I was working with internal clock at 1MHz, which is too slow to monitor even 4 inputs with enough precision. So my current status is fighting with the fuse bits to get my atmega16 to work at 12MHz.
I get only 2V for the pulse. It seems enough to trigger the atmel (there was a bug in the code :) ), although it shouldn't (datashit says 3V is required) .

I was working with internal clock at 1MHz, which is too slow to monitor even 4 inputs with enough precision. So my current status is fighting with the fuse bits to get my atmega16 to work at 12MHz.
bearclaw
Robot Builder
Robot Builder
User avatar
Posts: 10
Joined: Sun May 14, 2006 1:00 am

Next
223 postsPage 1 of 151, 2, 3, 4, 5 ... 15
223 postsPage 1 of 151, 2, 3, 4, 5 ... 15