Manuscript Offprint
arXiv:2611.12378Safety-Constrained Intelligent Control of a 2-DOF Robotic Manipulator Using Control Barrier Functions
Gabriel da Silva Lima¹, Made Widhi Surya Atman², and Wallace Moreira Bessa¹
Abstract— Control barrier function (CBF) filters depend on dynamic models that can be inaccurate when their parameters and external forces are uncertain. This paper investigates a radial basis function (RBF) neural network compensator whose output is shared by a Cartesian tracking controller and a joint-space CBF filter. An auxiliary state driven by the difference between requested and applied torques corrects the learning signal, reducing the direct influence of filter intervention on adaptation. A two-link manipulator is evaluated through constrained regulation, ablations, matched uncertainty and disturbance trials, and operating-range and timing studies. The results demonstrate that the proposed controller improves tracking while maintaining joint, velocity, and torque limits under parameter uncertainty, and that both the shared compensation and the auxiliary correction contribute to this improvement.
I. INTRODUCTION
Robotic manipulators must track motions within joint, velocity, and actuator limits. Model-based control tracks accurately, but inertia errors and unmodeled forces corrupt both the tracking law and the constraint prediction. A control barrier function (CBF) filter offers a convenient way to modify a requested input through a quadratic program (QP) [1]. Position constraints require a higher-relative-degree construction, while joint-velocity constraints depend directly on acceleration [2]. Both constructions remain sensitive to errors in the assumed dynamics.
Neural compensation has been demonstrated in intelligent controllers. Lima et al. combine sliding mode control and online neural adaptation for a single-link flexible manipulator [3]. Alwala et al. integrate an intelligent controller with an RBF neural compensator with EKF-based multisensor fusion for differential-drive robots with unmodeled dynamics [4]. These works show that online neural compensation is effective.
CBFs also support robot navigation and coordination: Keyumarsi et al. synthesize barrier functions online from LiDAR data using Gaussian processes [5], and Pham et al. combine distributed QPs and CBFs for formation control with rigid and elastic edges and obstacle avoidance [6]. Here, the joint-limit geometry is known; uncertainty affects the dynamics used to predict constraint evolution.
Robust CBFs and input-to-state safety tolerate bounded model error through constraint margins [7], [8]. Adaptive CBFs couple parameter estimation and safety conditions [9],
[10], and learning-based approaches estimate the residual that enters the barrier condition [11]. Wang et al. combine neural estimation with augmented high-order CBFs and auxiliary systems that adjust barrier conditions for constrained robotic tracking [12]. Sweatland et al. use adaptive neural identification and an estimation-error bound to formulate CBF constraints [13]. We examine how an online neural network compensator interacts with a filter when both use an incomplete model.
Two issues arise when the controller and the filter share an incomplete model. First, compensating only the tracking controller leaves the filter unaware of the learned correction, so the two components may request incompatible accelerations. Second, a tracking-driven adaptation law can react to error generated by deliberate filter intervention. We investigate a shared RBF correction and an auxiliary state that accounts for the nominal Cartesian effect of the torque modification. Although pseudo-control hedging can remove the effect of actuator limits from the signal seen by an adaptive law [14], compensated tracking errors can play the same role in command-filtered backstepping [15], and auxiliary systems driven by the saturation error are standard in adaptive neural control under input constraints [16], these designs treat the gap between commanded and applied inputs as an intentional deviation that should not be learned. In this work, we apply this principle to CBF intervention, which, unlike saturation, depends on the state, the barrier rates, and the learned term itself. The auxiliary state corrects only the adaptation signal; it does not adjust the barrier functions or restore feasibility.
Overall, the main contributions of this paper are as follows:
i. We adapt the learning input signal to CBF intervention: an auxiliary state removes the nominal effect of the filter's torque modification from the signal used to train an RBF compensator shared by the tracking controller and the CBF filter.
ii. We relate the corrected signal to the joint-acceleration residual that the filter must bound, and show that this residual is driven mainly by the transient error of the shared correction rather than by model uncertainty.
iii. We isolate the effects of sharing the RBF output and of correcting its learning signal through matched ablations under fixed tuning.
iv. We evaluate tracking performance, observed constraint satisfaction, residual-bound validity, QP feasibility, and computation time as separate outcomes, over 172 simulations including uncertainty, disturbance, and operating-range studies.
¹G. S. Lima and W. M. Bessa are with the Smart Systems Lab, University of Turku, 20520 Turku, Finland (e-mail: gdasil@utu.fi, wmobes@utu.fi). ²M. W. S. Atman is with the Department of Computing, University of Turku, 20520 Turku, Finland (e-mail: widhi.atman@utu.fi).
II. MANIPULATOR MODEL AND CONTROL OBJECTIVE
Let , , and denote joint position, velocity, and torque. The planar manipulator satisfies
Gravity is absent from the implemented dynamics. With link lengths , center-of-mass distances , masses , and inertias , its inertia matrix is
(2)
Writing , the implemented velocity-dependent term and unmodeled forces are
(3)
Here is the Jacobian of
Kinematic parameters and joint states are available to the controller. The estimated model uses and with uncertain masses and inertias and omits .
The objective is regulation to a feasible constant Cartesian target subject to componentwise bounds
Define , , and diagonal. All experiments use a fixed target. Singularity avoidance is not implemented; the pseudoinverse is used numerically, and the cancellation below assumes nonsingular .
A. Control law
Let be a Cartesian acceleration correction. The requested torque is
The filter returns , and denotes its intervention. With , introduce the continuous-time auxiliary interpretation
To explain this choice without assuming that the neural estimate is exact, define the actual Cartesian model mismatch at the applied torque by
For nonsingular J, substitution into the plant gives
(9)
Thus, the explicit nominal effect of the filter disappears from the corrected signal dynamics.
Following [3], the RBF network for each Cartesian component takes the corrected signal as input and uses Gaussian basis functions:
The learning rule for the RBF weights is defined as follows [3]:
where and the original projection-style map is retained. Let denote or the conjunction and . Then
B. CBF inequalities with an incomplete model
The same learned output is mapped into the joint-acceleration prediction:
Let be the acceleration residual. Constants represent the assumed componentwise bounds . For and , an exponential (second-order) barrier construction [2], [17] with positive rates , tightened by as in robust CBFs [7], yields
(14)
The first-order velocity conditions, with rates , are
(15)
The applied torque solves the strictly convex two-variable QP
with . There are no slack variables or fallback inputs; a failed QP terminates the numerical run.
C. Conditional safety interpretation
If the residual bound holds continuously at the applied input, the constraints above imply their corresponding inequalities for the true acceleration. For example, . Defining gives . Nonnegative initial values of and then imply by successive comparison arguments. The upper-position and velocity cases follow analogously. This standard argument [2] also requires existing solutions, feasibility, and admissible initial values of .
These conditions are not established by the present implementation. The QP is solved every , its torque is held between updates, and no intersample robustness margin is included. Sampled-data invariance needs additional conditions [18]. Furthermore, an empirical residual diagnostic
can falsify an assumed bound when , but on one trajectory cannot certify it uniformly. We therefore report task error, observed constraint satisfaction, and residual-bound satisfaction as distinct outcomes.
At a nonsingular configuration, from (8) and (13) we can calculate the residual r by
D. Lyapunov stability analysis
Consider Equation (11), with , and let be the th diagonal entry of . Assume that, on a compact set containing the closed-loop trajectory, is nonsingular, the QP (16) is feasible, and there exist with and such that
With , the th row of (9) becomes . Consider
Since , the terms cancel and
The last term vanishes when holds. Otherwise and , so , because . Projection also keeps , so . Hence
Thus and remain bounded, and integrating (22) gives
so the mean-square corrected error is ultimately bounded by . If , then with bounded on , and Barbalat's lemma gives .
IV. NUMERICAL PROTOCOL
The physical parameters are m, m, kg, and , as implemented. The default estimated masses and inertias are 80% of these values. Unmodeled force coefficients are and N m s/rad. Initially, rad, , and all weights are zero. The target is m.
Joint limits are , , rad/s, and rad/s. Unless stated otherwise, N m, and rad/s (see Section V-C),
. For both RBFs, , and
with centers and widths in the units of (m/s). Gains are fixed across methods and trials.
The controller period is s, with fourth-order Runge–Kutta integration at 0.005 s and held torques. The inclusive control grid runs from 0 through 30 s, producing 1501 controls and a final state at T=30.02 s.
State limits are checked at every integration endpoint and input limits at control instants, with reporting tolerance . The residual is evaluated offline at accepted control instants using the true plant at the same state and applied torque. Cartesian RMSE is , numerically integrated by the trapezoidal rule. Settling requires mm at every subsequent saved state. Failed runs remain in all completion denominators; their partial-horizon errors are excluded from full-horizon comparisons.
V. RESULTS
Four blocks of simulations were conducted. Block 1 evaluates constrained regulation of the complete scheme in a reference case and under a tighter torque limit. The second group isolates the role of each component through ablations that remove the neural compensation, restrict it to the tracking controller, or remove the auxiliary correction. The third block tests robustness to randomized inertial and damping parameters and to external force pulses applied to the end effector. Block 4 explores the operating range over torque limits and model errors, and measures the computation time of the controller.
A. Constrained regulation
Figure 1 compares the reference torque limit with a tightened limit of 0.3 Nm. Both runs complete with all 1501 QPs reported optimal and no sampled joint, velocity, or torque violation. At 0.5 N m, the Cartesian RMSE is 0.15955 m, the final error is m, and settling occurs at 17.075 s. The peak applied torques are 0.3090 and 0.0655 N m. Tightening the limit clips the first-joint peak to 0.3 N m at three control instants, with RMSE 0.15957 m and the same settling time.
The residual ratio is in the reference case and 0.8686 with the tightened limit, so the assumed bound holds at every accepted control instant of these trajectories, which does not certify it elsewhere. The reference weight norms remain below 0.563, well inside , and the minimum recorded Jacobian singular value is 0.1629 m/rad.
B. Component ablations
Four methods share initial conditions, bounds, gains, and estimated dynamics. Method A disables learning and keeps . Method B uses the RBF and corrected learning signal in the tracking controller but removes from the CBF prediction. Method C shares the RBF output but replaces

