8-channel Renard Se...
 
Notifications
Clear all

8-channel Renard Servo Controller

47 Posts
12 Users
0 Reactions
23 K Views
omzig
Posts: 1603
Topic starter
(@omzig)
Noble Member
Joined: 19 years ago
[#6460]

I've been working on a Renard servo controller...

In summary, this board will control up to 8 RC servos using the Renard protocol and the same Renard Vixen plugin. It can be placed in a Renard chain and it will otherwise perform just like any Renard light controller. It will take packets destined for it, and translate the dimmer levels into servo positions.

Each servo will have 3 configurable modes of operation which are; Standard, Extended, and Disabled.

In the Standard mode, the Renard dimmer levels will be translated to control pulse widths in the range of 1ms to 2ms. A dimmer level of 0 would produce a 1ms pulse, 255 would be 2ms, and values in between would produce widths proportionately between 1ms and 2ms. This makes the increment for each dimmer level approximately 3.9µs. This range will work with a majority of servos.

In the Extended mode, the dimmer levels will be translated into pulse widths of 0.5ms to 2.5ms. A dimmer level of 0 would produce a 0.5ms pulse width, 255 would be 2.5ms, and values in between would produce widths proportionately between 0.5ms and 2.5ms, in approximately 7.8µs increments. This mode allows you to use an extended control range that some servos support.

When a servo is disabled, no pulse will be generated and any dimmer data for it will be ignored.

EDITdecided to do this in hardware***Using the current Renard plugin does pose one problem...how to allow the user to specify the mode of operation setting for each servo. I plan to store these settings on the PIC's EEPROM, which will then be loaded during the initialization routine. But there still has to be a way for the user to specify these settings. I thought of a few different ways to accomplish this. The method that I prefer is to use command bytes within the Renard protocol that are <0x80. The current Renard firmware just forwards packets with command bytes <0x80. I could write a small Windows program to send the configuration commands.

Another method for setup that I thought of is to have a "program mode" jumper on the board that would put the board in a programming state. Then any protocol could be used to send the settings to the board. Pin 4 could be used for the jumper since there is no need for a zero cross signal on this board.

I am attaching the schematic. I will post the firmware soon. I am going to try to breadboard it this weekend. Any comments are welcome.


46 Replies
ukewarrior
Posts: 4674
(@ukewarrior)
Illustrious Member
Joined: 18 years ago

Don,

I vote for the 'mode' to be set with a jumper or dip switch. With proper silkscreening, this jumper could be self explanatory. Plus, you'd only need the jumper for two of the settings. Have a 'no jumper' be one of the settings and this is what the pic code defaults to unless it reads a 'one' on one of the jumpers. This way it always works incase someone doesn't have a jumper handy.

I certainly vote against doing it in the PIC. No one wants to reflash a pic if they don't have to.

I also vote against doing it with command packets. Elegant, but I don't want any more software to keep track of.

Neat Stuff. I love the fact you are reusing so much of existing infrastructure. I suggest you keep it that way!


Reply
omzig
Posts: 1603
Topic starter
(@omzig)
Noble Member
Joined: 19 years ago
ukewarrior wrote:I certainly vote against doing it in the PIC. No one wants to reflash a pic if they don't have to.

Not sure what you mean here. I only propose writing the settings to the PIC's EEPROM from within a setup routine in the firmware. No reflashing with a programmer would be required.


Reply
ukewarrior
Posts: 4674
(@ukewarrior)
Illustrious Member
Joined: 18 years ago

oops.
Gotcha.
So, I guess my vote is to read those settings off jumpers during initialization.

Again, very nice stuff.


Reply
Posts: 919
(@scorpia)
Noble Member
Joined: 19 years ago

you could also use a 9th and maybe 10th channel and have those bit values set the 8 channels of the servo's. it could then be changed at any time by simply changing the channel value.

would be a channel wasted most of the time but it would allow this to be done without any hardware changes or plugin changes,

for example use channel 9 as the on or off channel and the 10 channel could set standard or extended modes,

being 8 channels and 8 bits makes it easy

Peter


Reply
Posts: 2168
(@djulien)
Noble Member
Joined: 19 years ago
omzig wrote:Using the current Renard plugin does pose one problem...how to allow the user to specify the mode of operation setting for each servo. I plan to store these settings on the PIC's EEPROM, which will then be loaded during the initialization routine. But there still has to be a way for the user to specify these settings. I thought of a few different ways to accomplish this. The method that I prefer is to use command bytes within the Renard protocol that are <0x80. The current Renard firmware just forwards packets with command bytes <0x80. I could write a small Windows program to send the configuration commands.

If you didn't want to make any changes to the plug-in, the controller firmware could be made to consume one extra channel at the beginning of its block of channels, and use that as a "configuration byte". Then you could set this config channel to whatever binary value is needed using Vixen's Intensity function (maybe a 1, 2 or 3 to set one mode for the entire controller, or use additional bits to control the mode for individual servo channels). Except for those special Renard byte values that get translated/escaped, a little binary arithmetic should allow you to send any config byte value needed, which would allow complete configuration under software control. Software config might be more convenient than going out in the cold and digging some snow if you ever have to change the config after the display is set up.

don

don


Reply
omzig
Posts: 1603
Topic starter
(@omzig)
Noble Member
Joined: 19 years ago

Peter and Don, your ideas are very similar. I like this approach a lot. *smacking forehead* Why didn't I think of that?

I think that one "control channel" would be plenty. I'm wondering if rather than adding an extra channel, it might be better to make it a 7 servo controller and then only 8 channels would be needed. While the code for this board could certainly be modified to steal an extra channel when using long form packets, I'm thinking that it may not work well with short form packets because eight bytes are expected after each command/address byte. This would kind of mess up the backward compatibility of the firmware. I will have to have another look at the standard firmware to verify this, but the way I recall it, this would be the case.

Not to mention, I think that the user is less likely to forget to add the control channel to their Vixen sequence if the board were to use 8 channels than if it were some odd number like 9. Forgetting to add it would definitely make a mess of things because the board would take the channel anyway, which should be a channel for the next controller.

Thanks for the idea Peter and Don!


Reply
Posts: 2168
(@djulien)
Noble Member
Joined: 19 years ago
omzig wrote:I think that one "control channel" would be plenty. I'm wondering if rather than adding an extra channel, it might be better to make it a 7 servo controller and then only 8 channels would be needed. While the code for this board could certainly be modified to steal an extra channel when using long form packets, I'm thinking that it may not work well with short form packets because eight bytes are expected after each command/address byte. This would kind of mess up the backward compatibility of the firmware. I will have to have another look at the standard firmware to verify this, but the way I recall it, this would be the case.

Seven channels is very nice if you are using cat5 and want to pack it full of signals and a +5.

I had forgotten about the protocol using multiples of 8 bytes, but that does sound vaguely familiar. In order to preserve multiples of 8, you could either pad up to 16 bytes, which wastes a little of the Renard address space, or you could just steal a few bits from the 8 channels. For example, if you used the top or bottom bit from at least 2 of the channels, that would give you enough to set a controller-wide 1-of-4 mode. If you used top bits, then the channel intensity values for normal use would need to be < 128, and then add 128 or 192 or whatever to set the config. If you used bottom bits, you would need to adjust for odd vs. even values, etc. Still a bit awkward, but doable if you are good with binary arithmetic.

Or, you could use a byte pattern scheme. For example, maybe use the first byte in the group after a long interval of 0s to be used as the config byte, or maybe right after a frame containing all 85s or 170s use the first byte from the next frame as the config byte. Presumably that would only need to be set once at the start of the sequence, which isn't so bad.

You could also do something like designate values 1, 2 and 3 from the first channel as the mode control. Since LEDs and incandescents don't visibly change in the upper and lower 20%, the values in those ranges are not too useful. For servos they probably would be, but maybe they wouldn't be missed on, say, the first 1 of the 8 channels.

Or, you could do something like make 7 of the channels dimmable, and the 8th channel is just on/off or maybe reduced range, and then use the spare bits from that to be the mode control.

don


Reply
prof
Posts: 266
 prof
(@prof)
Reputable Member
Joined: 19 years ago

If you are going to use vixen to set the operating mode, is there some reason why you cannot have each of the 8 channels read their own independant mode setting from their corresponding vixen channel - no wasted channels that way. In view of this, how about having an additional mode (ie zero) to 'keep existing channel setting' that way you only need to reprogram the channels you require.

Craig.


Reply
omzig
Posts: 1603
Topic starter
(@omzig)
Noble Member
Joined: 19 years ago
prof wrote:If you are going to use vixen to set the operating mode, is there some reason why you cannot have each of the 8 channels read their own independant mode setting from their corresponding vixen channel - no wasted channels that way. In view of this, how about having an additional mode (ie zero) to 'keep existing channel setting' that way you only need to reprogram the channels you require.

Craig.

Actually, this is kind of what I was just thinking about. Using the first few bytes of the sequence for each channel for setup of that channel. Probably start it with some unlikely pair like 0xff 0x00 to indicate a setup byte is coming, otherwise the first few bytes would be ignored and the default settings would be used.


Reply
Page 1 / 5
Share: