Projects

Libra, a new face for a balancing machine.

A dynamic balancing machine with undocumented software, no source code and years of job records. This is how we learned exactly what it does, proved it against its own history, and replaced what the operator sees without changing what it measures.

Libra's main screen on the balancing machine, with a dial and a large correction mass and angle for each plane.
1,531
past results recomputed to check our reading of the maths
97.4%
matched the figures the original had stored; the rest are explained
2017
the year the job records start, all kept in their original format
0
changes to Windows on the machine’s computer

01

The machine.

A dynamic balancing machine spins a rotor on two supports, measures the vibration at each, and reports how much mass to add or remove, and at what angle, on two correction planes. Get both planes inside tolerance and the part runs true at speed.

The machine in this workshop came with its own measuring software, written for an old version of Windows. It works, and it has years of the workshop’s jobs in it. It also has small type, pale readouts that are hard to read from where the operator stands, and actions that live in a menu bar of keyboard shortcuts. There was no manual for it, no source code, and nobody to ask.

Libra is a new operator interface for that machine. This is how it was made without touching the one thing the workshop relies on: the numbers.

The original balancing software: a pale blue window with two plane dials, small readouts and a menu bar of keyboard shortcuts.
The software the machine came with.

02

The rule: change nothing that measures.

A balancing machine is a measuring instrument. If a new screen changed a reading by a fraction of a gram, every part balanced on it afterwards would be in doubt. So the work started from a short list of things that were not allowed to change.

  • The measurementThe same signals, read the same way, through the same calculations.
  • The calibrationThe machine’s existing calibration, used as it stands. Libra never recalibrates anything on its own.
  • The recordsEvery rotor and every past job, kept in the original files and the original format, readable by both programs.
  • The originalLeft installed and one icon away, so the workshop can go back at any moment.
  • The computerThe machine’s PC is offline and does one job. Nothing is installed into Windows and no setting on it is changed.
  • The proofNo change reaches the workshop until the same change has been tried on a copy first.

03

Reading a program with no source.

You cannot safely put a new face on a program you do not understand. The first job was to learn what the original does, from the program itself.

It helped that the program was written in Delphi. A Delphi program carries a description of every one of its windows inside it, with each button, label and menu item named, along with the name of the routine each one calls. We wrote small tools to pull those out as text, map every name to its place in the code, and print the code beside the names it refers to. From there the program can be read one action at a time: press Run, and this is what happens.

  • The screensEvery window, recovered as text: what is on it, where, and what each control is called.
  • The actionsEach key and menu item traced to the routine it runs, then read through to the end.
  • The settingsDozens of numbered options, most undocumented. Each was matched to the place it is used, which is the only reliable way to learn what it means.
  • The filesThe rotor library, the job log and the settings file, decoded field by field so they could be read, checked and never damaged.

Reading it this way also turned up behaviour nobody had written down. The program restores its working files from its own backups at every start. One way of quitting also shuts the computer down, and another does not. A reading taken before balancing is thrown away whenever a rotor’s settings are opened. Each of those explained something operators had learned to work around.

04

From vibration to grams.

The work is split between two computers. A measuring board inside the machine listens to the two vibration sensors, follows the rotor’s speed, and filters out everything that is not happening once per turn. Many times a second it sends the PC the result: the speed, and for each support a vibration with a size and a direction. The PC does everything after that.

The messages between them were recorded and decoded until every one could be read, including the board’s own compact number format and the check that tells a good message from a damaged one. Then the path each reading takes through the program was followed from end to end.

  1. At speedA reading counts only while the rotor is inside a narrow window around its set speed.
  2. SteadyThe last few readings are compared. A sudden jump means the part changed, and the history starts again; otherwise the highest and lowest are dropped.
  3. AveragedWhat is left is averaged over the run, so the figure settles instead of flickering.
  4. CalibratedEach sensor’s sensitivity and timing are corrected for the current speed, read between the machine’s ten calibration stages.
  5. SeparatedThe two supports’ forces are resolved onto the two correction planes, using the rotor’s own dimensions.
  6. Grams and degreesEach plane’s unbalance becomes a mass at the correction radius, and an angle.

The last two steps are the textbook part. This is a hard-bearing machine: its supports are stiff, so the forces at them depend only on the unbalance and the geometry. Given where the supports and the correction planes sit along the rotor, the forces can be moved from one to the other with nothing more than a balance of moments.

