Skip to main content

DutyCycleEncoder

The DutyCycleEncoder node reads an absolute position encoder from a PWM duty cycle signal and tracks total rotation across all revolutions.

Configuration​

duty_cycle:
enabled: true
sensors: ["arm_encoder"]
arm_encoder:
port: 8
topic: "arm_angle"

Parameters​

ParameterDescription
portDuty cycle input channel — valid values: 0, 2, 4, 6, 8, 10
topicTopic name to publish on

Topics​

Published​

TopicTypeDescriptionRate
/<topic>studica_control/DutyCycleEncoderMsgabsolute_angle (float64), rollover_count (int32), total_rotation (float64)20 Hz

Service​

Service name: /<name>/duty_cycle_encoder_cmd
Type: studica_control/SetData

CommandDescription
get_absolute_positionAbsolute angle within one revolution
get_rollover_countNumber of complete revolutions
get_total_rotationTotal rotation across all revolutions