VEX, ServocDecode

Much thanks to Mem for the ServoDecode lib. excellent work!

I got the code working for my VEX receiver but I am not sure about the values outputted by the lib. For example when I moved the stick on the receiver to max the channel returns ~1886 and minimum ~ 1096. When the stick is centered it's about ~1502 which is about right.

It seems like I am not getting the full range in the channels. When I add the ServoTimer lib I also notice that the servo does not swing to full 180 deg... more like 110 deg. and 60 deg. the other way.

This is the settings in the lib.

define MIN_IN_PULSE_WIDTH (450 * TICKS_PER_uS)

define MAX_IN_PULSE_WIDTH (2250 * TICKS_PER_uS)

define SYNC_GAP_LEN (2000 * TICKS_PER_uS)

There are the VEX transmitter attributes ( from http://www.artoo-detoo.net/tag/arduino)

  • 20 ms total before repeat.
  • Each channel is sent as a high signal followed by a 1 ms low. The width of the high signal determines the value sent. A zeroed channel has a width of 1ms. A full positive channel is 1.5ms and a full negative channel is 0.5 ms.
  • On the Vex there are six channel (The six peaks that you see) for a total of about 12ms buffered by approximately 8 ms.

Can anyone help translating the VEX transmitter attributes to the ServerDecode settings?

Thanks

I also notice that the servo does not swing to full 180 deg... more like 110 deg. and 60 deg. the other way.

Servos are often used to drive cranks in models - a 180 degree swing is often not desireable for fear of jamming, and not all servos can actually achieve it. However, you can normally offset the servo horns by simply removing them and reseating then on the splined output shaft.

On the Vex there are six channel (The six peaks that you see) for a total of about 12ms buffered by approximately 8 ms.

What you describe is a normal six-channel R/C frame. The long, low gap allows the receiver to resynchronise.

Thanks for replying.

The Servo is ok, when connected to the VEX receiver the swing is 0 to 180.

When I use the ServoDecode library the swing is 45 to 135.

I tried adjusting the SYNC_GAP_LEN thinking I may be losing pulses at min and max settings ..but no luck.

Any Vex users out there with any comments?