International Journal of Electronics and Communication Engineering & Technology (IJECET) Volume 6, Issue 7, July (2015), pp. 08-16, Article ID: Article ID: 40120150607002 Available online at http://www.iaeme.com/currentissue.asp?jtype=ijecet&vtype=6&itype=7 ISSN Print: 0976 6464 and ISSN Online: 0976 6472 IAEME Publication PERFORMANCE COMPARISON OF ARM CORTEX M3 AND M4 BASED PROCESSORS FOR SENSOR DATA ACQUISITION AND PROCESSING FOR MAV Pankaj Akula Scientist, ALD, CSIR-NAL, Bangalore, Karnataka, INDIA Ajith Kumar P. Shetty School of Electronics Engineering, VIT University, Vellore, Tamilnadu, INDIA Mamata Hegde Visveswaraya Technological University, Belgaum, Karnataka, INDIA. Dr. C.M. Ananda HOD, Principal Scientist, ALD, CSIR-NAL, Bangalore, Karnataka, INDIA ABSTRACT The performance of a Flight Controller is dependent on the acquisition time and processing speed of the microcontroller. The paper discusses the usage of the Cortex M3 based processor PSoC5 and cortex M4 based processor STM32F4 for sensor data acquisition and processing. The Flight Controller comprises of Global Positioning System (GPS), Sensor suite, external flash for data logging, and Pulse Width Modulation (PWM) to control aileron, rudder and elevator surfaces of Micro Aerial Vehicle (MAV). The paper summarizes the acquisition and performance comparison of the two processors PSoC and STM32F4. Keywords: Cortex M3, Cortex M4, PSoC, MAV and STM32F4. Cite This Article: Pankaj Akula, Ajith Kumar P. Shetty, Mamata Hegde and Dr. C.M. Ananda, Performance Comparison of ARM Cortex M3 And M4 Based Processors For Sensor Data Acquisition And Processing For Mav. International Journal of Electronics and Communication Engineering & Technology, 6(7), 2015, pp. 08-16. http://www.iaeme.com/currentissue.asp?jtype=ijecet&vtype=6&itype=7 http://www.iaeme.com/ijecet.asp 8 editor@iaeme.com
Performance Comparison of ARM Cortex M3 and M4 Based Processors For Sensor Data Acquisition and Processing For MAV 1. INTRODUCTION The growth in the development of Micro Aerial Vehicles (MAVs) has been increasing over the past years.modern MAVs are airborne robotic systems controlled by flight control board [1].It comprises of sensors, interfaces and microcontrollers. The applications of MAVs have become broader i.e., not limited to military applications. The present day MAVs support various civil missions such as weather observation, enemy surveillance and traffic monitoring [2]. Flight Controller is a highly optimized set of inertial and air data sensors and GPS to achieve fully autonomous mission capabilities from take-off to landing. MAVs depend on Flight Controller for its navigation and orientation. TheFlight Controller controls the aerial vehicle along the three axes i.e., Pitch, Roll and Yaw [3]. A Flight controller consists of an Inertial Measurement Unit (IMU) for sensing aircraft attitude, a Global Positioning System (GPS) unit for navigation, telemetry unit for data collection, as well as a microcontroller for data processing [4]. Present day flight controllers have the capability to control the movement of the aircraft without constant control by a human operator. MAV is automatically controlled using an embedded computing device called Flight Control Systems [5]. The Flight Controller hosts the flight control law for the aircraft. The performance of the Flight Controller depends on the acquisition and processing times from sensors [6]. Hence an attempt is made in this paper to find the best controller in terms of acquisition and processing time. The timing requirement is achieved by proper scheduling between the tasks [7]. Figure1 shows the complete operational overview of the Unmanned Arial Vehicle which includes an aircraft, Ground Control Station (GCS) and a Radio Control (RC) joystick. For the present exercise, open source GCS Mission Planner from Ardu is used. RC joystick is used to control the flight movement. The tools, techniques and devices which are used to compare the performance of the ARM Cortex M3 and M4 based flight controllers are being discussed here. Fig.1.Operational Overview http://www.iaeme.com/ijecet.asp 9 editor@iaeme.com
Pankaj Akula, Ajith Kumar P. Shetty, Mamata Hegde and Dr. C.M. Ananda 2. ARCHITECTURE OF THE SYSTEM Proposed system mainly comprises of a Microcontroller, Inertial Measurement Unit (IMU), Global Positioning System (GPS) and external flash memory. Controller is mainly responsible to perform these tasks. Communicating with sensor suite for data acquisition [Motion Processing Unit, Magnetometer and GPS]. Storing data on to flash. PWM signal generation for servo motor controlling. A three axis accelerometer is used to detect and measure the current magnitude of acceleration, three axis gyroscopes is used to detect changes in rotational attributes like pitch, roll and yaw with proper estimators and a three axis magnetometer is used to measure the earth s magnetic field. The GPS receiver provides tracking capabilities with position and speed. Design and development of Flight Controller using STM32F4 and Programmable System on Chip (PSoC5) as core element is experimented. Goal of this paper is to compare the performance of PSOC5 based Flight Controller with STM32F4 based controller and provide some insights into further reduction of access time based on Phase Locked Loop (PLL) optimisation settings for STM32F4.Design of same Flight Controller application code with different cores (cortex M3 and Cortex M4) is being discussed here. Hardware Architecture PSoC-5 is ARM cortex M3 based controller and has supporting hardware such as reconfigurable Universal Digital Blocks (UDB), reconfigurable routing and interconnects. Programmable blocks make PSoC distinct from other Microcontroller Units (MCU s). Figure 2 depicts the system architecture of PSoC based Flight Controller. STM32F4 microcontroller includes ARM cortex M4 as core with additional hardware improvements such as Floating Point Unit (FPU), Adaptive Real Time memory accelerator (ART accelerator). Figure3 depicts the block diagram of Flight Controller using STM32F4. PSOC5 IMU ACCELEROMETER MAGNETOMETER GYROSCOPE I2C CORTEX M3 67MHz 256KB FLASH PWM OUTPUT TO SERVO MOTOR (CONNECTED TO WING SURFACE) GPS UART 64KB SRAM SPI FLASH(1 Gbit) POWER MANAGEMENT UNIT POWER SUPPLY Fig. 2.System architecture of PSoC 5 based flight controller. http://www.iaeme.com/ijecet.asp 10 editor@iaeme.com
Performance Comparison of ARM Cortex M3 and M4 Based Processors For Sensor Data Acquisition and Processing For MAV STM32F4 IMU ACCELEROMETER MAGNETOMETER GYROSCOPE I2C CORTEX M4 + FPU 168MHz 1MB FLASH PWM OUTPUT TO SERVO MOTOR (CONNECTED TO WING SURFACE) GPS UART ART CACHE 192KB SRAM SPI FLASH(1 Gbit) POWER MANAGEMENT UNIT POWER SUPPLY Fig. 3. Block Diagram of STM32F4 based Flight Controller. Software Architecture Software architecture is divided into developing device drivers for sensor suite (data acquisition), code for data logging on to the flash and PWM signal generation for servo motor control. Application software for Flight Control is written in C language. STM32F4Microcontroller Unit (MCU) uses Keil Integrated Development Environment (IDE) and PSoC-5 uses PSoC Creator IDE. Software architecture for both PSoC and STM32F4 shown in the Figure 4 Fig. 4.Software Architecture Data Acqisition Application: It is the function of reading data from sensor suite.gps provide position information such as longitude,latitude and altitude. IMU provide state information such as angular rates and accelration. Data Log Application: This process is responsible for writing flight data on to flash for offline analysis as part of flight testing or operational requirements. PWM signal generation: PWM signal is used to control the rotation of the servomotors shaft. Position of the shaft is determined by the width of PWM signal. http://www.iaeme.com/ijecet.asp 11 editor@iaeme.com
Pankaj Akula, Ajith Kumar P. Shetty, Mamata Hegde and Dr. C.M. Ananda To achieve optimum performance out of ARM cortex M4, STMicroelectronics has developed ART accelerator, which is a micro controller system like cache controller tailored to the needs of programs executing from flash. Because of ART accelerator, execution speed will be increased by around 2.5% due to zero wait state memory. The most noticeable difference between ARM Cortex M3 and M4 is the optional single precision (IEEE-754) Floating Point Unit (FPU) which is available with the ARM Cortex M4. Table 1. Comparison of Environment between STM32F4 and PSOC5 based Flight Controllers. S.No Part Name STM32F4 based configuration PSoC5 based configuration Hardware 1 Processor STM32F4 PSoC5 LP 2 Accelerometer MPU 9150 MPU9150 3 Gyroscope MPU9150 MPU 9150 4 Magnetometer HMC5883L HMC5883L 5 GPS 3DR MTK 2.0 3DR MTK 2.0 6 Flash Spansion NOR 1 Gbit Spansion NOR 1 Gbit Software 1 IDE Keil PSoC Creator 2 Application Software Language Embedded C Embedded C 3. METHODOLOGY The Flight Control System which is present in a MAV is capable of acquiring the data from all the sensors and stores them in the flash. This paper mainly focuses on performance comparison of ARM Cortex M3 and M4 based Flight Control System for the sensor data acquisition and processing time for the estimator algorithm. Proposed system includes MCU with the sensor suites. The accelerometer and gyroscope integrated in the Motion Processing Unit provides state information, while magnetometer and GPS serve to provide magnetic field information and location coordinates. The data from the sensors are acquired and given to the attitude estimator which works based on the principle of Kalman Filter. The output is then used in order to calculate aircraft attitudes with other flight parameters and stored in the flash. Further the pitch, roll and yaw angles are compared with the input range values. If there is any deviation in the angle detected or the change in same, The Flight Control System detects the change and generates the Pulse Width Modulated (PWM) signal accordingly based on its variation. It will be then directed to the servo motor connected to the control surface in order to control the principal axis of the flight i.e., the ailerons, rudder and elevators. The process flow is shown in the Figure 5. http://www.iaeme.com/ijecet.asp 12 editor@iaeme.com
Performance Comparison of ARM Cortex M3 and M4 Based Processors For Sensor Data Acquisition and Processing For MAV STEP 1 Initialize the Sensors STEP 2 Reading data from IMU, BMP, Magnetometer STEP 3 Sending data into NCF estimator STEP 4 Compute the state estimates from the NCF STEP 5 Storing data in the flash Fig. 5.Program Flow for the above explaned block diagram. 4. EXPERIMENTAL RESULTS Figure 6 shows the experimental setup of the fight controller which includes PSoC5 development kit, Inertial Measurement Unit, Magnetometer, GPS with Logic analyser. The data from sensors has been acquired with developed application software and processed in PSoC controller using attitude estimator to get Attitude information. The data acquisition and processing time has been analysed and result is presented in Table 2 and Table 3. Fig. 6. Experimental setup using PSoC5. Figure 7 shows the experimental setup of the Fight Controller which includes STM32F4 evaluation with Logic Analyser. http://www.iaeme.com/ijecet.asp 13 editor@iaeme.com
Pankaj Akula, Ajith Kumar P. Shetty, Mamata Hegde and Dr. C.M. Ananda Fig. 7. Experimental setupusing STM32F4. Comparison of read timefor the two different sensors and Execution time of the attitude estimator inboth STM32F4 and PSOC5 based flight controller are presented. The PSoC5 supports up to 67MHz of clock frequency and STM32F4 supports up to 168MHz Fig. 8. PLL clock settings using STMCubeMX http://www.iaeme.com/ijecet.asp 14 editor@iaeme.com
Performance Comparison of ARM Cortex M3 and M4 Based Processors For Sensor Data Acquisition and Processing For MAV Table 2. Comparison of performances between STM32 and PSOC 5 Flight Controllers Sensor 1. Accelerometer + Gyroscope 2. Magnetometer 3. Pressure Sensor Read time for STM32F4 (Cortex M4) based Flight Controller (in ms) 1.7972 0.9333 8.6146 Read time for PSOC5 (Cortex M3) based Flight Controller (in ms) 2.55 1.516 8.976 Table 3 and Table 4 shows the comparison of read time and execution time of different sensors and Attitude Estimator respectively for STM32F4 and PSOC5 based Flight Controller. Due to the increase in the clock frequency as discussed above, the performance of STM32F4 based Flight Controller is better than PSoC5 based Flight Controller. Table 3. Comparison of Execution time of Attitude Estimator between STM32 and PSoC5 based Flight Controller. Function Execution time for STM32F4 (Cortex M4) based Flight Controller (in ms) Execution time for PSOC (Cortex M3) based Flight Controller (in ms) Attitude Estimator 0.6192 3.46 Figure 8 shows clock configuration of STM32F4 using STMCubeMX. By changing the prescaler values (i.e. M, N and P), the PLL clock configuration has been done. Still reduced read time and execution time can be encountered after performing PLL customization is as shown in the Table 4 and Table 5. Table 4. Read time for STM32 Flight Controllers after PLL optimisation Sensor 1. Accelerometer + Gyroscope 2. Magnetometer 3. Pressure Sensor Read time for STM32F4 (Cortex M4) based Flight Controller(in ms) 0.4713 0.2687 8.6050 Table 5. Execution time of Attitude Estimator for STM32 Flight Controller after PLL optimisation. Function Execution time for STM32F4 (Cortex M4) based Flight Controller(in ms) Attitude Estimator 0.3250 http://www.iaeme.com/ijecet.asp 15 editor@iaeme.com
Pankaj Akula, Ajith Kumar P. Shetty, Mamata Hegde and Dr. C.M. Ananda The computing power of cortex M3 and M4 is 1.25(Dhrystone Million Instructions per Second) DMIPS/MHz but frequency capability is different. The supported clock frequency of PSoC5 and STM32F4 translates into higher DMIPS capability for STM32F4. 5. CONCLUSION The paper has discussed the implementation and characterization of STM32F4 and PSOC based flight controllers using the configuration as described. The improvement in access time by using STM32F4 compared to PSoC and further improvement in STM32F4 by using appropriate PLL settings has been discussed. 6. ACKNOWLEDGEMENT Author would like to thank Mr. Shyam Chetty, Director NAL for continuous support and motivation. Authors also would like to thank Mr. Pavan Kumar, Ms.Swetha, Mr. Sharath and team of NALMETF for their support in testing and integration of Autopilot System. REFERENCES [1] El-Sayed, A.; ElHelw, M., "Distributed component-based framework for Unmanned Air Vehicle systems," Information and Automation (ICIA), 2012 International Conference on, vol., no., pp.45,50, 6-8 June 2012 [2] JinLin Hu; ShangyouZeng; Zhengzhen Zhang, "The Design of Wireless Data Acquisition System Based on STM32F4 and Virtual Instrument," Wireless Communications, Networking and Mobile Computing (WiCOM), 2012 8th International Conference on, vol., no., pp.1,4, 21-23 Sept. 2012 [3] He Shen; YunjunXu; Remeikas, C., "Pressure sensor array based nonlinear robust pitch control for small or micro aerial vehicle," American Control Conference (ACC), 2012, vol., no., pp.1732,1736, 27-29 June 2012 [4] Wang Hua-jie; Su Juan, "The Design and Research of Infrared Sensor Monitoring System Based on STM32F4," Computational and Information Sciences (ICCIS), 2012 Fourth International Conference on, vol., no., pp.876,879, 17-19 Aug. 2012 [5] Winkler, S.; Buschmann, M.; Kruger, L.; Schulz, H.-W.; Vorsmann, P., "Multiple Sensor Fusion for Autonomous Mini and Micro Aerial Vehicle Navigation," TENCON 2005 2005 IEEE Region 10, vol., no., pp.1,6, 21-24 Nov. 2005 [6] JinjunRao; TongyueGao; Zhen Jiang; Zhenbang Gong, "Flight control system of a robotic portable unmanned aerial vehicle," Advanced Computer Control (ICACC), 2010 2nd International Conference on, vol.1, no., pp.540,544, 27-29 March 2010 [7] Pastor, E.; Lopez, J.; Royo, P., "An Embedded Architecture for Mission Control of Unmanned Aerial Vehicles," Digital System Design: Architectures, Methods and Tools, 2006. DSD 2006. 9th EUROMICRO Conference on, vol., no., pp.554,560, 0-0 0 http://www.iaeme.com/ijecet.asp 16 editor@iaeme.com