• No results found

5.9 Additional system improvements

5.9.4 Input blocking

Input blocking or control input blocking (Foss and Heirung, 2013) reduces the number of control input decision variables. This reduces runtime, especially for nonlinear MPCs, and may improve the system robustness. However, ACADO does not support input blocking. Input blocking should be thoroughly considered if another toolkit or library is used to realize the MPC.

Chapter 6

Control system design

In this chapter we will introduce a control system implementation for running an ACADO-based MPC algorithm in a safe environment1 interacting with other parts of the control system. It is quite important that the MPC is separated from the parts of the control system interacting with the Piccolo flight control and HMI softwares, which run in the ground control communicating through DUNE. If a fault or an error occurs in the MPC we need to stop the problem propagating through the whole control system, which in a worst-case scenario could provoke an UAV crash. There is also real-time properties that has to be safeguarded. Since the MPC requires a lot of computational resources, and the fact that the bank angle/way-points and gimbal angles are calculated by the MPC, the MPC has to be run with a high priority without abnormal interruptions. This introduces a multi-treaded solution, as we will see later in this chapter. Before we start the design process of the control system we briefly address the hardware and software integration. It should be noted that the main thread in the control system represented in this chapter is referred to as the running engine or engine.

6.1 Hardware and interfaces

The overall control objective is to track objects using an UAV equipped with gimbal and IR camera, where a live image stream should be transmitted from the UAV to a ground station. Such an object tracking system was defined in definition 1.3.1. In the scope of this thesis we assume an implemented camera vision (CV) module that provides an object list which includes object positions and velocities. The CV module, which runs on the PandaBoard, controls the camera and provides an image stream to the ground station. The ground station runs a HMI and communicates with the UAV through a radio link using the IMC message protocol. To control the UAV the Piccolo SL auto-pilot has to be provided with way-points (WPs)2. The

way-points should be calculated using the MPC described in chapter 5 or set manually by the ground station. This gives rise to two control scenarios: automatic and manual control. We define automatic control and manual control in the following definitions.

Definition 6.1.1 (Automatic control)

Automatic control is defined as when a MPC calculates way-points and control input to the gimbal. The Piccolo SL auto-pilot and the gimbal controller are provided with the way-points and tilt/pan reference angles, respectively.

Definition 6.1.2 (Manual control)

Manual control is defined as when the ground station provides the Piccolo SL auto pilot with way-points and the gimbal is controlled manually by e.g. a joystick or user set references for pan and tilt angles.

1

Safe environment meaning a thread-safe running engine with firewalls between subsystems.

2

One should note that the Piccolo mainly supports way-points and bank angle as control input. In this chapter we will refer to WP as the main input to the Piccolo.

50 6.1. Hardware and interfaces

We can also define a semi-automatic control:

Definition 6.1.3 (Semi-automatic control)

Semi-automatic control is defined as any subset of automatic control and manual control that provides object tracking services. This could e.g. be WPs set by a MPC and gimbal controlled by the ground station or WPs provided by the ground station and gimbal references calculated by a MPC.

In this project we will support semi-automatic control which allows disabling of automatic gimbal control. This means the MPC would be able to control the UAV while the gimbal could be controlled manually by e.g. the ground station. This topic will be discussed in more details later on. Figure 6.1 below illustrates some of the main components in the object tracking system.

Figure 6.1: Object tracking system.

The main software component in the ground station is the Piccolo Command Center3 which controls the Piccolo auto pilot and enables safe, manual remote control of the UAV. In addition to the Piccolo Command Center the ground control could also include NEPTUS, which is a DUNE based HMI, or other customized HMI systems. The Piccolo Command Center communicates with the Piccolo using a dedicated 2.4 GHz radio link, while the additional payload uses a 5.8 GHz radio link. The UAV’s payload includes the Piccolo auto-pilot, a radio link and computational devices running the MPC and the CV module. The Piccolo Command Center communicates directly with the Piccolo SL auto-pilot, while NEPTUS

3

Chapter 6. Control system design 51

communicates with a DUNE task (DUNE Piccolo interface), which in turn communicates with the auto-pilot. The DUNE Piccolo interface runs on one of the computational devices located in the UAV’s payload. Additional HMIs could communicate with the MPC module, which in turn communicates with the DUNE Piccolo interface. For more details regarding the hardware setup, we refer to chapter 9.

DUNE is a software library that provides communication protocols between different components in the object tracking system. The control environment running the MPC and the CV module should communicate with the Piccolo and ground station through DUNE protocols. Because of safety reasons, the ground station should always be able to retrieve the command of the UAV from the MPC. Since the Piccolo always executes the last provided command a problem rises when both the ground station and the MPC provides the Piccolo with control input. Such a scenario could be triggered in the interchange between automatic and manual control, or when the MPC is running and the operator manning the ground station needs to change the UAV’s flight path. This problem will be a violation of the safety requirements, since the ground station should always be able to fully retrieve the total control of the UAV. To solve this problem we need to establish a communication strategy between the MPC and the ground station.

One way to cope with this problem is to let all control inputs to the Piccolo run through a node common to the MPC and the ground station. This approach enables evaluation of the control inputs. If the ground station tries to retrieve the control of the UAV, all MPC commands should be rejected. The common node could e.g. be the PandaBoard, the ground station or a dedicated installed controller in the UAV. Due to the UAV’s limited spare payload a dedicated controller is not preferable. If this common node is the PandaBoard safety must be assured. This would require total redundancy, which is discussed in more detail later on in section 6.8. Another issue to be discussed is the PandaBoard’s limited resources. Since the PandaBoard could run both the MPC and the CV module, which both invokes resource-heavy processes, together with DUNE interfaces4, there will not likely be enough spare resources to comply with

the real-time requirements of the control inputs. Hence, the PandaBoard is not a preferable choice when choosing a common node. If the ground station is chosen as a common node this will impose requirements on the radio link’s baud rate, and rapid changes in the Piccolo’s control input could introduce transmission delays and in the worst case choke the radio link. Especially since the radio link is also used to transmit a live image feed from the UAV, thus additional round-trips delivering control inputs from the MPC to the Piccolo would impair the real-time requirements. Hence, a common node to filter control inputs to the Piccolo would not be a preferable choice.

Instead of filtering control inputs through a common node one could establish a communication channel between the ground station and the running engine that runs the MPC. This will safely enable implementation of a control logic which would stop the broadcast of control inputs from the MPC whenever the ground station retrieves the control of the UAV. Such a control logic should also let the MPC’s running engine stop the MPC and leave the process in a state where it is ready to start whenever the ground station allows automatic or semi-automatic control. The solution with an established communication channel between the MPC and the ground station

4