跳到主要內容

Besiege Notes on Automation Block Stabilization #1 --- PID Controller

ORC-43 Buan Hover Car, implemented with tracker-based PD controllers. Link


This series of articles document how my approximated automation-block PID controller works and how I implement them on self-stabilizing machines.

Trackers and Steering Hinge Syncing

To see the sensor beams in simulation, The Colliderscope mod Must be installed. Other mods from Dagirefaa are also recommended for advanced building.

The stabilization systems I developed is based on trackers and steering hinge/block synchronization. Either a single-sensor version with RTC steering hinge, or a 2-sensor non RTC version will do the job. The same idea can be applied to absolute angle tracking with anglometer blocks.
And again, in my notes I assume the readers have a certain understanding in Besiege building to replicate these just by a glance.

Tracking the relative height to the ground with 1-sensor or 2-sensor tracker

To make the tracking useful, I need to utilize the angle of the steering hinge. Since the steering hinges/blocks are perfectly synced when bound to the same keys, I can set up a system that has continuous output instead of "0 and 1".

Synchronize the flying block pair to the tracker

PID Controller

In the gif above is in fact the P controller. P stands for proportional, although in this case using rotating blocks it's sinusoidal approximated, not perfectly linear. In small angle, sin(x) ~= x (see the figure below).

Graph of sin(x)

The I, integral term is very simple. In the image bellow, the I is using the two vertical sensors and the flying block pair on the yellow hinges. When the height is low, it turns the flying block up slowly, otherwise down.
Since currently my machines do not need term I, this is kept simple and will not be further discussed in the series.

PID height controller. Blues are term P, yellows are term I, and the red is term D
PID controller in action. Term I adds up to compensate
the added drag tool weight. Term D resists the sudden movement

Term D is derivative, i.e. speed in short. Term D resists changes, dampen the system to eliminate oscillation. It uses the same tracker as term P.
When implementing D for a 1-sensor tracker, it needs an automatic (always on) thruster in the return direction of the RTC steering hinge, and another thruster in the opposite direction with double the force and mapped to the sensor's output.
For a 2-sensor tracker, just map the thrusters to the outputs of the two sensors respectively to the directions.

Active damper, a D controller with 2-anglometer angle tracker and a reaction wheel


Characteristics of  PD Controllers Based On 1-Sensor & 2-Sensor Trackers

Term P and term D have different oscillation characteristics on 1-senor and 2-sensor trackers.
With a 1-sensor tracker, P and D outputs are both oscillating. But an oscillating term P is giving a more precise output while an oscillating term D will make the whole machine oscillate, which is not good visually.
For a 2-sensor tracker, P and D outputs are not oscillating due to the dead zone between two sensors. Now term P is causing the whole machine to oscillate in low frequency, according to the size of the dead zone. And term D is only responding when it goes outside of the dead zone, keeping the machine from oscillating.
Therefore, a 3-sensor system with 1-sensor term P and 2-sensor term D is ideal for the desired smooth control of my hover car.


ORC-43 Buan Hover Car

Tuning the PD system

To tune the tracker-based PD system, every parameters on the sensors, steering hinges/blocks, and thrusters have their effects. The sensor setup can affect the dead zone; the tracker steering hinge speed affects the response time and also the strength of term D; the thruster is the output force, obviously.
One note about systems involving anglometers is that the presence of gimbal lock. If the machine does not have something that can detect a gimbal lock,when it goes upside-down the system will see a sudden 360° change in direction/attitude, which will very likely causing the machine to fail.

Next article I'll continue on the topic of the practical implementation of these systems on self-stabilizing machines.
#

留言

這個網誌中的熱門文章

Besiege Notes on Propeller Engines

Kuroko (thesencoredstudio) from Steam requested a talk about propeller engines.

There are a few things you can do to get the most potential out of propeller engines. I suppose the reader knows some advanced stuffs like Besiege plane building experiences and flatangle propeller blocks, also basic aeronautics .

The Angle of Attack (AoA) The 90° flatangle is ideal if the plane is going to fly supersonic, but I recently build only 1:1 scale WWII fighter planes with top speed below 200 m/s. 75° to 80° AoA is what I usually use.

The Radius I follow the specifications when I build replicas. If its an original aircraft, it is of course the bigger the better.

The Number of Propeller Blocks In Besiege, the propeller blades are made of propeller blocks, the vertical and horizontal stabilizers are also made of propeller blocks. It'd be an un-flyable plane when the stabilizing effect of the propeller is stronger than the tail's. Remember to add propeller blocks to the tail when making a dou…

Besiege Notes on Automation Block Stabilization #2 --- Bike, Car & Ekranoplan Implementations

This series of articles document how my approximated automation-block PID controller works and how I implement them on self-stabilizing machines.

Proportional Controller on Bikes For a motorcycle to self balance, a P controller is a must. A simple 2 sensor and reaction wheel will make a motorcycle oscillate badly.
To build a vanilla self-balancing bike, the mechanism has to be small. I chose to fit this gyroscope system in the bike shown in the picture. As the spinning-block-powered contra-rotating gyroscope spins, the torque is canceled. However if the axes of rotation of the two gyroscopes are not aligned perfectly, a net torque is generated and increases as the angle between the axes of rotation gets bigger.


The generated torque isn't linear to the angle, but sinusoidal. This is ideal when the angle is small. The output is approximately linear if the gyroscopes spin fast to provide enough torque at small angle differences. This makes it a P controller for tilt angle correction…