Fig. 1. Block 1: complete scheme with torque limits of 0.5 and 0.3 Nm. Dotted lines denote the corresponding bounds. Joint position and velocity use every saved integration endpoint; torque uses control instants.
TABLE I
BLOCK 2: DETERMINISTIC COMPARISON AT FIXED TUNING
| Method | End [s] | RMSE [m] | Final error [m] | R |
|---|---|---|---|---|
| A: no RBF | 30.02 | 0.25423 | 0.27499 | 0.538 |
| B: controller only | 30.02 | 0.19351 | 0.09480 | 0.937 |
| C: no correction | 1.14 | — | — | 2.229 |
| D: complete | 30.02 | 0.15955 | 0.869 |
by s in both the basis input and adaptation update. Method D is the complete scheme. Consequently, C tests removal of the whole auxiliary correction, rather than isolating only a change in the weight-update multiplier.
Table I and Fig. 2 show that A respects sampled constraints and the residual bound but does not reach the target: it ends at rad, at the margin-tightened bound , where the filter cancels the requested torque. B reduces error yet leaves a final offset of 9.48 cm, with the lower joint-2 velocity condition active at 97% of control instants. Such boundary stalling is a known property of CBF-QP filters [19]. D reduces full-horizon RMSE by 37.2% relative to A and 17.5% relative to B, while reaching micrometre-scale error in this deterministic simulation. This supports sharing the learned correction under the tested tuning, not against separately optimized controllers.
C first violates a velocity limit at 0.68 s (peak second-joint excess 0.1076 rad/s) and terminates with an infeasible QP at 1.14 s. The result is consistent with filter intervention contaminating the uncorrected learning signal, but does not prove that every uncorrected adaptive design fails.
Figure 3 shows the mechanism: during intervention, z separates the adaptation signal from the tracking signal through (7), without measuring acceleration. D's integrated intervention magnitude is 0.0940 Nm s.

