Do Control and Automation Engineers ever code?

Click For Summary

Discussion Overview

The discussion revolves around the coding practices of Control and Automation Engineers, particularly in relation to programming languages such as C/C++, Python, and assembly. Participants explore the types of programming these engineers engage in, including microcontroller programming and PLC (Programmable Logic Controller) programming, as well as the relevance of coding in fields like robotics and embedded control systems.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • Some participants note that many engineers outside of software engineering primarily use Matlab and Excel, with limited exposure to traditional programming languages.
  • One participant mentions working with servo motor drives/controllers, emphasizing the use of assembly code for performance-critical applications.
  • Another participant shares experiences from a mechatronics course, highlighting the use of both assembly and C for microcontroller programming, and mentions the accessibility of PLC programming for engineers.
  • A participant compares PLC coding to programming an Arduino, noting the standardized programming environment and various languages available under IEC 61131.
  • Some participants express that C is rarely used for control systems application programming, except in specific cases where speed is a concern, such as writing protocol drivers.
  • There is a discussion about the environmental challenges faced in industrial applications, which may limit the use of hobbyist microcontrollers like Raspberry Pi or Arduino.
  • Participants express curiosity about the role of programming in embedded control systems and robotics, with some suggesting that programming may be incidental to the overall job responsibilities.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the extent to which Control and Automation Engineers code, with differing views on the relevance and frequency of programming in their roles. There are multiple competing perspectives regarding the programming languages used and the nature of the tasks involved.

Contextual Notes

Participants highlight various programming environments and languages, but there are limitations in the discussion regarding the specific contexts in which different programming practices are applied. The discussion also reflects a range of experiences and job roles within the field, which may influence individual perspectives on coding.

Who May Find This Useful

This discussion may be of interest to students and professionals in engineering fields, particularly those considering careers in Control and Automation Engineering, robotics, or embedded systems, as well as those curious about the programming aspects of these roles.

ramzerimar
Messages
178
Reaction score
23
From what I've seen, most engineers - outside software engineers - work with Matlab and spreadsheets like Excel. I don't know how to code in Matlab yet, so I'm not sure about how different it is from traditional programming languages like C/C++.
I'm more interested in Control Engineers - and Automation, people who work with robotics, for instance. Do they ever code with C/C++ or python, or need to program things like microcontrollers? If not, what is the kind of programming they most likely do?
 
Physics news on Phys.org
ramzerimar said:
Do they ever code with C/C++ or python, or need to program things like microcontrollers? If not, what is the kind of programming they most likely do?
It depends on which jobs you are seeking ( of course ).

I've been working a lot with ( built in ) servo motor drives/controllers, something like this: http://www.animatics.com/

Besides the design of hardware, you are programming in assembly code, because it must be executed as fast as possible and you must keep track of the clock cycles to be used for a task: Every lost clock cycle = decrease of the control quality. No unnecessary delay time in the control loops, due to slow calculation. Maybe you will have to control the phase currents in a three phase synchronous servo motor, each with a sample frequency = 15 kHz. And that is just one of many tasks, e.g. speed loops, position loops, calculation of winding temperature, etc.

Other types of jobs include programming PLC's with their own specific programming language.
 
Last edited:
Well, in one mechatronics course that I took (and that is why I had asked about the availability of a mechatronics program at your school), we programmed microcontrollers in both assembly and in C. I was surprised about using C, but I learned that is also a common language available for micro controllers (free language anyway).
.
More assessable for the average engineer working in plant automation is the PLC. There are several major brands available, all with a similar PLC ladder logic type programming language. I believe Allen-Bradley has a small micro controller available for less than $100 and provides free software for programming it if you want to learn about PLCs (might actually be called a programmable relay as it is much less capable than a full blow PLC). Another company that sells budget PLCs is Automation Direct.
.
I am sure both have fairly good documentation available for you to determine if you want to delve into this type of work.
 
  • Like
Likes   Reactions: JakeBrodskyPE
CalcNerd said:
Well, in one mechatronics course that I took (and that is why I had asked about the availability of a mechatronics program at your school), we programmed microcontrollers in both assembly and in C. I was surprised about using C, but I learned that is also a common language available for micro controllers (free language anyway).
.
More assessable for the average engineer working in plant automation is the PLC. There are several major brands available, all with a similar PLC ladder logic type programming language. I believe Allen-Bradley has a small micro controller available for less than $100 and provides free software for programming it if you want to learn about PLCs (might actually be called a programmable relay as it is much less capable than a full blow PLC). Another company that sells budget PLCs is Automation Direct.
.
I am sure both have fairly good documentation available for you to determine if you want to delve into this type of work.
That's interesting. Is programming a PLC much different from C programming?

I like coding, and I would like to find some field in Mechanical Enginering where it is really used. Controls and Automation comes to mind, but I've searched quite a bit about Computational Mechanics (like Computational Fluid Dynamics). I don't know much about this area. Do engineers working in this area code as well?
 
In 30 years, I've written my share of PLC code. Older versions are very much like the predecessor to the PLC: The physical ladder of control relays. Yes,I worked with one of those once, too.

