Pavel Kirienko's Posts (6)

Sort by

UAVCAN v1.0 is here

5334376271?profile=originalGreetings.

This is a cross-post from the ArduPilot blog.

UAVCAN was first announced six years ago, in early 2014, as an RFC doc published on this website. Over the following few years, it saw adoption in numerous systems – mostly UAV, naturally, but also including spacecraft, micromobility vehicles, and even racing cars. The vast empirical data collected from fielded systems over the years allowed us to identify the weak points in the design and eventually enabled us to come up with the rectified, field-proven stable design which we call UAVCAN v1.0.

The stable version was first announced about 18 months ago. Expectedly, the fact that v1.0 breaks wire compatibility with the original design based on that first RFC caused concern among the adopters. The resistance is understandable and we are certainly not blind to the costs of migrating the existing ecosystem to a different format, but we are confident that the costs are justified. This is because the design imperfections of v0 if left unrectified would be far costlier to the ecosystem in the long term than a breaking change introduced now.

The design issues of v0 that affect the UAV industry the most were neatly summarized by Tridge himself in a thread on the UAVCAN forum. As one can see from reading the thread, his input was incorporated into the v1 design. Specifically, that includes an improved approach to data type extensibility and versioning, and the ability to construct heterogeneous networks where the experimental v0 can co-exist with the stable UAVCAN v1.

While we are at it, I would like to quote myself from the thread on the necessity of the breaking change:

UAVCAN v1 is being deployed in highly complex vehicular applications where v0 could not be used due to its inherent limitations, only some of which were reviewed here. The most critical issue in v0 is the syntax-semantics entanglement, which by itself was an underlying cause for some other, more apparent issues, such as the over-specification of the standard data types. UAVCAN v0 is a great protocol for trivial UAV applications with unsophisticated hardware setups and straightforward design requirements, such as those that can be found in various basic industrial applications or hobby machines. The problem of v0 is that it breaks outside of that domain, and it is not possible to take v1 out of there without breaking backward compatibility. While the transition is painful, it is beneficial for everyone, especially the existing adopters of v0, because the much-improved architecture of v1 will increase the reach and coverage of its ecosystem, effectively increasing the available product options for integrators and at the same time increasing the reachable market for product manufacturers.

The improved ecosystem management policies and the new technical capabilities enable a very long design lifespan for v1 […]

Considering the state of the industry at large, one can see that v1 is a fundamental improvement over v0.

Having discussed and defined the design requirements, the last few months were spent updating the Specification and finalizing the reference implementation libraries. This work was completed just a few days ago, yielding the following results:

  • Libcanard v1 – an updated version of the venerable Libcanard v0. It comes with 100% test coverage and a rigorous timing/resource utilization model for the benefit of high-integrity embedded systems.
  • PyUAVCAN v1 – a redesigned from scratch version of the old PyUAVCAN v0 based on async API.
  • The Crash Course, covering the basics and explaining the differences from v0.

I am happy to report that v1 is already here and one can build an actual v1 hardware node. I am hopeful that the ArduPilot community will find it just as useful as we do, and that it would find its way into AP_Periph as the default option along with v0.

While v1 is already usable, there is still some work to be done. We are grateful to NXP Semiconductors and other major adopters for helping us advance the project, but there is always more work than we can handle, so we can use all the help we can get. The current areas of focus are outlined in the recent UAVCAN Roadmap.

UAVCAN has been extensively validated in the field across many industries over the last six years, which gives us the confidence to state that the design lifespan of v1 should exceed at least a decade.

Read more…

Greetings everyone,3689713718?profile=original

The first release of Libcanard v0.1 was published yesterday. Grab your copy on Github.

Libcanard is a dependency free, very compact implementation of the UAVCAN stack in C99. It is designed for low cost, deeply embedded applications with limited computing resources and small amounts of available ROM and RAM. It supports NuttX, STM32 (any RTOS and baremetal), Linux SocketCAN, and AVR microcontrollers so far, with more platforms to come.

Special thanks goes to Antoine Albertelli, Michael Sierra, Paul Patience, Matthias Renner, and others - without their help the project would not have been possible.

If anyone is willing to lend a hand to further advance the project, let's coordinate on Github.

Also consider subscribing to the mailing list and join the public chat room to stay up to date.

Read more…
3689610526?profile=original

