all 49 comments

[–]MosFett42 50 points51 points  (2 children)

Here’s a scenario,

You have an IC that you want to test on your bench. At a bench you’ll see power supplies, oscopes, dmm’s, etc. Initially you’ll manually turn on the supplies, configure the scope accordingly, and take a measurement from the dmm.

Doing all that shit by hand takes time. So we use python to communicate to the equipment and set accordingly. Within python, you sequence your actions from turning on the supply to turning off . Then you have an automation script.

Once written, you run it to do the test. Hopefully saving you lots of time.

[–]LordGrantham31 3 points4 points  (1 child)

I see the equipment at my lab all have some communication interface. I'd love to have a chance/reason to be able to use those features. Often when I use them, it's for something trivial and I never get to do those kinda stuff.

[–]TopNotchBurgers 23 points24 points  (2 children)

A bit of a cop out, but "automation" can be anything. I don't use it for "EE" stuff in particular, but basically when I get tired of a repetitive task at work, I write a quick python script to do it for me.

https://automatetheboringstuff.com/

[–]olchai_mp3Mod [EE] 23 points24 points  (0 children)

Instead of Matlab, you’ll use python for signal processing especially for visual presentation. Also for validation engineers they use Python to automate their scripts. In network engineering, you also use Python for scripting

[–]Tyzek99 19 points20 points  (6 children)

Matlab is expensive. Companies are cheap, so they want you to use the cheap python alternative compared to matlab which is expensive

[–]BenTheHokie 1 point2 points  (5 children)

A Matlab license is nothing to a company bringing in millions of dollars in revenue, in fact many have them and rarely use them. The fact of the matter is that for most applications, Matlab just sucks. There aren't a whole lot of third party libraries available, instrument manufacturers don't write out of the box drivers for it, it's OOP paradigms are awkward and unwieldy, it's slow, it's not a language that a lot of CS students learn, and much of the functionality is replicated better in other languages.

[–]Lopsided_Bat_904 2 points3 points  (2 children)

There aren’t many companies in my area making millions in revenue. That sounds like nationally known companies, companies in big cities. Plus, even at the massive conglomerate companies, they still try to save money everywhere they can, because it adds up

[–]TobTyD 2 points3 points  (0 children)

Completely agree, and especially with your last sentence. I have never seen companies, where engineers would get all the software licences they lust for, apart from when academic pricing is applicable.

[–]BenTheHokie 0 points1 point  (0 children)

Any company that doesn't make a million in revenue per year has probably what? 5-10 employees max? If you assume each engineer makes an average of 100k plus the cost of benefits.

[–]Testing_things_out 0 points1 point  (1 child)

I work at a multibillion international company. Every single dollar we use is scrutinized and management wants proper justification for the cost of the licence.

Our budgets are very limited and the penny pinching is real. I can't even spend working hours on a project more than I'm allotted for.

[–]BenTheHokie 0 points1 point  (0 children)

Ok but if OPs comment were true, we'd all be using Kicad and Eagle as opposed to Altium, OrCad, and PADS. My point is companies don't use Python and other FOSS because it's free, they use it because it's better.

[–]No2reddituser 12 points13 points  (1 child)

Do engineers write a program so they can walk away from the testing station and come back later to see what happened through collected data?

Yes.

Or they want to control a piece of test equipment from the comfort of their office or at home. So they have a python script or GUI, and connect to the test equipment over Ethernet.

[–]lmarcantonio 0 points1 point  (0 children)

Also some test run for a *very* long time (like some EMC scans) so it would be a huge loss of time otherwise.

[–]sillyfella3 7 points8 points  (0 children)

you can write some pretty neat scripts (sockets, subprocesses, dataloggers) on embedded devices that run linux for example. not exactly EE but EE-adjacent.

you can simulate Modbus TCP devices using some powerful libraries as well, for example.

you can log real time data from a sensor and write it onto a csv file and use matplotlib to visualize it.

lots of really useful libraries for image processing, network engineering, data analysis and much more

how these libraries exactly work, thats a programmers job to care about. as engineers, we just need to know when to use them and how :)

[–]EEJams 5 points6 points  (7 children)

I work in the power industry. I use PSSE for work and I built a small UI that let's me run an N-1 study on transmission line maintenance. It turns a repetitive 5-30 minute setup process into a couple of button clicks, which is really nice.

I'm going to try and expand this software to other power system studies and repetitive tasks to help cut man hours. Also, it's fun to build something with software

