Inputs and outputs
Dorna provides multiple options for connecting peripherals as inputs or outputs to the robot. In this section we provide an overview of the IOs available in Dorna 2 controller, and different methods that you can access them.
IO pins
Dorna 2 controller has total of 42 IOs. Some of the IOs are available on the front panel of the controller box. The rest are on the controller board and can be accessed by opening the top panel of the controller box.
Type | Description |
---|---|
Digital inputs | 16 pins (8 in front of the box) |
Digital outputs | 16 pins (8 in front of the box) |
PWM | 5 pins (2 in front of the box) |
ADC | 5 pins |
In Blue version of Dorna 2, All I/O pins voltage level is 3.3V and any voltage higher than 3.3V might damage the controller board.
In Black version of Dorna 2, the input and output pins of the front panel are at 24V and the PWM pins of the front panel are at 5V. All internal I/O pins, similar to the Blue version of the robot are at 3.3V.
Make sure that the controller is turned off while you are connecting an I/O device to the controller. Connecting an I/O to the controller when the controller is running might damage the controller.
To prevent the robot from malfunctioning, use relay and an external power supply instead of relying on the controller pins and IOs to power and control external devices. Additionally, it is necessary to choose solid-state relays or MOSFET relays over magnetic relays since the latter draws an excessive amount of current from the controller, which causes the robot's firmware to crash.
To reduce the electromagnetic interference (EMI) noise on the inputs, it is essential to utilize shielded cable and ensure that the shield is connected correctly to the robot's ground (GND).
Input pins
Dorna 2 has a total of 16 input pins. Input pins are referred to as in0, in1, ..., in15
. Input pins in0,...,in7
are available on the front panel of the controller and input pins in8,...,in15
are available inside the controller box on the controller board.
Input pins are constantly monitored by the controller at a rate of about 100KHz
and upon change in their values a message is sent by the controller, reporting their new value.
Furthermore, the value of input pins can be read at anytime using command input
.
Voltage level 0 at an input pin corresponds to digital value 0 and voltage level 3.3V at an input pin corresponds to digital value 1.
Probing
Probing let the user watch the input pins until a specific sequence appears. When the match happens, the controller will return the value of all joints at the exact moment of the match. The command to run probing is probe
.
Probing is a very usefull feature in homing a joint using an external homing sensor. In a typical application, a joint can be homed at a time, when the robot head hits a sensor (electrical probing).
Furthermore, probing can be also useful for automatic and precise measurements. The robot can touch different surfaces of interest, and the readings from probe
function, can be used to measure the distance between those surfaces, up to the resolution of the robot.
Output pins
Dorna 2 has 16 output pins specified as out0, out1, ..., out15
, where the first 8 pins are available at the front panel of the controller and the last 8 pins are available inside the controller box. Output pins are very useful in actuating other devices, switches, microcontrollers or actuators.
Output pins can be set or reset by the user by calling command output
. The same command allow user to read the value of the output pins as well.
In Blue version of Dorna 2, digital value 0 appears as 0 voltage and digital value 1 appears as 3.3V at output pins.
At the startup, all output pins are initialized to 0.
Output pins of Dorna 2 Black version
The output pins of the front panel of the Dorna 2, Black version, are optocoupler-isolated open-collector type. Here we explain how the output pins work and how you have to connect your load to them. The I/O pins of the main processor inside the controller box are isolated via optocouplers from the I/O pins available to the user to protect the main processor against external electrical shocks or noise. Transmitting a zero on the output pin turns on the LED inside the optocoupler which in turn enables the output of the optocoupler. When the optocoupler output is enabled the current flows from the DC power source (+24V) through the Load and a transistor to the DC power GND. This current will turn the load on. This way, output pins of the controller can be used to drive and open/close DC loads. Each output uses a transistor to drive the load with sufficient current. The following diagram depicts the output circuit.
The internal 2W power supply is responsible for providing the current on the output pins of the front panel, the total current on all the output pins of the front panel should not exceed 160mA.The red arrow demonstrates the current path when the output is zero. When the output is equal to the logic one there would be no current and consequently, the load would be off. This kind of output is common in industrial sensors and is known as NPN output. Therefore to turn on the load, you should set the output pin to zero and vice versa.
If you intend to use the output as a signal (Not turning a load on/off), you should pull up the output pin to the (+24V) with a pull-up resistor. In this case, the voltage measured on the output pin will be 24V when the output is set to 1 and 0V when the output is set to 0. The following image shows the connection of the pull-up resistor to the output pin.
PWM pins
Dorna 2 has 5 PWM pins specified as pwm0, pwm1, ..., pwm4
. The first two PWM pins are available at the front panel and the last 3 pins are inside the controller box. PWM pins generate pulse width modulated signals with a specific frequency and a specific duty cycle. The command for turning PWM pins on with specific duty cycle and frequency or turning them off is pwm
.
PWM is very usefull for controlling DC motors, servo motors, and other types of actuators.
PWM pins of the front panel in Dorna 2, Black version are at 5V.
ADC pins
Dorna 2 has 5 ADC pins indicated by adc0, adc1, ..., adc4
which are all located inside the controller box. ADC pins take an analog signal between 0V to 3.3V and convert it into a digital signal by scaling the value and mapping it to an integer beween 0 to 2^16 - 1.
ADC pins are not monitored like input pins. The ADC pin values are only read and reported upon request by command adc
.
ADCs are mainly useful for reading the value of analog sensors, such as thermometers, light sensors, or potentiometers.