Dorna Document

Dorna Document

  • GitHub
  • Dorna.ai

›Commands

Commands

  • Introduction
  • JSON format
  • Messages
  • Order of commands
  • Joint move
  • Rapid move
  • Line move
  • Circle move
  • Halt
  • Alarm
  • Sleep
  • Input
  • Probe
  • Output
  • PWM
  • ADC
  • Joint
  • Motor
  • Tool length
  • Version

PWM

{"cmd":"pwm", ...}

This command will enable and disable PWM pins and will set their duty cycle and frequency to the desired values. The default queue for this command is the high priority queue. If the queue parameter is set to 0, then the command will be submitted to the normal priority queue. In response to this command, the state of all PWM pins will be returned.

Key, value pairs

KeyValueRequiredDescription
"cmd""pwm"YesEnable or disable PWM pins and sets their duty cycle and frequency values.
"id"Int (>0)NoId can be any positive integer. If id is not provided, status of the command will not be returned from the controller.
"pwm0", "pwm1", "pwm2", "pwm3", "pwm4"0 / 1NoIf pwmi is set to 0, it will disable ith PWM pin. If pwmi is set to 1, it will enable ith PWM pin. If pwmi is not present as a key, state of ith PWM pin will not change by the command.
"duty0", "duty1", "duty2", "duty3", "duty4"Double (>=0 and <=100)NoIf dutyi is present as a key, duty cycle of the ith PWM will be set to its value which is the percentage of the period that the PWM pin will be on.
"freq0", "freq1", "freq", "freq3", "freq4"Double (>=0 and <=120,000,000)NoIf freqi is present as a key, frequency of the ith PWM pin will be set to its value.
"queue"0 / 1NoIf the value is 0, the command will be submitted to the normal priority queue. Otherwise, it will be submitted to the high priority queue. The default value 1.

Response

KeyValueDescription
"cmd""pwm"In response to pwm command, a message is returned with cmd field set to pwm where the state, duty cycle and frequency of all PWM pins are included in it.
"id"Int (>0)Same id as the original command.
"pwm0", "pwm1", "pwm2", "pwm3", "pwm4"0 / 1Indicates if each PWM pin is enabled or disabled. 1 means the PWM pin is enabled and 0 means it is diabled.
"duty0", "duty1", "duty2", "duty3", "duty4"Double (>=0 and <=100)Indicates the duty cycle of each PWM pin.
"freq0", "freq1", "freq", "freq3", "freq4"Double (>=0 and <=120,000,000)Indicates the frequency of each PWM pin.

example

{"cmd":"pwm", "id":10, "pwm0":1, "pwm2":0, "freq0":125}

This command will set the frequency of pwm0 to 125Hz and enable it. It will also disable pwm2. The response will have information about all PWM pins.

{"cmd":"pwm", "id":10, "pwm0":1, "pwm1":0, "pwm2":0, "pwm3":1, "pwm4":0, "duty0":5, "duty1":2, "duty3":32, "duty4":9, "freq0":125, "freq1":320, "freq2":450, "freq3":1200, "freq4":100}
Error codes
StatValue
-300Halt already in process
-400Alarm activated
-601Duty cycle parameter is out of range
-602Freq parameter is out of range
Last updated on 7/12/2022
← OutputADC →
  • Key, value pairs
  • Response
  • example
Dorna website →
Copyright © 2022 Dorna Robotics