The 29 bits of the EID give us more than 1.5 million different identifiers that we can use. If we break it up into fields we might be able to simplify some parts of the protocol. Primarily if we put the source node number in the EID then we don't need to allocate those 512 identifiers for each node. I guess in a way we are still doing that but it seems less confusing and may prove easier to implement.
An originally proposed idea was to use the first two bits to break the distributions up into four priorities. I thought this was a great idea but once I started trying to assign data to them it seemed to really fragment the distribution. I think it's simpler just to keep a prioritized distribution list like we already have. At least that's the direction that I decided to head. We'll see where it leads.
So what if we divide up the EID like this...
- The highest 12 bits (28-17) are the type of data. This gives us 4096 different types. Some would be node alarms, P2P messages and of course, most would be the parameter data updates.
- Bit 16 is the Report/Set flag. It is used to determine whether this message is simply reporting what the data is or if it's trying to 'set' or change the data. It will make sense on some data and not on all. For example, airspeed would only be reported. There is no need to 'set' airspeed. The same is true of altitude, EGT, RPM and the like. Other data like the transponder code or altimeter setting makes sense to separate reporting the data from requesting it to change.
- The next 8 bits (15-8) are type defined. For the vast majority of the data it'll be the index. The index is currently part of the parameter update message's data field. This moves it into the identifier and thusly into the arbitration field of the CAN frame. We can also use this field as the destination address in node to node communications and get rid of all those channels that we currently have, and the complexity that goes with them.
- The lower 8 bits (7-0) would be the source node address. This is also in the data field of the current implementation. This would also now be in the arbitration field so we eliminate the need for allocating 256 IDs for each type of node specific message. Now we just need one (or maybe a few) message types for node specific messages and we can have destination and node addresses in the identifier instead of in the data area.
The biggest advantage of this change comes with the Report/Set bit. We now have a mechanism (without using more types) to differentiate between frames that are trying to set data and frames that are simply reporting the current value of a piece of data. It adds a bit of complexity because we have to document where it makes sense to do allow one or the other. I looked through the distribution and took a stab at assigning R's and S's to each parameter in the list. There are some confusing spots. Let me describe one.
The pitch control position is basically the stick position fore and aft. Is this a "Set" or a "Report?" It is just the measured position of the stick. My first thought is that we make it a "Set" and then let the servo controller "Report" what it thinks the position is. This gives us feedback that the message was received. Then there is the elevator postion which is also related. This would be the actual measured position of where the elevator really is. In the previous implementation I just thought that the pilot would move the stick and the servo would report the measured position and that would be good enough. Perhaps this is good enough. What do we do with the fact that the elevator servo controller didn't get the stick position message? Report an alarm I guess. There is already a mechanism for reporting these kinds of alarms. Does it make sense? Maybe the pitch control position get's "reported" and the elevator position gets "reported" and we don't worry with all this.
With the trim I think it may be a bit different. We might move the trim with a switch, but we may also want to command a position during pre-flight to center it. Or we are using a trim wheel that would command a position every time it's moved, perhaps both.
Transponder code, waypoints, com frequencies, altimeter setting are places where the Report/Set flag really make sense, but there are only a few of these. It may make sense to get rid of the bit and assign different types to setting and reporting. That might be simpler. I'm open to suggestions here.
Another huge advantage is that it gets rid of all the communication channels and the handshake that had to happen for two nodes to communicate to one another. That proved to be a bit flakey in actual implementation.
Having the index in the identifier also gives us a lot of flexibility between which node reports what piece of data.
I've attached a spreadsheet that may help illustrate what I'm thinking about. Sorry it's not an xls. LibreOffice is free.
Is it even worth going down this road? Maybe we stick with what we have, adjust the parameter distribution to work around the Set/Report issues and leave the extended identifier set for a future implementation. Please let me know what you think.