Fig. 2. Block 2: Cartesian error and early acceleration-residual ratio for methods A–D. The dotted error threshold is 1 mm; the residual threshold is one. Crosses mark the ends of C's recorded traces.

Fig. 3. Block 2: torque-intervention magnitude for A–D and the complete scheme's uncorrected, corrected, and auxiliary signals during the early transient. The cross marks C's last accepted control. The auxiliary correction changes the signal driving the RBF during filter intervention.
C. Uncertainty and external-force trials
Thirty physical realizations independently scale each of uniformly over [0.85, 1.15] times its reference value, and each damping coefficient over [0.5, 1.5] times its reference value. Every realization is applied to all four methods with the original estimated model, seed 20261103, and no retuning.
A, B, and D complete all 30 trials without observed constraint violations; C completes none. Median full-horizon RMSE values are 0.25179, 0.19241, and 0.15954 m for A, B, and D, respectively (Fig. 4). The complete scheme therefore preserves its tracking advantage across these matched perturbations. All 30 D trials also satisfy the residual bound throughout, with R between 0.82 and 0.97, as do all 30 A trials and 22 B trials.
This outcome depends on a calibrated margin. With rad/s , the same 30 trials kept the bound in only five cases. Every exceedance was a joint-1 event of three to eight control instants within [1.02, 1.40] s, with , at the

