Homepage GitHub

How to control Servos via UAVCAN?

I’m working on a project to build a coax helicopter with 6 servos. I am planning to use the PX4 Autopilot on a Pixhawk 4 FCU. What do I need to control the servos via UAVCAN?

So far I thought of two options:

  1. Ordering the UC4H hardware from jdrones/OlliW. As far as I understood it, I can use the Gen-node to control the servos, right?
  2. Ordering servos that can be controlled by UAVCAN natively. This is not an option for me, because I already have quite expensive servos from FUTABA which can be controlled via S.BUS but not UAVCAN.

So, I would like to know if my first option would work and also if there are any other options, that I couldn’t come up with. Thank you very much in advance.

UAVCAN v0 is currently in the legacy maintenance mode and it will see no further development. New projects should adopt UAVCAN v1, which rules out UC4H. The PX4 team is currently working on supporting UAVCAN v1 and it is expected to be available in the foreseeable future (I am not in a position to provide any estimates, it’s best to consult with the PX4 devs directly).

For interfacing your analog servos with UAVCAN consider building an adapter node based on 107-Arduino-UAVCAN. You will find relevant documentation on the project page and also on this forum (use search):

2 Likes

Thanks a lot for your help, @pavel.kirienko!

If I understand this correctly, the 107-Arduino-UAVCAN library will currently not work with PX4, because PX4 doesn’t support UAVCAN v1 yet, right? So I would have to wait and possibly contact the PX4 development team, if they can provide any insights on when they will release UAVCAN v1 support.

Once PX4 rolls out v1 support: What options will I have to control my servos with UAVCAN v1 or more specifically what parts can I buy? I guess the 107-Arduino-UAVCAN project doesn’t really support this as on the post you linked it’s written that it only supports “uavcan.primitive.scalar.Bit.1.0” messages

Hi @max11gen :wave:

As 107-Arduino-UAVCAN uses the C files generated via nunavut from all currently available UAVCAN types specified in public_regulated_data_types you can in fact use any UAVCAN type with this Arduino library - if you are generating the C headers for your specific type yourself (see here).

Independent of that there is currently some effort underway to support all uavcan types out-of-the box in the future.

2 Likes

Hi @aentinger and thank you for your help, too! That is indeed a great hint. Just out of curiosity (to improve my understanding of open source development): If it is so easy to generate the headers for all UAVCAN types, why don’t you just integrate the support for all types in the repo?

However, I really need a solution that enables me to control my servos via UAVCAN with a PX4. So if anyone has any hints for that I would be very happy.

@pavel.kirienko I searched for any kind of anouncement from PX4 about integrating UAVCAN v1, but I couldn’t find anything. Can you link me to something, or do you just happen to know that, because you are in close contact with the dev team?

It is possible - but not desirable as highlighted by @pavel.kirienko here. We are currently evaluating possible solutions such as a web-service to convert DSDS into Arduino headers easily. This would mandate to first extend nunavut to generate the Arduino headers/wrappers which so far have been implemented manually, such as Heartbeat.1.0.hpp. How’s your Python :grinning:?

@aentinger Unfortunately, my python is quite poor :smiley:

If I used v1.0.3 of 107-Arduino-UAVCAN for now I can use it with PX4, because you just adapted to UAVCAN v1 on your release v1.1, right? So that would mean I would just need to get some Arduinos + CAN-Shields and implement the code to control the servos on them, right?

Unfortunately that’s not how it works :wink: Versioning of 107-Arduino-UAVCAN is independent of UAVCAN versioning. You can see the changelog between the versions here, but I can assure you that its all only UAVCAN V1 (sorry).

1 Like

@aentinger Ah ok. I had seen the changelog already. I thought, that everything before version 1.1.0 was using UAVCAN v0, because in the changelog you wrote for 1.1.0 that you now updated to UAVCAN v1.0beta. But looking at the release history of UAVCAN now, I guess that you meant updating from UAVCAN v0.2 or v0.100 to v1.0…

1 Like