Extended Identifier Proposal

Discussion forum for the CAN-FIX protocol. This is a CANBus based communications protocol specifically suited for experimental aviation.

Moderators: John Nicol, birkelbach

Post Reply
birkelbach
Posts: 193
Joined: 04 Sep 2012, 14:42

Extended Identifier Proposal

Post by birkelbach »

The recent discussion on another topic has gotten me to thinking about changing the identifier distribution slightly in CAN-FIX. Basically it's moving the protocol to the extended identifier set instead of the standard identifier set. The Extended Identifier (EID) is 29 bits long as opposed to the Standard Identifier that we currently use which is 11 bits long. 11 bits gives us 2048 different messages that we can use. Currently we use about 1000 of them with the distribution that we have. 512 of them are for node specific type messages where each of 256 nodes needs to be assigned a different identifier so that there are no collisions on the network.

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.
As in everything, there are some pros and cons. The biggest con in all this would be the changes to existing work that'll have to be done. There are no devices out there yet but I've written some code (bye bye bootloader :-() but it's minimal. Another con that I see right off the bat is we could now put multiple copies of the same information (i.e. airspeed) on the bus from two different nodes. This is a bus error now. It may not be a problem in practice. Another con is that all standard frames will have priority over the new distribution. Maybe this won't be a problem in practice. Would we want to entertain the idea of using both types of frames?

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.
Attachments
CAN-FIX-0.x.ods
(29.11 KiB) Downloaded 978 times
Phil Birkelbach
Waller, Texas
RV-7 727WB
www.myrv7.com
User avatar
jeff54il
Posts: 229
Joined: 30 Nov 2011, 12:36
Location: Holon Israel

Re: Extended Identifier Proposal

Post by jeff54il »

Hi Phil,
In this fielad I feel like a bull in a china shop. I'm just curious, but why 29 bits and 11 bits? Why not nice round binary numbers like 32 and 16?
Jeffrey
Bring them home NOW :cry: :shock:
birkelbach
Posts: 193
Joined: 04 Sep 2012, 14:42

Re: Extended Identifier Proposal

Post by birkelbach »

I've wondered that myself a time or two. There are some bit stuffing rules and other housekeeping data in the frame that may have something to do with it. Only Bosch knows.
Phil Birkelbach
Waller, Texas
RV-7 727WB
www.myrv7.com
User avatar
John Nicol
Posts: 611
Joined: 23 Nov 2011, 12:17
Contact:

Re: Extended Identifier Proposal

Post by John Nicol »

Hi Phil,

Still trying to absorb it all. Can you clarify the priority of the messages between nodes under this schema. In the CAN spec, the message priority is set as you know by the dominant and recessive bits. This allows more critical messages to be passed first on the bus, such as alarms. How is this handled now? If the dominant/recessive bits are taken out, are we now not CAN 2.0 compliant?

John
-----
John Nicol
Founder, MakerPlane
birkelbach
Posts: 193
Joined: 04 Sep 2012, 14:42

Re: Extended Identifier Proposal

Post by birkelbach »

The dominant and recessive bits are still there. There are just more of them. The arbitration scheme hasn't changed. The reason that standard frames have a higher priority is because the Extended Identifier bit (IDE) is right after the 11 bit standard identifier and before the extended identifier and is set to 'dominant' for standard frames. If we move the Node ID into the arbitration field it simply means that two different nodes sending the same data will not be an error anymore since the lower numbered node would win the arbitration. I don't know how valuable this really is in practice.

Bear in mind that I'm not really advocating this new scheme. I'm just thinking out loud. In fact, the more I think about it the more I think we should just stick to what we have. At some point in the future we can move to CAN-FIXe (as was suggested by Dave). The two protocols could live happily on the same bus. Part of my reasoning is that I doubt we get this all right the first time, so let's leave ourselves some room to learn and grow.

I've spent a little bit of time on the standard distribution scheme and I think I've figured out a way to solve most of the problems without too much difficulty. It turns out that there were only a few places where I thought there needed to be different messages for setting values and reporting them. Part of my thought process is that we need to get something out there. We could spend the rest of our lives making this protocol "perfect" and there'd never be one device out in the wild. Perfection is the enemy of good enough.
Phil Birkelbach
Waller, Texas
RV-7 727WB
www.myrv7.com
User avatar
John Nicol
Posts: 611
Joined: 23 Nov 2011, 12:17
Contact:

Re: Extended Identifier Proposal

Post by John Nicol »

Hi Phil,

There is also nothing wrong with sitting on the document as a draft until we can start prototyping nodes and seeing how it works in real life. There is a protocol that I worked with in military simulation systems that has been at draft 17 for years. Not advocating that we keep it draft for too long, but at the same time, having a published v1.0 too early might cause some issues.

John
-----
John Nicol
Founder, MakerPlane
birkelbach
Posts: 193
Joined: 04 Sep 2012, 14:42

Re: Extended Identifier Proposal

Post by birkelbach »

I've decided to table this for now. I think I'm getting behind you guys on this other stuff so I'd rather concentrate on taking what I have and moving forward. I'm gonna go add a reply to the Status topic and let everyone know where I am on spec. I didn't change much but I jumbled the parameter tables around again.
Phil Birkelbach
Waller, Texas
RV-7 727WB
www.myrv7.com
Post Reply