# 1. Cyphal/DroneCAN PWM node

The node is designed for light unmanned aerial (UAV) and other vehicles for servos and ESCs controlling.

The node supports 2 interfaces. Please refer the corresponded section for details:

# 1.1. Variations

At that moment we have 3 types of such PWM nodes, so-called Mini v2 node, Mini v1 node and Mini v2 node and Micro node. They are illustrated below.

Mini v2 Mini v1 Micro

1. Micro node is the smallest CAN-PWM converter designed to control 1 - 2 ESC or servo with an external power.

Micro node may power the servo, but it is not recommended, since, due to the lack of its own DC-DC, the entire load will go to the device that powers the micro node. If you need to power a servo, it is recommended to look at mini nodes (v1 or v2).

2. Mini v1 node and Mini v2 node is the CAN-PWM converter designed to control 1-4 ESC or servo. Since the node has a built-in DC-DC, a servo can be powered through it. The board also supports receiving feedback from the esc flame.

It is recommended to look at to mini v2 as on a new version of this board, which has a more convenient pin layout and double the number of CAN connectors.

The overall difference between the boards are following:

Criterion Mini v2 Mini Micro
1 dc-dc availability yes yes no
2 input voltage 2S-6S 2S-6S 4.8-5.6 V
3 input current sensor no no no
4 number of output pwm 4 4 or 2 * 2
5 Vin voltage sensor yes yes -
6 Number of big CAN 2 1 0
7 Number of small CAN 2 1 2
8 Size, LxWxH, mm 42x35x12 42x35x12 20x10x5
9 Weight, g 5 5 3

The actual number of mini v1 pwm channels depends on the firmware. Servo firmware allows to use 4 pwm channels. Esc firmware allows to use 2 pwm channels with feedbacks from esc flame.

# 1.2. Main function

This node receives setpoint that might be represented as:

Output for each desired setpoint is PWM signal with frequency 50-400 Hz and duration from 900 to 2000 us. Typically, 900 us means the minimal position of servo or stopped motor on the ESC and 2000 us is a maximum. But this range might be different depending on your actuator and desired angle of control of your servo. You also may want to inverse the output of your servo and set a default position of your servo other than just a min or max, for example, a middle.

Configuration of such mapping might be done using 4 parameters: channel, min, max, and def which exist for each PWM-channel. They are described in 6. Parameters section.

The node can process up to 2-4 setpoints at the same time.

# 1.3. Auxiliary functions

1.3.1 Circuit status

PWM-node as well as any other our nodes measures and sends 5V, Vin voltages and device temperature.

  • for DroneCAN implementation details please check here,
  • for Cyphal implementation details please check here.

1.3.2 Esc flame feedback

If you use Tmotor esc flame (opens new window) it might be possible to get feedback from it via UART port.

  • for DroneCAN implementation details please check Esc Status,
  • Cyphal implementation is not ready yet.

This feature was tested on FLAME 80A 12S V2.0 (opens new window).

1.3.3 Log messages

The node may inform you with a text message when something happen.

At that moments the node may publishes messages in 2 ways:

  1. 5 second after enabling. Here we can have one of following messages:
  • If everything is ok, the log level is DEBUG and the message is sys inited
  • If the node have power problems, the log level is ERROR,
  • If the hardware and software diagnostic fails during initialization, you will get a CRITICAL level message. This should not happen in normal condition, but if so, don't use it in production. In this case, the node repeats the message each 15 seconds.
  1. When TTL timeout occurs. This message has log level WARNING.

For DroneCAN implementation details please check Log messages.

Cyphal implementation is not ready yet.

1.3.4 Time to live

Every received setpoint has his own time to live timestamp.

If the timeout specified in parameters is exceeded, the setpoint will be equal to default value.

Typically, the value of this parameter should be at least in 2 times more that setpoint publish rate.

The default value for nodes that doesn't support configuration via parameters is 0.5 seconds.

1.3.5 Watchdog

The node performs the diagnostic during all of the working time. In case of freeze, it will automatically reboot in 0.6 seconds.

1.3.6 Flight time recorder

The flight time recorder feature allows you to record total time when the node is armed. It might be useful for application where hardware resource is essential. Some devices such as internal combustion engine is recommended to update in a relatively short period of time, let's say 300-400 hours.

The flight recorded time is stored in flash memory. The limitation of working with flash memory is following:

  • it takes time to erase and write data to the memory,
  • the erasing resource of flash memory is limited. Since we don't want to interfere on the node during arm, the tine updating is performed only after 0.5 second after node goes into disarm state.

Since PX4 doesn't support ArmingStatus (opens new window) yet, the arm/disarm state is estimated by RawCommand. If all values of these commands are zero or negative, it is estimated as disarm. If any of commands values are positive, it is estimated as arm.

1.3.7 Led indication

This board has an internal led that may allow you to understand possible problems. It blinks from 1 to 10 times within 4 seconds. By counting the number of blinks you can define the code of current status.

Number of blinks Health Description
1 OK Everything is ok.
2 OK There is no setpoint at least for the last 0.5 seconds, PWM state is reset to the default state.
3 WARNING This node can't see any other nodes in network, check your cables.
4 ERROR There is a problem with circuit voltage, look at the circuit status message to get details. It may happen when you power it from SWD, otherwise, be careful with a power supply.
5 CRITICAL There is a problem on the periphery initialization level. Probably you load the wrong firmware.

# 1.4. Software update

The node doesn't support software uploading via CAN yet. Although the next generation of the device will be. We are going to use Kocherga bootloader (opens new window) in future. Right now the only way to upload the software is to use a programmer. Check programmer usage section (opens new window) for details.