Hi all,
I've looked in the meantime a bit at the different standards. I'm not convinced there is much to win to force MAVLink onto the bus, since the scope of the message set and length / overheads / update rates do not match well.
I still think this is a very good platform to discuss this, because the groups having contributed to MAVLink similarly are interested in CAN.
So far my main concerns are:
1) MAVLink might not really fit the bus well
2) ARINC 825 has very expensive standard documents (correct me if I'm wrong) and a pretty broad scope
3) CANOpen might be attractive as there is a lot of work already in the classic robotics domain - has anybody worked with it and can comment on this?
4) CANAerospace has public and pretty compact docs. Despite the simplicity, I had no hard time identifying most messages of interest for me.
I agree on matt's analysis of this:
I can now see the need for three communication modes. Broadcast, PTP streaming and PTP messaging. PTP streaming is to carry raw MAVlink. PTP messaging is to do node discovery and setup.
And discovery / setup is certainly really, really important. Has anyone worked out some more detail, or can comment on ARINC 825 in this regard?
Note that I think it's important that we aim for a standard that fits the needs / scope / ecosystem, and should not try to squeeze it into something that was made for a different purpose scope (else everybody would be running SAE AS-4 on their telemetry links now, but somehow only few do (any examples?)).
-Lorenz
------------------------------------------------------
Lorenz Meier
Institute for Visual Computing
ETH Zurich
http://www.inf.ethz.ch/personal/lomeier/
On Jun 12, 2013, at 2:28 PM, crashmatt <
uavfligh...@gmail.com<mailto:
uavfligh...@gmail.com>> wrote:
Mariano,
Great to hear from you again. I had forgotten how much we had discussed about this. Many thanks for the reminder.
I did have my doubts about ARINC825 but in the end it became quite attractive. if we operate with the "special message" bit set, we can stay close to ARINC825 without the burden of 100% compatibility.
I can now see the need for three communication modes. Broadcast, PTP streaming and PTP messaging. PTP streaming is to carry raw MAVlink. PTP messaging is to do node discovery and setup.
We started to discuss how a user might setup a system. I think we need to put more detail on this. There are some options between having an eeprom based or hard coded setup. My more paranoid side leans towards hard coded, especially for it's simplicity.
Regards Matt
On Wednesday, June 12, 2013 6:49:41 AM UTC+2, malife wrote:
Hello Matt and Bryant,
It is great to see there is interest to start working on this again. Back in 2011 at some point we made a list of "requirements" and it was further corrected. I have added what has been discussed in the last week to the list as follows:
1. The 29-bit Extended identifier is preferred in order to have space to layout enough information in the identifier. This identifier would be used, among other things to implement message prioritization, messageID, systemID, componentID, and packet start.
2. There are two items living in the network: nodes and channels. A node is the access point to the network; a node itself can have multiple channels, for instance there could be a right wing node, that has four channels: two servos for ailerons, one servo for flaps and one to control lights. The channels do not have direct access to the network but only through its controlling node.
3. There are two main trains of thought about how to assign addresses to the channels (nodes):
* All the addresses are pre-compiled (defined either in an XML style file that gets converted to C or an outright header file), the user is in charge of making sure no ID collisions exist and that if a channel (node) needs to know about another it does so at compilation time.
* There is a central place where upon connection of a new channel (node) this central place assigns an address to it and it announces it on the network. Therefore there exists a network manager.
4. It is preferred that the messages do not exceed the maximum of 8 available bytes in CAN if possible.
5. A connectionless scheme is preferred but it was pointed out that different filters (in the CAN sense) could be used to have peer-to-peer connections and connectionless messages live in the same node, just on different filters. It was further suggested to have the 1st set runs small, fast critical control data with no connection while the
2nd set runs everything else in connected mode.
6. Those who prefer connectionless scheme then suggest that there are two types of messages: periodical (like a sensor reporting data) and asynchronous (for instance a command to move a servo or a camera, or report the movement of a servo or a camera).
7. Everyone agrees to keep it as simple as possible.
8. There were some suggestions about adopting one of the existing CAN in aerospace standards, either CANAerospace or ARINC 825. Those that have read about the standard feel like they are much more complex than what is needed for small research/amateur MAVs and that little is gained by being compliant.
9. The channels (or nodes) that are related to actuators (servos mainly) should have a "zero position" (which could be no signal or no drive.) upon boot and until it gets a command from another node on the network.
10. The chosen implementation should not be a forcing of MAVLink into CAN but rather something that is as simple as MAVLink to implement on board and use but at the same time makes sense from a CAN perspective.
11. The last issue on the table was how to go about assigning addresses. Everyone agreed that precompiled addresses was a no-go since this could lead to a lot of recompiling in event of a change in addressing. The only option left was that these addresses be assigned at runtime either read from an EEPROM, via a DIP Switch or some other way but seemed like this was going to be left to the end user to decide must likely at the hardware level. Just recently it has been suggested to implement an automatic discovery system (see item 3 bullet 2).
12. Redundancy support.
13. It should be universal and not only designed to be used by UAVs.
I've requested access to the document you linked before so I can take a look at it and see if we can decide upon the correct requirements and structure.
Cheers!
On Tuesday, June 11, 2013 2:03:10 PM UTC-5, crashmatt wrote:
Here is a link to the MAVCAN document written in 2011. It has a good description of broadcast messaging and an outline of how PTP messaging will work.
https://docs.google.com/document/d/1ktoPuBBSJjqZNDilymhvGytV-ucAk_wcWkDTwpa9IY0/edit?usp=sharing
Please request access to this document. It is not public release
On Monday, June 10, 2013 2:37:46 PM UTC+2, crashmatt wrote:
Bryant,
Great to hear of someone also interested in CAN. My involvement with CAN stopped when I discovered greater limitations in other parts of my system. Now that is fixed, I am back on the case.
The original scheme proposed sending c structure packed data which limited how it could be used. It was heading towards being based on ARINC825. My concern with ARINC825 is that it consumes some of the data space in metadata. This is ok for boeing and airbus since they mostly have a physical CAN node per function. Messages are more point-to-point than broadcast.
CANopen and NMEA2000 were not considered at the time. CANopen is nice and simple with basic broadcast messaging. At the opposite end is the fully featured ISO 11783 Multi-Packet with large packet handling and flow control at the expense of bad latency.
The number of mavlink rx buffers is a concern with CAN. It is possible to have multiple MAVlink starts on the bus at the same time, even originating from the same node. Failure to support this means that a long low priority message can hold the bus or a long low priority message is never delivered.
A limited wishlist:
* Easy to setup - plug and play?
* Must support message prioritization
* Support multiple protocols
* Redundancy support
* An automatic discovery service
* Finds physical nodes and/or logical services
Message priority and protocol take a few bits each at the start of the identifier. I get the feeling that the MAVlink metadata will not fit, especially if we add more features.
The start bit is an interesting idea. If the start bit is asserted, that CAN frame could consume some of the data space for metadata just for the first frame.
I have been thinking that CAN needs to carry the existing MAVlink messages efficiently which is wrong. MAVlink doesn't have suitable standard messages for passing around internal sensor/actuator data. A set of new messages are required anyway. We have the opportunity to define short messages suitable for a single CAN packet.
So do you choose a simple broadcast based system or a complex connection based system? The conclusion we came to was that you should do both at the same time.
The most difficult aspect of this is usability. How will a user setup a system? How will the system know what to expect and what to do with the data?
Regards Matt
On Sunday, June 9, 2013 8:36:27 PM UTC+2, Bryant wrote:
Matt,
There's been some interest by other people in my lab in adding CAN support to this for a while, so we're very excited to hear that you're still working on it. It looks like you were involved in the previous discussion with Mariano back in 2011 [
https://groups.google.com/d/msg/mavlink/gGyHAQ9PAdE/HR6cOOEAmjsJ], so I'm sure many things have been hashed out, but I wanted to ask for me and the group anyways:
1. a) Has there been an exploration of the existing CAN standards and how they package data? If not for compatibility, maybe for spec reuse as I'm sure this problem's been solved before? It looks like avionics-based CAN protocols were explored, but was CANopen (open) or NMEA2000 (proprietary) ever examined? I know NMEA2000 has a fairly sophisticated method of encoding metadata in the 29-bit extended message ID.
1. b) Is this protocol going to be MAVLink packaged into CAN packets or a re-implementation keeping in line with CAN limitations and effectively reworking packets? Previous discussion suggested a MAVLink-on-CAN (your case 2) approach while it sounds like you are discussing a MAVLink-over-CAN (your case 1) here.
2. You mention fitting everything into the body of the message, but by requiring CAN2.0B we can leverage the 29-bit header file to embed a lot of data. Currently the header & footer of the MAVLink come to 64-bits. The two-byte checksum is a footer, but can be replaced by the CRC field in a CAN and also be handled in hardware on a per-CANbus-packet level. If we use a specific packet ID as part of the CAN message ID that removes the extra 1-byte message start indicator. I think the message sequence only makes sense as part of the payload, but that leaves: messageID, systemID, componentID, and packet start. Packet start does not need to be a whole byte, but can be a single bit here. So we might even be able to encode message length as the extra 4-bits in the ID field (in units of CAN messages) which allows for 8*16 bytes of data (128).
I'm really interested in MAVLink-on-CAN or MAVLink-over-CAN, whichever the implementation may be, and am curious as to how your protocol currently works. Right now I'm using NMEA2000 for my onboard CAN network but would like to switch to an open standard, especially if it builds off of MAVLink, if possible. Additionally I'm interested in the onboard implementation being friendly to systems besides MAVs or even airborne vehicle (I work with a boat and ground rover) and want to make sure this format would be amenable to those kinds of systems.
Bryant
On 06/08/2013 11:44 PM, crashmatt wrote:
My CANbus project has restarted, driven by the need for less wires in a space limited airframe. The aim is to carry sensor and actuator data in a robust and possibly failsafe way.
It makes much sense to use MAVlink over CAN since it has the message identification and pack/unpack needed. The question is exactly how to implement it.
CAN is a multidrop bus where MAVlink is normally a point to point architecture.
CAN message packets are limited to 8 bytes which does not fit most MAVLink packets
CAN messages have a 29bit identifier plus header, checksum, data length.
Only the shortest MAVlink messages will fit inside a CAN message. There are some choices:
1. CAN simply carries a MAVlink datastream in the same way that serial or UDP does.
2. CAN specific MAVlink message are defined that fit inside the 8 byte limit.
Looking at the test case of servo output. There are two messages that could be used, SERVO_OUTPUT_RAW or MAV_CMD_DO_SET_SERVO. Neither of these fit in the CAN message.
MAV_CMD_DO_SET_SERVO has the potential to fit if it goes on a strict diet.
SERVO_OUTPUT_RAW needs to be split into three CAN messages and then re-assembled at the receive end. The message needs sending more than once for airframes using more than 8 channels. Variable length mavlink messages could really help here.
If you are doing MAVlink streaming over CAN, you also need to carry the header,length,sequence, system, component, message id and crc. That is an extra CAN message just for the overhead. For the SERVO_OUTPUT_RAW message it is a total of 4 CAN messages.
For my 12 servo channels, the total is now 8 x 8-byte CAN messages. How bad is this?
An 8 byte CAN message is 128bits long or 128us. Presuming that the servo message is highest priority and nothing else interrupts, the total send time is 1.04ms.
This is not so bad but it is not great either. The same information could be packed into only 3 CAN messages taking 0.38ms.
The efficiency will be better as the mavlink message length increases. Using either a specific servo message or a variable length mavlink message would bring it down to 5 CAN messages. That is a pretty good compromise.
MAVlink over CANbus coming soon.
/Matt
On Tuesday, March 8, 2011 2:07:58 AM UTC+1, malife wrote:
Hello Matt,
thanks for posting those links. I have kind of a love-hate with I2C, so I'm not to fond of it :-)
I am about to post a proposal that borrows a lot from your current bit distribution, except that it focuses solely on MAVLink, i.e. there would be no "virtual serial port" or "telemetry" field but everything would be MAVLink ready. Feel free to make any comments to that, this is the plan we currently have in place for our nodes but you have more experience on adjusting MAVLink to CAN so your feedback is really appreciated.
Cheers!
--
Sie haben diese Nachricht erhalten, weil Sie der Google Groups-Gruppe MAVLink beigetreten sind.
Um Ihr Abonnement für diese Gruppe zu beenden und keine E-Mails mehr von dieser Gruppe zu erhalten, senden Sie eine Email an
mavlink+u...@googlegroups.com.
Weitere Optionen:
https://groups.google.com/groups/opt_out
--
Sie haben diese Nachricht erhalten, weil Sie der Google Groups-Gruppe MAVLink beigetreten sind.
Um Ihr Abonnement für diese Gruppe zu beenden und keine E-Mails mehr von dieser Gruppe zu erhalten, senden Sie eine Email an
mavlink+u...@googlegroups.com<mailto:
mavlink+u...@googlegroups.com>.
Weitere Optionen:
https://groups.google.com/groups/opt_out