Vertical Profiler Simulator
A browser-based test bed for comparing profiler control strategies before spending limited pool time on tuning.
At a glance
Project Result
The simulator brings the profiler's force balance, actuator limits, sensor noise, and mission logic into one repeatable environment for controller comparisons.
- Models
- Buoyancy, weight, drag, and momentum
- Compares
- PID and state-based controllers
- Purpose
- Tune earlier; validate later in water
Original
Python Version
The original simulator is still available as a Python desktop tool. The web version below uses the same physics, but is rebuilt to run directly in the browser.
View Original RepoWeb Simulator
Start Sim
State
DESCEND 1
Depth
0.000 m
Velocity
0.000 m/s
Actuator
500 µs
Depth Plot
True, Measured, and Target Depth
Depth View
Hold: 0.0 s / 30.0 s
Velocity Plot
Velocity and Filtered Velocity
Actuator Plot
Command Over Time
Adaptive Trim Plot
Learned Neutral Correction
Positive trim means the controller has learned that it needs more depth command than the mechanical neutral.
Supporting Documents
This report compares the controllers tested for the profiler and explains why the final approach was selected.
Open Report PDFREADME
Project Notes
Overview
I made this simulator because tuning a vertical profiler in the pool is slow. A small code change can mean opening the enclosure, flashing the controller, resetting the ballast, and running the same mission again. It is also difficult to tell whether a bad run came from the controller, the mechanical setup, or an inconsistent starting condition.
The simulator gives me a repeatable place to try controller changes first. It is not a replacement for pool testing. I use it to rule out bad ideas and arrive at the pool with a smaller set of settings to test.
What is modeled
The model includes:
- profiler mass and displaced volume
- buoyancy-engine range
- actuator speed and limits
- water density
- quadratic drag
- depth-sensor noise
- target depth, tolerance, and hold time
Depth is positive downward. Weight pulls the profiler down, buoyancy pushes it up, and drag opposes its motion.
weight = mass × gravity
buoyancy = water density × gravity × displaced volume
drag = -0.5 × water density × drag coefficient × area × velocity × |velocity|
net force = weight - buoyancy + drag
The program divides net force by mass, updates velocity, and then updates depth. This is done once per simulation step.
acceleration = net force / mass
velocity = velocity + acceleration × dt
depth = depth + velocity × dt
Keeping velocity in the model matters. The profiler continues moving after the actuator changes direction, which is where most of the overshoot comes from.
Buoyancy engine
The actuator command is centered around its neutral position and converted to a value between -1 and 1. That value changes the simulated displaced volume.
command = (actuator position - neutral position) / half range
buoyancy change = command × maximum buoyancy change
I included actuator speed because the real syringe cannot move instantly. The model can also shift the neutral point to represent a ballast or assembly error. That test became important after the first profiler showed that a very small weight difference could change the way the controller behaved.
Controller testing
The web version includes PID, adaptive-trim PID, and state-based controllers. I watch depth, measured depth, velocity, actuator position, and target depth on the plots.
I normally start with the mechanical values, check the profiler’s uncontrolled motion, and then tune one part of the controller at a time. Once a setting looks reasonable, I repeat the run with sensor noise, a shifted neutral point, or a slower actuator. A controller that only works in the ideal setup is not useful on the physical profiler.
The simulator was also useful for comparing continuous PID control with simpler state-based approaches. It made the tradeoffs visible before we committed pool time to each option.
Mission behavior
The simulated pressure sensor reads true depth plus random noise. During a hold, the timer only advances while the measured depth is inside the selected tolerance. If the profiler leaves the band, the timer resets.
The water surface is a hard limit. If the calculated depth goes below zero, the profiler is returned to the surface and its upward velocity is cleared.
What I do not trust it to predict
The model is simplified. It assumes still water, one drag coefficient, a vertical body, and a direct relationship between actuator position and displaced volume. It does not include seal friction, cable forces, temperature effects, body angle, or detailed sensor behavior.
Because of that, I do not use it to predict an exact pool run. I use it to compare controllers and find obvious problems. Final tuning still comes from the assembled profiler and logged test data.