Plane separation, as the machine does it
// F_L, F_R: calibrated force at the left and right support (size and direction)
// a, b, c:  plane and support spacing along the rotor, from the rotor's record
// R1, R2:   correction radius on each plane;  w: speed in radians a second

K   = (a * F_L - c * F_R) / b

U_L = F_L + K                    // left correction plane
U_R = F_R - K                    // right correction plane
S   = U_L + U_R                  // static unbalance

m_L = |U_L| / (w * w * R1)       // mass to correct, left
m_R = |U_R| / (w * w * R2)       // mass to correct, right
angle = direction of U           // where to put it

The program also has a second method for soft-bearing work, where trial masses are spun and the machine learns each rotor’s response instead of calculating it. It is switched off on this machine. We read it anyway, because a setting that exists is a setting somebody will one day turn on.

05

Checking it against the machine’s own past.

Understanding a calculation is a claim until it is tested. The machine had already supplied the test: its own log of finished jobs, each with the masses and angles it reported at the time.

We took 1,531 two-plane results from that log and recomputed the static unbalance for each, from the stored figures for the two planes and that rotor’s dimensions, using our reading of the maths. The answer matched what the original had stored in 97.4% of them. The rest were rotors whose dimensions had been edited after the job was run: the log keeps the result, but the library keeps only the current dimensions, so those could never have matched.

That check is why the rest of the project could be done with confidence. Whatever Libra shows, it is showing a figure we can account for.

06

A new face on the same engine.

Libra does not replace the original’s measuring code. It keeps it running, untouched, and replaces what the operator sees and presses. Every screen was rebuilt, and a small loader that sits beside the program draws the parts the old toolkit could not: the keys, the status blocks, the dials’ surroundings, the type.

The loader lives in the program’s own folder and is used only by it. Its typeface is loaded privately for the one program. Nothing is registered with Windows, and removing the folder removes all of it.

Libra's main screen: speed, run status and job details across the top, a dial for each correction plane, and the correction mass and angle for each plane in large type.
Libra on the same machine, showing the same measurement.
  • Readable from the rotorThe correction for each plane is the largest thing on the screen, because the operator reads it from the machine, not from the desk.
  • Colour means one thingGreen is inside tolerance and red is outside it. Nothing else on the screen is allowed to be either.
  • One key, one labelRun, Stop, Rotor, Settings, Records and Calibrate sit in one row along the foot, each with its key printed on it.
  • Opens stoppedThe original starts measuring the moment it opens. Libra opens stopped, on a pre-start safety sheet, and waits to be told.
  • Settings you can findThe numbered options are grouped by what they are for, in plain words, and options this machine cannot use are not shown.
  • The before reading staysThe reading taken before balancing is now kept until the job changes, so it is still there when the report is printed.

07

The report.

Every balanced part can leave with a printed report. The original’s was a plain grid of the same numbers. Libra’s puts the result first, then the setup, then the readings before and after balancing against the tolerance, with the two planes drawn below.

It is built from the same stored record as the original report, so the two always agree. The printing was tested the way the screens were: printed to a file on the test bench, rendered, and compared, before a sheet of paper was used.

A Libra balancing report: the job and rotor, the result Qualified, the rotor's setup dimensions, a table of tolerance and the readings before and after balancing for the left plane, right plane and static, and a polar plot for each plane.
A report from the test bench.

08

A bench that is not the workshop.

The machine earns its keep every day, so it could not be the place where anything was tried. We built a copy of its computer instead: the same version of Windows, at the same screen size, running the same program against a copy of the same records.

Every change is made there first, and the screens in this write-up come from it. A mistake on the bench costs a restart. The same mistake at the machine costs a day’s work, or a part.

09

Installing on a computer that is offline.

The machine’s PC has no network and none of the tools a modern installer expects. Libra arrives on a USB stick and installs with one double-click, using only what that version of Windows already has.

The installer keeps a clean copy of the original first. Afterwards the machine opens to Libra, and a second icon opens the original, both on the same records. Going back takes one click and loses nothing.

10

What it is not.

  • Not a new balancing engineThe measuring, the calibration and the calculations are the original’s. Libra shows them; it does not redo them.
  • Not for every machineIt is built for one machine and one version of its software. Another model would need the same reading done again.
  • Not a recalibrationIf the machine needs calibrating, it is calibrated the way it always was. Libra shows the steps and stays out of the result.
  • Not finishedIt is in use at the machine and still being refined, one screen at a time, with the people who use it.