Fig. 4. Block 3: (a) full-horizon RMSE for completed trials and counts over all 30 matched realizations; C has no completed trials. “Also residual bound” requires completion, observed constraint satisfaction, and . (b) Both external-force signs, applied during the shaded interval [2.4, 2.7) s. Colors identify A, B, and D; solid/dashed lines identify positive/negative pulses. C stops before the pulse and is excluded from recovery curves. The lower-right panel shows D's residual ratios.
onset of velocity-limit intervention. There, the shared term contributed 1.44–1.83 rad/s , whereas the input-map and unmodeled-force terms of (18) summed to only -0.39 to -0.80 rad/s . The correction accumulated during acceleration overshoots the physical mismatch when the filter starts to decelerate joint 1, and rad/m amplifies the discrepancy as in (18). We therefore set rad/s , well below the joint-1 compatibility limit rad/s . Because this value was chosen after observing those trials, here is a consistency check rather than an independent validation. A constant margin cannot absorb all errors: the two joint-2 velocity conditions are compatible only if rad/s .
Eight further runs apply N during s, one run per sign and method. D completes both cases without observed constraint violations, with final errors 3.02 and 2.79 m for negative and positive pulses. A violates sampled constraints for both signs; B does so for the positive sign. B's final errors are 0.0556 and 0.2458 m, respectively. C stops before the force starts. D's peak residual ratios, on joint 2, reach 2.432 and 2.386. The pulses thus show recovery while contradicting the residual-bound assumption during the disturbance; no time-step convergence study of the force discontinuities is claimed.
D. Operating range and computation time
A grid of 35 complete-method runs combines torque limits Nm with common estimated mass/inertia underestimates of 0, 10, 20, 30, and 40%. The physical plant is fixed. All 30 cases with Nm complete without observed constraint violations and keep the assumed residual bound, with between 0.80 and 0.95. All five cases at 0.01 Nm stop with an infeasible QP, before any sampled state violation. Completion means reaching the horizon, not reaching the target (Fig. 5).
The 0.01 and 0.03 Nm rows were added after the initial 0.1–0.8 N m grid produced no failures. This is an exploratory map, not a certified boundary. QP infeasibility reflects incompatible barrier and actuator inequalities at the encountered state, which also depend on the neural term and fixed margins, not physical impossibility of the task.
Three additional timing runs execute sequentially after all other experiments. Median core computation times are 6.17, 6.77, and 5.32 ms; the corresponding 95th percentiles are 7.83, 8.07, and 5.71 ms. Nevertheless, maximum times are 52.15, 55.57, and 45.11 ms, and 4, 5, and 4 of 1501 updates exceed 20 ms. The measurement covers kinematics, adaptation, nominal torque, and QP construction and solution, but not the auxiliary update, diagnostics, integration, or output. These are typical host costs, not a real-time guarantee.
VI. CONCLUDING REMARKS
In this paper, we proposed a safety-constrained intelligent controller for a two-link robotic manipulator that combines a Cartesian tracking law, an RBF neural compensator, and a joint-space CBF filter. The neural compensation is shared by the controller and the filter, so that both act on the same estimate of the unmodeled dynamics, and an auxiliary state removes the nominal effect of filter intervention from the learning signal, so that the network does not learn deviations.
(a) Operating grid: peak residual ratio
| [N m] | 0.92 | 0.90 | 0.87 | 0.84 | 0.80 |
|---|---|---|---|---|---|
| 0.5 | 0.92 | 0.90 | 0.87 | 0.84 | 0.80 |
| 0.3 | 0.92 | 0.90 | 0.87 | 0.84 | 0.80 |
| 0.2 | 0.93 | 0.92 | 0.91 | 0.89 | 0.87 |
| 0.1 | 0.94 | 0.94 | 0.94 | 0.95 | 0.94 |
| 0.03 | 0.95 | 0.95 | 0.94 | 0.95 | 0.95 |
| 0.01 | stop | stop | stop | stop | stop |
Mass/inertia underestimate [%]
Bound held Bound exceeded QP stopped
(b) Three sequential timing repeats

