Analog and Digital I/O is a fundamental concept in robotics. What is the difference between them? We answer a question from the forum.
Over on our DoF forum, we get a wide variety of questions from the community. A Robotiq customer once asked "What is the real difference between analog and digital I/O? Which one should I use and when?"
This is a great question! Analog and digital I/O is a basic concept, but it is a fundamental one in robotics.
Catherine Bernier gave a great answer in the forum. I thought it was worth expanding on the topic here on the blog. I will answer the first half of the question in this article, and the second half of the question in the next article.
Let's start with the basics. I/O stands for "Input/Output." This means that we are talking about all the ways that a robot can interact with the real world.
Input usually refers to sensors, e.g. switches, potentiometers, cameras, etc. Output usually refers to the motors of the robot's joints, but it can also mean warning lights, alarms, etc.
For more information on robot sensor types, check out our eBook on adding sensors to robots.
There are two ways to differentiate analog and digital signals: by sensor type and by processing method.
In her forum answer, Catherine used a helpful example to explain the differences between analog and digital sensors. It involved using sensors to detect when a door opens and closes. I'll use the same example here, because I like it! It clearly demonstrates how different sensors can be used to detect the same real-world event.
Imagine that you want to detect whether a door is open or closed. You set up two different circuits, each with a different sensor:
Let's imagine that you attach a light bulb as an output to both circuits. This is an analog output. This is what will happen to the light bulb using both sensors:
So far, so simple.
The second factor that differentiates analog and digital signals is how they are processed. This is where it starts to get interesting.
Analog and digital processing differ in two fundamental ways:
Let's go back to our door example.
To demonstrate the effect of time, let's apply the two different types of processing to our on/off switch. Here's how that would look:
To demonstrate the effect of resolution, let's apply the two different types of processing to our potentiometer. Here's how that would look:
In these examples, I have intentionally used a low frequency and a low resolution to demonstrate the effect of digital processing compared to analog processing.
In reality, robotic systems run at much higher performances. For example, the Robotiq Force-Torque Sensors use a sampling frequency of 100Hz, which means that they are updated every 10 milliseconds. The FT300 can effectively measure 600 discrete values (+/-300N in steps of 0.5N).
At face value, analog seems to give better performance than digital. However, in practice, digital signal processing has sufficient performance for almost all robotic applications. When run at high speeds, the difference between the two processing methods is hardly noticeable, and digital processing has some very important benefits.
In practice, we use digital signals and digital processing for almost everything in robotics.
There are a few reasons for this, including that:
Although digital signals are are better for robotics, the real world is analog and always will be. To reduce the effect of noise, analog signals are turned into digital signals as soon as possible in the process.
For example, a traditional Force Torque Sensor uses resistance-based strain gages, which produce an analog signal. To reduce the influence of electrical noise, the analog signal is immediately converted to a digital signal before it is transmitted to the robotic system. However, even though the signal is only analog for a very short time, they are still affected by noise.
The sooner you can convert from an analog to a digital signal, the better. In contrast to traditional sensors, the Robotiq Force Torque Sensors use a unique type of capacitance sensor which uses AC voltages. The signal that they produce begins as a digital signal, which makes them highly noise-resistant.
Read our force sensor eBook to find out more about how these sensors work.
Do you have any questions about analog and digital I/O? What other fundamental robotics questions would you like answered? Tell us in the comments below or join the discussion on LinkedIn, Twitter, Facebook or the DoF professional robotics community.