UAVCAN is a lightweight protocol designed for highly reliable communication in UAV and robotic applications via CAN bus.

Its key features are the following:

  • Very low data overhead - which makes it suitable for high frequency distributed control loops.
  • Democratic network - no single point of failure.
  • Supports network-wide time synchronization with sub-millisecond resolution.
  • Allows to efficiently exchange datagrams longer than can fit a single CAN frame.
  • Publish/subscribe or request/response exchange patterns.
  • Doubly-redundant or triply-redundant CAN bus support.
  • Lightweight, easy to implement protocol (minimal sensor node can be implemented in less than 300 lines of C99).
  • Can be used in deeply embedded systems (the full featured reference implementation in C++ runs on a 32K ROM, 8K RAM MCU).
  • The specification and the reference implementation are open and free to use (MIT License).

Half a year ago, UAVCAN RFC was first announced here: http://diydrones.com/profiles/blogs/uavcan-can-bus-for-uav. Since then, UAVCAN got a complete specification and a full featured portable reference implementation in C++ for Linux and embedded systems. It's worth noting that the list of officially supported embedded platforms includes NXP LPC11C24 - a low-cost ARM Cortex-M0 MCU with an embedded CAN controller and a CAN driver, i.e. a true single-chip solution for cost-efficient CAN bus applications.

Current release is a preliminary release, which means that some aspects of the specification can be changed in a way that can break backward compatibility. The specification and the standard data type set are expected to be frozen by the end of 2014, which would make a final release. Since the final release, standard data types won't ever change at all, but new types still can be added (it doesn't break the backward compatibility).

PX4 native stack is going to be the first adopter of the protocol; currently UAVCAN support is already merged into its master branch. Also, there's a few products will be announced later this year that use UAVCAN as a primary and only communication interface. Stay tuned!

Links:

Read more…

UAVCAN - CAN bus for UAV

Good day everyone,

3689569856?profile=original

A modern drone or flying robot tends to have quite a number of different hardware units onboard - Autopilot, Gimbal, GPS, ESC, OSD, PDB, RC just to name a few. As there is no common method to interconnect that variety of devices, and for sure each hardware unit tends to implement its very own interface, obvious difficulties arise:

- Implementing support for new peripherals is hard (e.g. consider PX4Flow driver for APM; 3DR GPS; MinimOSD).

- Autopilots need to accommodate variety of physical interfaces for different peripherals - this imposes some penalties on the device size, cost and weight (e.g. Pixhawk and its so called "connector farm").

- MOST of currently used interfaces are simply not designed to be reliable nor scalable, thus moving towards more reliable systems while sticking to the current onboard communication methods is absolutely impossible (e.g. RC PWM - pet peeve of mine, absolutely worst case; or ubiquitous UART).

Properly designed standard for hardware interconnection in UAV systems may encourage different manufacturers to produce compatible hardware and software, this is why I consider it important to offer such a standard for community. Previously I took some steps trying to rectify the current state of affairs with the hardware compatibility: first, I implemented the CANaerospace protocol support in portable C library - libcanaerospace: http://diydrones.com/profiles/blogs/open-source-canaerospace-library-for-uav (BTW this article covers the CAN bus features in general, those who are unfamiliar with CAN may be interested to read); second, with cooperation with Lorenz Meier, there was proposed a convention for connector compatibility: http://www.diydrones.com/profiles/blogs/can-bus-conventions-for-small-uav.

However, CANaerospace is apparently not a silver bullet, here's why:

- CANaerospace has more than 50% of payload overhead which makes it unfit for high speed data streams that are so common for UAV (especially for light machines where the controlled system requires high update rates and low latency).

- CANaerospace does not provide an easy way to pass multiple values in one bunch, which is also very common task in the UAV field.

- CANaerospace does not provide adequate means for some extremely common higher-level tasks, such as node configuration handling, firmware update, time synchronization, etc.

Thus, there seem to be a need for some protocol that could be used as a backbone network on UAV and flying robots, and that could address the issues listed above. So meet the UAVCAN protocol specification draft: https://docs.google.com/document/d/1IgOZ2proS0Bwx3_nc8u7CM81ldHcxWzlgMVjNfW5Has/pub

UAVCAN core design goals:

- Provide a suitable protocol standard for UAV hardware manufacturers.

- Support redundant physical interfaces and redundant nodes for highly reliable systems.

- Address the issues inherent to CANaerospace, as listed above.

