Control laws are often formed as linear combinations of certain expressions. The coefficients of these linear combinations are called the gain of the control system. After the structure of the control law is selected, the main task in the design of the control system is to find such gain factors at which the quality of the control system will be the highest possible or will satisfy the given requirements. An algorithm is being developed for searching for the gain of the control law based on the PID controller for a number of applied tasks: automated positioning of yachts in a ship's dock and one model of orbital launching. Management is carried out simultaneously for all spatial components.