• No se han encontrado resultados

Sin aire

In document Veinte mil leguas de viaje submarino (página 151-156)

A Motorola MPC555 microcontroller was selected as the main processor for the em- bedded autopilot on the Eagle. The MPC555 is a 32-bit device based on a 40Mhz PowerPC core. It has a large array of peripheral equipment, which makes it suitable for embedded applications that require intensive computation, high integration, and expandability. Various single board computers (SBC) based on the MPC555 are available. A Phycore-MPC555 SBC was chosen due its small credit-card size and the abundance of onboard storage, including 4MB of RAM and 4MB of Flash ROM memory. The final autopilot design consists of three printed circuit boards surround- ing the SBC. The additional circuit boards are stacked in line with the SBC and provide interfacing to the radio control system, servos, I2C bus, CAN-Bus, IMU and RS-232 devices such as the RF modem used for telemetry. The boards also contain power supply circuitry including a facility to monitor the battery and bus voltages. For experimental purposes and safety, a mechanism is necessary to allow the helicopter to be switched between manual and automatic control. Some of the experiments conducted were of a high risk nature and required repeated attempts to achieve successful closed loop behavior, so special care had to be taken to ensure

§4.3 Autopilot Systems 65

Figure 4.4: Eagle with onboard embedded control

that pilot control could be regained rapidly in event of excursions from stable flight. A robust scheme for Hand Over Take Over (HOTO) is therefore implemented on the helicopter, allowing switching between these two modes. In manual mode, a human pilot flies the helicopter with a hand held radio control transmitter. In automatic mode, the helicopter controls are set by the autopilot. The 7th receiver channel has been assigned for controlling the HOTO function and the autopilot sets automatic mode when this channels lie within a certain range of values. A switch on the pilot’s transmitter is used to set the value of the 7th channel to one of two possible values corresponding to automatic or manual.

The current set of servo actuators consists of five servo channels: collective, throttle, aileron, elevator and tail rotor pitch. To simplify testing, it is desirable to be able to choose which channels the pilot controls and which channels are con- trolled by the autopilot at any instance. This enables each control loop to be tuned individually, which is much easier to cope with experimentally. To facilitate this, a pass-thru parameter can be changed from the ground, which controls the source of each channel. The pass-thru parameter only applies in automatic mode and is implemented in software. The control channels to be set by the pilot are decoded by the autopilot and passed through to the servos as a Pulse Width Modulated (PWM) signal unchanged. In manual mode, all of the servo channels are driven directly from the receiver through a hardware switch.

In addition to the above HOTO system, a failsafe mechanism is present which de-activates automatic control when a watchdog circuit is not reset periodically by the main control loop. In the event of a software failure stopping the program from running, the main control loop is unable to toggle a designated data output from the MPC555. After a period of 0.1 seconds, the failure to toggle results in control being passed back to the radio control receiver.

66 System Overview

of 50Hz. The MPC555 autopilot generates the PWM servo signals for up to eight channels. Currently only five channels are required to control the helicopter. The servo channel PWM outputs are sent in the order aileron, elevator, throttle, rudder, collective with 2.5 milliseconds (ms) spacing between each pulse. Every 20 ms the sequence repeats. In order to minimise control lag and therefore increase controlla- bility, the leading edge of the PWM pulse for each channel is activated immediately after the control value for that channel has been calculated. As the range of PWM pulse widths is 1-2ms, this infers that the maximum control lag due to the PWM transmission is only 2ms. Without this immediate update, the PWM lag would vary from 1-22ms depending on what part of the PWM cycle the control update was made.

The current control loop executes at 400Hz. At the start of each control loop iteration, sensor data is read in from the various sampling buffers on the MPC555 microcontroller. The sensor data is then processed to remove errors found in cali- bration and filter out unwanted noise. The corrected data is then used to update the onboard state estimate. As each control channel is only updated at 50Hz, only one channel is calculated and updated per control loop. Based on this sequence of events, the maximum delay between a sensor being sampled and a control signal ar- riving at the servo is approximately 5ms. Additional effective lags of about 5-10ms are also present due to analog pre-filtering of the inertial data.

In document Veinte mil leguas de viaje submarino (página 151-156)