# What are some techniques for improving stabilization given a mechanical time constant?

Problem: I have a self-stabilizing system that utilizes an intertial measurement unit (IMU) attached to the hull of a vessel. The system self stabilizes by performing matrix rotations based on the output of Euler angles of the IMU, effectively driving the motion in the opposite direction to compensate for the motion of the vessel. In simulation, and with a system that has a large maximum acceleration and velocity, the algorithm works great. The issue is that there exists a very real lag in the motion of the physical output of the drive.

Question: What are some techniques for compensating for this lag?

Current Attempt: I characterize the motor/output drive by analyzing the amount of lag given a set of velocities. That is, I run the motor at various velocities and measure the difference between the expected position and the actual position of the output drive. From these measurements I deduce a polynomial equation (second order) which effectively predicts the lag of the motor given a certain velocity. This is worked into an ABG filter, which estimates the current velocity and acceleration of the system given positional input. As the IMU data comes in, it is passed through the ABG filter and the coefficients derived from the aforementioned polynomial is applied as a velocity feedforward, which adjusts the output proportionally to the rate at which the roll and pitch are adjusted. Adjusting the coefficients of the ABG filter, heuristically, should theoretically alter the predicted path such that the IMU output is seen as an "adjusted" or otherwise contrived value intended to force the motors to perform a velocity/acceleration larger than the actual (unadjusted) output of the IMU would require, effectively reducing the error between the desired position of the motor/drive and the actual position of the motor/drive.

The lag of the motors/output appears as a phase difference between the IMU output and measured position of the output drive. It seems to always lag by about 200 milliseconds. My assumption was that by increasing the target position, the motor would effectively move quicker. To some extent this works well, but there's a lingering error between where I want to be and where I am at any given point in time.

Further Considerations: After reading some research papers on the topic, it appears that use of a PID loop is preferred over the use of the filter/feedforward in my original question.

https://ieeexplore.ieee.org/document/7375580

Any help is much appreciated.

• With direct "cancellation", delay will directly limit gain-bandwidth. Think of the delay in bode plot representation - phase increases with f. Stable loop needs phase margin, so BW probably well under 1/2T. Could change dynamics of load so that less BW needed to limit error to acceptable level. Something like steadicam setup. With reguarly periodic systems, can also cheat, predict motion, ie some control action -360 degrees to the dominant pole pair, which should reduce magnitude of whatever error is left in real time.. May 14, 2021 at 12:47
• Unfortunately the system bandwidth is fixed. It did occur to me to revisit the tuning of the system to possibly increase the bandwidth, but I am otherwise stuck with what I've got. The ABG filter is already used to predict motion. It is able to, with a sinusoidal Euler output from the IMU, reasonably predict within a few extra degrees the upcoming angle, but this is proving to be insufficient for the system bandwidth. May 14, 2021 at 14:31
• If you're looking at a large boat, where the boat's inertia dominates the input you want to cancel (ie any sea chop or maneuvering), so that you're looking at, say, 80% rocking or bobbing up/down vs 20% random inputs, AND the main resonant period is >> your output delay time, then I think you could still make significant improvements in software ... If you had some examples of both the input and output data, and more detailed description of physical system and control loop, it might be possible to say something. What kind of project is this? May 14, 2021 at 15:13
• I am looking at a large boat where the specification is sea state 5. Your assumptions regarding source of IMU inputs (80%/20%) is fairly accurate. The system has to compensate for known excursions/rates. I am, under the assumptions of maximum velocity/acceleration, able to effectively do better than halving the pointing error, but there's a lingering error due to this phase difference which, in my opinion, entirely stems from the lag of the motor system. What kind of input/output data are you looking for, specifically? IMU input data? Pointing output data? How should I provide it? May 14, 2021 at 15:38
• Ok, and you're trying to stabilize a small platform mounted to the hull, or mounted to an intermediate passive mechanism -- vs stabilizing the boat itself, right? For conceptual simplicity, let's just look at 1 dimension, the roll angle, call it U, which I suspect will be the would be where improvements are possible. I'd say you would start with a system diagram. Then some representation of transfer functions of: U_hull->hull_sensor, U_hull->passive_platform_U, motor_command->motor_output, motor_output->output_object_U, passive_platform_U->output_object_U (sys diagram to show how theyre mixed) May 14, 2021 at 16:22