Reaction Control Systems (RCS) on these vehicles are implemented by using small rocket thrusters. For me it looks like these thrusters work in some kind of "pulse" mode. And I can't understand - do they use some optimal control to calculate in advance the required impulse to reach the new desired state of the system OR they use "pulse" mode just for precise magnitude variation of provided thrust (like average voltage in PWM(pulse-width modulation)) in a classic PID control loop?
do they use some optimal control to calculate in advance the required impulse to reach the new desired state of the system
This is a property every stable controlled system has/should have. Figuring out how to get to some other state is the core of control theory.
Doing something in advance is not possible, but knowing it certainly is. Given that the system is controllable an stable, it should be able to follow a given trajectory. It is a lot easier to calculate a trajectory beforehand instead of generating desired states "on the fly".
The great joy of control theory is that it is
only boring mathematical formulas and numbers, entirely unaware of what it's actually going on in the "real world" able to describe very different systems in a common abstract way. So let's substitute the spaceship with a car.
You are standing at the traffic lights. You think about what to do when they turn green. You create a mental image of how the acceleration (and thus velocity and thus position) of the car should change over time. In a car, that resembles to how hard you should hit the pedal to the metal.
In a multiaxes setup in space, there are many angular accelerations to consider, but it's still the same: how should these values change over time?
There are infinite solutions, but some are favourable. when you are docking in space for a example, you don't want to rotate much at the end of the motion. You want to have pretty much only translational movement between the two docking parts towards each other at the end of the motion. That's why the most part of possibly necessary rotation should happen at the beginning of the motion.
And don't forget that you are in space. finding a trajectory that uses minimal fuel is desirable.
they use "pulse" mode just for precise magnitude variation of provided thrust (like average voltage in PWM(pulse-width modulation)) in a classic PID control loop?
This is not an OR part, but AND. The "pulse" mode is all they have. You can open or close the valve. But the "pulse" is a controlled system in on itself. They measure all kinds of properties of the tanks like temperature and pressure to estimate what one "pulse" will do.
Additionally, the computers know the payload and can calculate the model that's being controlled. In a sense, the system is self aware and can adjust its control accordingly.
Check this document on the RCS which I got a bit of information from.
An attempt to explain the "it's only a pulse" idea:
You are probably familiar with one very common type of spaceship: microwave ovens. (admittedly, they are bound to some big rock by gravity, but still, they are in space (like everything else), so they are clearly spaceships)
There are different kinds of microwave ovens available. They all have the pulsed operation in common.
The simple ones look like this:
It only has two dials: time and power. The power dial adjusts the pulse width and the time dial the overall duration.
With this microwave, a lot of the control algorithm is on you. You cannot put different things into the oven, use the same settings and expect proper results. The frozen chicken and the rasins in the image will look different after 5 minutes at full power. You have to dial in the settings that work for the food you put into the oven.
There are "smarter" microwaves look like this one, with more dials and buttons: You can tell it what you put inside and what you want to do with it. The oven will then figure out what to do. It might even vary the settings over time, to get better heat penetration, even cooking, etc.
It could be as smart as to first run some defrosting program, then cooking and finally turn on the grill. As it knows that you placed a frozen chicken of a certain weight into it, it will be able to figure out how to do all that, without overheating during defrosting, drying out while cooking or burning while grilling. Well, at least in theory.
As you can see, even something as primitive as a simple on/off pulse can do rather sophisticated things if wrapped into a good control loop.
Would it be even better if they could continuously change values of the valve? Probably yes, but not by that much as you know from the averaged PWM signal. Additionally an adjustable valve is a more complex part than a simple on/off solenoid valve. Simple stuff fails less often. Stuff failing in space is a bad thing.