- Make it easy to implement and easy to use in deeply embedded systems with limited computational capabilities (i.e. ensure small memory footprint, low computational complexity).

- Explicitly define support for some common tasks (node configuration handling, firmware update, time synchronization, etc).

All of this is described in-depth in the RFC linked above. I'd like to ask the community for comments on this standard, especially regarding the standard data type definitions (see the corresponding chapter), the "std/equipment/" part. It is important to make sure that the standard types are extensive enough to cover most possible use cases for the majority of UAV applications. Also I'd like to make sure that the RFC language is comprehensive enough so that other engineers can get at least general idea of how to implement it, and absolutely clear understanding of how to use it.

As a closing remark I'd like to add that the situation with UAV hardware is changing: the next revision of Pixhawk is going to get the full support for UAVCAN, as well as PX4ESC is; also there are some other compatible hardware to be announced pretty soon.

Best regards,

Pavel Kirienko.

P.S. This is a cross-post from drones-discuss: https://groups.google.com/forum/#!topic/drones-discuss/DMjfnaWViUw; please leave your comments there.

Read more…

CAN bus conventions for small UAV

Hi everyone!Driven.jpg?width=200

As the developer of the open source CANaerospace library that (I hope) is gaining attention (as well as CAN does), I'd like to propose this RFC that defines the community standard for CAN interoperability:

https://docs.google.com/document/d/1L9HXnlS7FqYGCrBM9hExpfpJZ99gKUBtNMMypMZKSvw/pub

The set of rules defined by this document shall be easy to follow for the majority of CAN-enabled UAV hardware.

Please join the discussion and leave your comments in the MAVLink group: https://groups.google.com/forum/#!topic/mavlink/dHDkRd1vT3k

Thanks!

Read more…

Open source CANaerospace library for UAV

Good day everyone.Driven.jpg

There is open-source library implementing the CANaerospace protocol, targeted for microcontrollers and Linux. It is compact and easy to use in embedded systems with few amount of memory and limited processing power (such as most drone autopilots).

It is released under MIT license, so there is no problem if you want to link and distribute it along with your closed-source project.

The repository is here: https://bitbucket.org/pavel_kirienko/canaerospace

Examples, of course, also provided: https://bitbucket.org/pavel_kirienko/canaerospace_embedded_examples

Why CANaerospace

The time of randomly mixed I2C, PPM and UARTs should be over.

1. Reliability

The first reason is reliability.

CANaerospace allows the use of redundant CAN buses as well as redundant units. I.e. you can connect each device to  the two CAN buses simultaneously, and if one bus fails other will keep going (so there is no single point of failure). In case of unit redundancy you can use two identical mission-critical devices, and if one device fails you'll simply switch to another and save the world.

Note that this library supports CAN bus redundancy in fully transparent way, i.e. your application simply will not care about how many buses are currently in use, and how many of them are dead.

To know a bit more about unit redundancy you can read the corresponding chapter in the CANaerospace specification.

2. Common standard

The second reason is the ability to come to the common standard to get a better interoperability between devices from different vendors. Consider the great ESC32 project (I'm not affiliated) - it has nice CAN interface, but lacks any software to work with it. Consider the discussions on OpenPilot forum for instance, where people are looking for a way to build a reliable bus for their system.

Yes, CAN bus will be a bit more expensive than usual interfaces, but it's worth it in most cases.

Supported hardware

Currently just two platforms are supported out of the box, they are Linux (with SocketCAN) and STM32 (with embedded dual CAN controller). Since STM32 is so wildly popular in UAV systems, support for it does worth a lot I believe. If there is a demand I'm feeling ready to provide even AVR/Arduino support, despite the fact that using CAN on AVR is not a best idea I've had.

Anyway, if you lack support for your very own hardware, it is not a difficult task to write your own driver for it. Just refer to the examples.

UAV-specific features

If there are guys who are familiar with CANaerospace, they may be aware that standard NOD identifier distribution lacks support for some messages which may be extremely useful in UAV applications, such as:

  • Camera control messages
  • Messages to transfer the covariance data from IMU
  • Messages for magnetometer readings
  • Whatever else

Thus, I'm going to extend the standard ID distribution with these messages, to make this protocol more UAV-friendly. Feature requests are highly welcome.

Conclusion

Feel free to publish feature requests or whatever on the project page, and good luck with your work. :)

Read more…