Back to portfolio

02 Sep 2026 · 5 min read

The 4 Domains of Robotics Engineering, and My Views On Each

Mechanical, electrical, electronics, software, in that order, each standing on the one below. Which is why your software bug is usually a loose screw.

Every robotics project I have worked on is built out of four layers, and they stack in a fixed order. Mechanical at the bottom. Then electrical. Then electronics. Then software on top.

This is not a project plan or a team structure. It is a dependency hierarchy, and it has one consequence that costs people months: a fault at any level is guaranteed to express itself as a fault at every level above it.

The four layers

  • Mechanical: structure, linkages, tolerances, load paths. What physically holds and what physically moves.
  • Electrical: power. Supply, current capacity, grounding, distribution. The unglamorous layer that everyone skips past.
  • Electronics: signal. Microcontrollers, drivers, sensors, buses. Where intent becomes voltage and voltage becomes measurement.
  • Software: logic. Control loops, scheduling, decision-making. The layer that gets all the credit and almost none of the blame it deserves.

Faults travel upward only

This is the whole argument, so I will state it plainly. If the electronics are faulty, the software is bound to be non-performing. There is no version of a correct control loop that rescues a microcontroller browning out under load. The software was never wrong. It was reporting the truth about a layer beneath it.

The layer where a problem appears is almost never the layer where it lives.

The reverse never happens. A clean mechanical assembly does not develop play because of a bug. Causality here runs strictly upward, which means diagnosis has to run strictly downward, and almost nobody does that, because the top layer is where the error message is and the bottom layer requires getting up and finding a spanner.

What this looks like in practice

On Anushka, a joint began overshooting its target position and oscillating before settling. The obvious reading is a control problem. We spent real time retuning gains. Every retune made it slightly better and never fixed it.

The actual cause was mechanical backlash in the linkage. A few degrees of slop meant the joint physically did not go where the controller commanded, so the loop corrected, overshot into the slop from the other side, and corrected again. Perfect software, faithfully compensating for a gap that no gain value can close.

Two layers down from where the symptom appeared. And every hour spent on the control loop was not merely wasted. It was actively harmful, because it produced small apparent improvements that kept confirming the wrong hypothesis.

The discipline this implies

When something misbehaves, the question is not 'what is wrong with this layer'. It is 'what is the lowest layer that could produce this symptom'. Then start there and work up.

Practically, for me, that means: measure the supply rail under actual load before touching the firmware. Move the joint by hand and feel for play before opening the controller. Scope the signal before reading the code.

It is slower to start and dramatically faster to finish. The instinct to debug where the error appeared is the single most expensive habit in this field.

Piyush Khanna at his desk
Where the top layer gets debugged. The bottom three usually need a spanner.

Or, the version I say out loud more often: you cannot write your way out of a loose screw.

© 2026 Piyush Khanna