Two controllers drive the same robot. Tune the PID by hand, train the network by trial and error, then stress both and see which one holds up. Pick a robot to start.
Tune the PID gains on the left until every requirement turns green. The stress tests are fixed for this problem.
| Scoreboard | PID | Network |
|---|
Use the playground to build intuition, the lecture notes to learn the math, and the MATLAB lab to collect real numbers. The same robots and controllers run in all three, so results match.
Lecture notesHow it works: equations of motion for all four robots, PID and cascade control, the neural network, training by evolution strategies, and results.14 pages · PDF Lab manualA 3-hour MATLAB lab: pre-lab questions, six parts with sample code and data tables, deliverables and a grading rubric.5 pages · PDF MATLAB codeAll four robots, PID and network controllers, training code, and six ready-to-run lab scripts.MATLAB R2019b or newer · no toolboxes · ZIPP = arai_params('arm'); % 'arm', 'segway', 'twolink' or 'drone'
cond = default_conditions(); % normal robot; try cond.payload = 2.5
trP = simulate_robot(P, make_pid([30 20 4]), cond); % PID: [Kp Ki Kd]
trN = simulate_robot(P, make_nn(pretrained_weights('arm')), cond); % trained network
plot_compare(P, {trP, trN}, {'PID', 'Network'});
print_metrics(P, {'PID', 'Network'}, [compute_metrics(P, trP), compute_metrics(P, trN)]);
% Train your own network by trial and error (a few minutes)
[p, loss] = train_es('arm', 300, 1, struct('pop', 12, 'eps', 2));
Tatoglu, A. (2026). PID vs. Neural Network: An interactive control playground [Software]. ARAI Lab, University of Hartford. https://autonomoussystems.net
The ARAI Lab at the University of Hartford builds legged robots, autonomous vehicles and AI controllers. Students from any engineering or computing major are welcome.