I liken PLC coding to the experience you'd get if you programmed an Arduino processor on a much larger scale. It has start code that then drops you into a continuous loop of code that never ends until you stop the processor. The only difference is that these days we have a standardized programming environment, the notorious IEC 611131 and its languages. There are text scripting, relay ladder-ish, Function Block, and something that looks disturbingly like assembly language interfaces in this environment.

We do not use C for control systems application programming except in those very very few cases where speed is an issue. I have used C to write protocol drivers.

As a Control Systems Engineer, I design entire processes as well. I select instruments, controllers, valve actuators, valves. I select materials, wiring standards (some environments require very detailed electrical standards to reduce the likelihood of an explosion), networks, switches, firewalls, and the like.

I'm an industrial jack of many trades. Because of where I work I also have to live with my designs. I go on 24 hour for a week about four to six times a year. The Operators all know my phone numbers. If one of my creations screws up, they won't be shy about calling me. This also breeds a certain degree of humility and honesty over what the design should or shouldn't have.

I recommend this field highly.
 
JakeBrodskyPE said:
We do not use C for control systems application programming except in those very very few cases where speed is an issue. I have used C to write protocol drivers.
What are protocol drivers? And C is used for microcontroller programming, isn't it? Have you ever programmed one of those?

I wonder about Embedded Control Systems too. Robotics, also, looks like a field where programming skills are of real value.
 
ramzerimar said:
What are protocol drivers?
Before the Open platforms were commonplace, there were many proprietary communications protocols, particularly for SCADA (Supervisory Control And Data Acquisition) systems. We had a lot of field devices with a relatively arcane protocol by today's standards. Nobody had written device drivers for that protocol, so I wrote one. It had to do things in a standard Application Program Interface, so that objects on the screen could send messages to the field and read back the results.

Today, we have many standard SCADA protocols such as DNP3, ModbusTCP (not really a SCADA protocol but people abuse it that way anyhow), IEC 60870 series, as well as a few proprietary ones that people continue to use such as Conitel 2020.

ramzerimar said:
And C is used for microcontroller programming, isn't it? Have you ever programmed one of those?
Yes, for fun and curiousity, but not for industrial applications. Those cute little hobby boards are great in an indoor environment, but we have wide temperature ranges and severe environmental hazards that we need to work with. We expect our equipment to work from -40 C to +60 C. They're installed in steel boxes mounted outside on a concrete pad. The temperature range in that box is pretty much the same as you'd get inside a car with the windows closed. In the heat of summer or the dead cold of winter. We also expect the inputs to have lots of surge and noise protection. We expect galvanic isolation in certain places so as to limit damage due to a nearby or direct lightning strike. A commonplace Raspberry Pi or an Arduino is not the sort of thing I would put out there. Remember the equipment itself is dirt cheap compared to what it costs to get someone out of bed, and send him down the road to fix something that isn't working.
ramzerimar said:
I wonder about Embedded Control Systems too. Robotics, also, looks like a field where programming skills are of real value.

Yes, but programming is almost incidental to the job. If you are under the impression that this is all about writing routines and data structures for a real time application, think again. You have to know about hydraulics, limit switch cycles, position indicator hysteresis, and the physics of moving an arm accurately and quickly from one place to another and so much more. You also have to know what you're assembling, and what production rates are expected. You have to think about how you're going to help ensure quality and accuracy in the product.

The programming takes maybe 15% of your time. The remainder is everything else.
 
JakeBrodskyPE said:
Yes, but programming is almost incidental to the job. If you are under the impression that this is all about writing routines and data structures for a real time application, think again. You have to know about hydraulics, limit switch cycles, position indicator hysteresis, and the physics of moving an arm accurately and quickly from one place to another and so much more. You also have to know what you're assembling, and what production rates are expected. You have to think about how you're going to help ensure quality and accuracy in the product.
So, robotics usually requires more or less programming skills then industry control engineering in general?

Also in robotics, wouldn't companies have specialized programmers or software engineers to write code, instead of a control and automation engineer?
 
Both. Certainly there are lots of software engineers but almost every engineer writes at least some code. I'm an EE and I write test code to evaluate my designs and interfacing with my simulators is through code and scripting.
 
  • Like
Likes   Reactions: ramzerimar
  • #10
analogdesign said:
Both. Certainly there are lots of software engineers but almost every engineer writes at least some code. I'm an EE and I write test code to evaluate my designs and interfacing with my simulators is through code and scripting.
That's interesting. What do you work with? And what programming languages do you use the most?
 
  • #11
ramzerimar said:
That's interesting. What do you work with? And what programming languages do you use the most?

I'm a hardware engineer so I'm not an expert in any language. Our main tools are made my a company called Cadence and they are scripted using a custom language called SKILL which is based on LISP. All my test software is in Python.

I also do a lot of simulation software in Verilog. I use Verilog so it is easy to interface with our hardware simulations.

I also use MATLAB now and then but not that much. I find Python almost as useful and it's free.
 
  • Like
Likes   Reactions: ramzerimar
  • #12
analogdesign said:
I also use MATLAB now and then but not that much. I find Python almost as useful and it's free.
I intend to learn Python soon. Do you have any books or sources to recommend concerning Python programming for engineers? It would be helpful.

Also, about simulation software: Is Verilog a simulation software, or you code simulation software using Verilog?
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
3K
Replies
40
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 13 ·
Replies
13
Views
6K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 4 ·
Replies
4
Views
5K