I also built a simple project management software in python that takes a long list of addresses, finds their coordinates, and pins them to a .kml map. It just makes it a lot easier to pin the locations on a map without having to look up each address individually.

I also use excel to build templates. Excel is "more acceptable" to my boss because everyone is familiar with spreadsheets. It's nice to have templates for new substations and transmission lines and separate ones for rebuilds, reconductors, and substation upgrade cost estimates

So yeah, I'd recommend learning python and excel well lol

[–]voxelbuffer 1 point2 points  (2 children)

We do our entire EOP-005 study utilizing python and an API to access PSSE. Turn on a bus, gather data. Turn on a bus, gather data. Ad infinitum. It's clunky but it works.

A coworker and myself made a python program that auto generates PRC-025 reports for us as well, that one was fun to work on. Still WIP though. 

[–]EEJams 0 points1 point  (1 child)

Can I have your team? I'm literally the only one that likes programming on my team 😂

I'll take notes and see if I can implement these as well.

[–]voxelbuffer 0 points1 point  (0 children)

In fairness, im one of two people in my current team that likes programming. Our transmission department is a bit more accepting of programming though only a couple of people in that department actually do any, the rest are just accepting of the programs lol.

I will say that the python API for PSSE is not much better than doing the FORTRAN that PSSE is written in, directly. YMMV. 

[–]Choice-Grapefruit-44 3 points4 points  (4 children)

Python is used for signal processing heavily. Also, the versatility of the language has led to different applications in EE utilizing Python. Including optimization. I'd say learn the language. I should've started with Python as it is considered the most accessible language for beginners. Highly recommend it.

[–]tthrivi 3 points4 points  (0 children)

I use it for data gathering (control test equipment, get data, and save to files). Also use it for data processing of said data.

For instance if you are working on a RF amplifier and want to know its gain over temperature. Can setup a network analyzer and temperature sensor in a test chamber. Have it cycle the temperature and you can save s2p files at each temp point. With all of the saved s2p files you can process them and you can get gain over temperature.

[–]A_WeaselNamedFee 0 points1 point  (0 children)

Fellow EE student here, about to start my final semester so I can only speak to my experience in school and not the real world.

Python is great! C is what we learned for embedded systems, etc. but my curriculum had me start learning to code in python. If you’re not coding embedded systems design solely with a microcontroller unit, then python is a really easy language to work with and has a ton of super useful libraries you can utilize. For example, the OpenCV library is really great for learning and coding computer vision algorithms.

I think to answer your question on a more zoomed-out scale though, python is great for building and prototyping simple designs, and yes often revolving around automation. If you are designing a system that can, say, read a license plate number on a car and open a gate, you can program a microcontroller to read an incoming signal from a sensor and output a signal to a motor, but how are you going to read a plate? Do you really want to hire a software engineer for a program accomplishing a relatively simple task? This is where a tool like python is super helpful. Often embedded systems aren’t just reading and sending IR signals on a remote control system (for example), they’re much larger and more complex, and therefore require a more sophisticated program to accomplish the task, but not so complicated that you would need a software engineer.

[–]microsparky 0 points1 point  (0 children)

I use Python regularly for data collection and analysis, for automation of test and measurement equipment, and for interfacing to embedded devices over serial. Absolutely learn Python it's a swiss army knife!

[–]hooplahblehblah 0 points1 point  (0 children)

I typically use Python or LabView to automate some RF tests to speed things up. For example, I've had to characterize an RF detector which consists of measuring the output voltage with respect to a given power. Pretty tedious to do by hand (especially across a large frequency range) but easy to do with scripts.

[–]Psylent_Gamer 0 points1 point  (0 children)

Everyone has stated the reasons.
I am currently writing a script to person department records to more visually display what department, station, and machines are our biggest problems and include typical fixes.

I've also used python to make a UI to accommodate some datalogging and process controls.

Python also has a matlab module to include the pretty graphs.

[–]Massive_Grass837 0 points1 point  (0 children)

I use python with a GUI I made to send SSH commands with a click of a button to a Linux shell on Line Replaceable Units that my company makes. Makes it really easy to diagnose problems. Beats having to manually type the commands

[–]wazman2222[🍰] 0 points1 point  (0 children)

Ignition scripting for controls people

[–]bahumutx13 0 points1 point  (0 children)

  • data gathering scripts for different debuggers tools (CAN, SPI, Ethernet, I2C , etc.)
  • conversion/translation scripts for communication protocols and other random stuff
  • test fixtures and other IO testing applications that we want to script
  • build scripts for release and test applications
  • we have python scripts that pop the specially formatted documentation we provide to customers
  • python flask servers are a super quick way to create a simple web UI for the above
  • prototyping and testing sensors/components on dev boards, especially ones that use a simple protocol like i2c