Fig. 5. Block 4: (a) exploratory operating grid for D. All completed cells respect sampled constraints and the residual bound; numeric entries give R. Stopped cells are not successful operating points. (b) empirical distributions of core computation time from three isolated sequential runs; the dotted line is the 20 ms control period.
deliberately introduced by the filter. We also related the corrected signal to the joint-acceleration residual that the filter must bound, and showed that this residual is driven mainly by the transient error of the shared correction.
The results demonstrated that the proposed controller improves tracking while maintaining joint, velocity, and torque limits under parameter uncertainty and external disturbances. The ablations showed that both the shared compensation and the auxiliary correction contribute to this improvement: without the auxiliary correction, the filter becomes infeasible early in every trial, and without sharing, a regulation offset remains. The analysis of the acceleration residual also clarified when the robust barrier conditions hold and how the margins should be chosen.
For future work, we aim to derive a residual bound that accounts for the transient error of the shared correction, so that the barrier margins can be selected a priori rather than calibrated. We also plan to incorporate sampled-data safety margins, a feasibility-preserving fallback for tight actuation, and singularity avoidance, and to validate the approach experimentally on a physical manipulator.
ACKNOWLEDGMENT
We acknowledge the financial support of the Finnish Ministry of Education and Culture through the Digital Waters (DIWA) Doctoral Education Pilot, Decision No. VN/3137/2024-OKM-6, and through the Intelligent Work Machines Doctoral Education Pilot Program (IWM VN/3137/2024-OKM-4).
REFERENCES
[1] A. D. Ames, X. Xu, J. W. Grizzle, and P. Tabuada, “Control barrier function based quadratic programs for safety critical systems,” IEEE Transactions on Automatic Control, vol. 62, no. 8, pp. 3861–3876, 2017.
[2] W. Xiao and C. Belta, “High-order control barrier functions,” IEEE Transactions on Automatic Control, vol. 67, no. 7, pp. 3655–3662, 2022.
[3] G. S. Lima, D. R. Porto, A. J. de Oliveira, and W. M. Bessa, “Intelligent control of a single-link flexible manipulator using sliding modes and artificial neural networks,” Electronics Letters, vol. 57, no. 23, pp. 869–872, 2021.
[4] A. Alwala, G. S. Lima, and W. M. Bessa, “Intelligent control with EKF-based multisensor fusion for differential-drive robots subject to unmodeled dynamics,” IEEE Access, vol. 14, pp. 153 310–153 324, 2026.
[5] S. Keyumarsi, M. W. S. Atman, and A. Gusrialdi, “LiDAR-based online control barrier function synthesis for safe navigation in unknown environments,” IEEE Robotics and Automation Letters, vol. 9, no. 2, pp. 1043–1050, 2024.
[6] H. Pham, N. Ranasinghe, D. Le, M. W. S. Atman, and A. Gusrialdi, “Safety-guaranteed distributed formation control of multi-robot systems over graphs with rigid and elastic edges,” IEEE Robotics and Automation Letters, vol. 9, no. 11, pp. 10240–10247, 2024.
[7] M. Jankovic, “Robust control barrier functions for constrained stabilization of nonlinear systems,” Automatica, vol. 96, pp. 359–367, 2018.
[8] S. Kolathaya and A. D. Ames, “Input-to-state safety with control barrier functions,” IEEE Control Systems Letters, vol. 3, no. 1, pp. 108–113, 2019.
[9] A. J. Taylor and A. D. Ames, “Adaptive safety with control barrier functions,” in 2020 American Control Conference (ACC), 2020, pp. 1399–1405.
[10] B. T. Lopez, J.-J. E. Slotine, and J. P. How, “Robust adaptive control barrier functions: An adaptive and data-driven approach to safety,” IEEE Control Systems Letters, vol. 5, no. 3, pp. 1031–1036, 2021.
[11] A. J. Taylor, A. Singletary, Y. Yue, and A. D. Ames, “Learning for safety-critical control with control barrier functions,” in Proc. 2nd Conference on Learning for Dynamics and Control, ser. Proceedings of Machine Learning Research, vol. 120, 2020, pp. 708–717.
[12] H. Wang, J. Peng, Y. Liu, W. He, and Y. Wang, “Adaptive safety-based tracking control for uncertain robotic systems with input-output constraints: A neural network-based augmented high-order control barrier function approach,” IEEE Transactions on Cybernetics, vol. 55, no. 9, pp. 4453–4465, 2025.
[13] H. M. Sweatland, O. S. Patil, and W. E. Dixon, “Adaptive deep neural network-based control barrier functions,” IEEE Transactions on Automatic Control, vol. 71, no. 10, pp. 6818–6824, 2026.
[14] E. N. Johnson and A. J. Calise, “Limited authority adaptive flight control for reusable launch vehicles,” Journal of Guidance, Control, and Dynamics, vol. 26, no. 6, pp. 906–913, 2003.
[15] J. A. Farrell, M. Polycarpou, M. Sharma, and W. Dong, “Command filtered backstepping,” IEEE Transactions on Automatic Control, vol. 54, no. 6, pp. 1391–1395, 2009.
[16] M. Chen, S. S. Ge, and B. Ren, “Adaptive tracking control of uncertain MIMO nonlinear systems with input constraints,” Automatica, vol. 47, no. 3, pp. 452–465, 2011.
[17] Q. Nguyen and K. Sreenath, “Exponential control barrier functions for enforcing high relative-degree safety-critical constraints,” in 2016 American Control Conference (ACC), 2016, pp. 322–328.
[18] J. Breeden, K. Garg, and D. Panagou, “Control barrier functions in sampled-data systems,” IEEE Control Systems Letters, vol. 6, pp. 367–372, 2022.
[19] M. F. Reis, A. P. Aguiar, and P. Tabuada, “Control barrier function-based quadratic programs introduce undesirable asymptotically stable equilibria,” IEEE Control Systems Letters, vol. 5, no. 2, pp. 731–736, 2021.