💾 CyphalServoController12/CAN-firmware

General Formatting Checks Spell Check Compile Examples

Firmware for the 12-chanel PWM servo controller which is based on the OpenCyphalServoController12 board.

How-to-build/upload

arduino-cli compile -b rp2040:rp2040:rpipico -v .
arduino-cli upload -b rp2040:rp2040:rpipico -v . -p /dev/ttyACM0

or

arduino-cli compile -b rp2040:rp2040:rpipico -v . --build-property compiler.cpp.extra_flags="-DCYPHAL_NODE_INFO_GIT_VERSION=0x$(git rev-parse --short=16 HEAD)"

Adding argument --build-property compiler.cpp.extra_flags="-DCYPHAL_NODE_INFO_GIT_VERSION=0x$(git rev-parse --short=16 HEAD)" allows to feed the Git hash of the current software version to 107-Arduino-Cyphal stack from where it can be retrieved via i.e. yakut.

How-to-yakut

Install and configure yakut:

. setup_yakut.sh

Set servo pulse width via yakut (cyphal.sub.pulse_width.id = 4001):

y pub --period=0.1 4001:uavcan.primitive.array.Natural16.1.0 '[1000, 2000]'

Set servo pulse with for all 12 channels via yakut (cyphal.sub.pulse_width.id = 4001):

y pub --period=0.1 4001:uavcan.primitive.array.Natural16.1.0 '[1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000]'
...
y pub --period=0.1 4001:uavcan.primitive.array.Natural16.1.0 '[2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000]'
...
y pub --period=0.1 4001:uavcan.primitive.array.Natural16.1.0 '[1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500]'