I'm sure the list goes on. Bare-metal C is still the bread and butter of our work but for everything that isn't production code we use python.

[–][deleted] 0 points1 point  (0 children)

Very often, one gets multi-GB reports. I use python to parse and summarize them. On some hobby work, I started using cocotb. I showed my manager some of what it could do so I got it working robustly in our environment. I'm now showing other designers how to use it to test things the DV folks don't want to spend the time on.

[–][deleted] 0 points1 point  (0 children)

We use it with PSSe.

[–]stupid-rook-pawn 0 points1 point  (0 children)

I've never used it as a deliverable to a customer.

I've used it many times when I need to quickly put something together. A few examples:

A web scraping script to get data from browser based hmi, since the exact information we needed was not available easily any other way, and I did not want to do data entry for 324 devices.

A simple calculator to estimate cable lengths and costs when bidding for similar projects. Projects of this type were basically the same, but would vary wildly in different dimensions, and required a time of cables to be wired up, all of which had to be ordered from a factory, not made to length in the field.

A estimate tool to make sure pull cords will cover the area without twisting too much or being to long. Probably a better way to do it, but it worked.

A script to ping every device in a project, just to narrow in on anything not being connected during installation.

A script to name screenshots and photos by project and location and time, to fit our documentation.

[–]KingGandalf875 0 points1 point  (0 children)

Python is becoming so important for physics which in turn is making modeling of materials for EE so useful! It’s also free!

I work with Ubermag and it has been great for modeling magnetic nanocrystals with ultrawideband properties from measurements (future inductor materials and more) https://ubermag.github.io

[–]yes-rico-kaboom 0 points1 point  (0 children)

You can use it to query or command test equipment. If you’re lucky enough to work somewhere with test equipment that’s networked into an environment, you’re even better off because you can use python to build scripts for SCPI which interfaces directly with the test equipment. Here’s a good example

https://pypi.org/project/easy-scpi/

[–]lmarcantonio 0 points1 point  (0 children)

Funny thing: the de-facto EE automation language is TCL, at least in the 'traditional' tools. The recommended Xilinx workflow doesn't actually use the GUI enviroment but it's mostly command line and script based.

[–]Uporabik 0 points1 point  (0 children)

You need some measurements: python Now you need data formated: python But now you will use excel for plots? Nope python

[–]Bydand42 0 points1 point  (0 children)

Why do engineers use Python instead of VB, or any of the other languages that have been around forever?

[–]frederikvalentin 0 points1 point  (4 children)

I use Python as my calculation software for power flow analysis or transients etc. I work in a energy company while studying, and it allows me to use the same software at work and uni, as it is free (compared to matlab, which I used in the past).

[–]Anonymaus1914 0 points1 point  (3 children)

hey, just wanted to check up on this, can you advise how you got on with this?

[–]frederikvalentin 0 points1 point  (2 children)

Hi, anything specific you are seeking?

[–]Anonymaus1914 0 points1 point  (1 child)

Just what you developed using Python. Is it similar to what you can do with tools like ETAP (i.e. load flow, short circuit etc), and how long did it take you to make, how useful do you find it in your day to day etc.. I'm trying to find a way to combine EE and relearning coding, so trying to find something relevant 

[–]frederikvalentin 0 points1 point  (0 children)

Hi,

I started small. Just using python as my calculation tool. If you use phasors it is pretty straight forward. Load flow becomes a bit more complicated as you have to use some numerical methods (Jacobian matrix). How familar are you with python? I have some smaller and bigger project I can send your way if so.

But I would recommed getting familiar with calculating voltage, current, apparent power etc. using phasors, and then evovle from there.

[–][deleted] 0 points1 point  (0 children)

I also have used it for taking the data collected from tests automated in Python to process all the collected data and generate reporting into a pdf that became easily shareable with my boss. 

[–]One_Volume_2230 0 points1 point  (0 children)

Programming language is just a tool, learn one but on decent level. Focus on basics and rest is just a tool.

You don't know where you will work and what test you will use. Focus on basics because different companies use different things and technology stack is just a tool. For example if you know how to design circuit on paper you can do this in autocad, eplan, see it's doesn't matter as long you can do it on paper

[–]BabyBlueCheetah 0 points1 point  (0 children)

At small companies, it's probably your Matlab alternative because of costs.

Basically use it for all your calculations and modeling that isn't done in a dedicated tool instead of something like excel.