Maksimuzz's blog View Details
Posted by Maksimuzz | Jul 27, 2018 @ 10:11 AM | 1,639 Views
I want present a small program ComView.(ZIP version)This program may be helpful to watch internal parameters of any controllers in graphics.

Name: ComView.png
Views: 9
Size: 87.7 KB
Description:

The program is designed to visually graphically display the data stream coming through the RS232 com port or its analogs such as USB converters. To display the flow, it is enough for the programmer to output up to 16 parameters from his device through com port with comma (,) delimiter. If autocalibrate is enabled the program itself will make it so that the data will be displayed in the graphics window. Then you can turn off auto-calibration and find convenient gains and shifts of graphs. After that, you can save the parameters in Your ini-file so that You does not need calibrate channels again. This is the main mode of the program - data display. The First checkbox of channel is intended to switch on-switch off channel, the second checkbox is intended to enable autoscale. Next field is gain koefficient, the next - offset from zero. Parameters of stream may be any. (float or integer) Comma is required for delimit. Many parameters (exclude colors) may be saved to the disk to user ini-file. The program will save all detected data to log-file.

For demonstration purposes, the data visualization mode for the horizon and compass with the ability to display static rolls on the accelerometer and two modes of dynamic roll calculation in the IMU tab is provided.

Name: IMU_settings.png
Views: 6
Size: 27.0 KB
Description:

Here you can configure which channels will be used for the calculation and select or measure the coefficients include Kalman-filter. This feature need more detailed guidance. It will be made in the little later.
Posted by Maksimuzz | Jul 27, 2018 @ 09:40 AM | 1,659 Views
In the project directory for the controller we will see the following files:
Cstartup_SAM7.c - from Atmel examples
fat.c - FAT functions
fat32.c - FAT32 functions
GPS.c - NMEA parser, GPS processing, time reference
main.c - main program loop
mmc.c - support SD card
twi.c - I2C interface with compass
usart.c - serial ports
Board.h - file from Atmel examples
Cstartup.s79 - startup file, asm, Atmel

The folow Figure shows the algorithm for starting the autopilot. After the power is turned on, all necessary controller registers are initialized first. Then there is a pause of 20 seconds, although it should be longer. Practice has shown that it takes about 10-15 minutes to warm up the height sensor. If there is no SD card, the autopilot parameters are set from the code structure. If SD card present the autopilot parameters are initialized from SD.

Name: WarmUp.png
Views: 0
Size: 24.6 KB
Description:

Autopilot parameters and route must be written according to rules in a hard-coded file named gpspoint.txt. The rules are as follows: the line of parameters begins with the symbol P, the line of the route is G. The symbol # indicates the comment and this string ignored. The autopilot parameter string looks like this:

#Paramrters: Kst_roll, Kast_roll, Kfar_roll, Kst_pitch, Kast_pitch, Kfar_pitch;
# Kst_speed, Kast_speed, Kst_hdg, Kast_hdg, Kst_alt, Kast_alt;
P 0.08, 0.0, 0.08, 0.2, 0.0, 0.2, 5.0, 1.0, 0.02, 0.2, 0.0, 2.0, 0.0,
#

The meaning of the parameters can be found in Sections 4.3. They are similar to...Continue Reading
Posted by Maksimuzz | Jul 27, 2018 @ 09:21 AM | 1,570 Views
As it was said early I used a ready to use debug board for at91sam7 controller. In Figure you can see the prototype version, which still flies.

Name: LapMade&PPM.png
Views: 1
Size: 880.1 KB
Description:

Over time, after connecting GPS, I had to increase the memory size, and I switched from SAM7S64 version to SAM7S256. The electrical schematic diagram is drawn in two versions - the first including the AT91SAM7S256 controller, and the second for using the finished controller board. Here I will only talk about some elements of the scheme, because it is simple. I will take the positional notation of second option. The board is powered by a voltage source in the range 3.6 - 12V. The current consumption at a voltage of 5 V is approximately 0.3 A. In a real model, the voltage of 5V can be taken directly from the ESC control. (I do so) When using the ICE, the 4.8V battery. For high-quality power, a U4 LM2577 boost converter up to 5.9 V is first used, and then a step-down converter up to 5 V (U5 LT1963). The down converter 5В-3.3В in the controller board. Voltage 5.9V is used for the driver of the reference voltages V-REF and + 5VREF (U6 REF195, U13 AD823). V-REF - reference voltage for the built-in ADC controller, + 5VREF - reference voltage for the op-amp signals of the sensors. To prevent the controller from reaching more than 3.3 V on the ADC, protective diodes VD1 to VD4 are provided. Still it is possible to say what signal is expected at the input of the PPM-IN, from the receiver. My circuit variant expects the oscillogramm shown in the figure next to photo of the board. It has the 6 channels. This requiresdiscussion, since this is the only non-standard place in the project - a modification of the standard PPM receiver is required. In addition, in the case of modern remotes, all pulses on all channels begin simultaneously. It will be best to use one pulse per controller port, and the timer mode for measuring the duration of these pulses is changed. This solution is verified, and is present in the software, but not debugged. Here is a PDF for all the components used.
Posted by Maksimuzz | May 21, 2018 @ 01:09 AM | 1,304 Views
As mentioned earlier, it is easy to assume that a longitudinally placed gyroscope can be used to hold the roll. But I would like to check this before the plane is crashed. And I would also like to check the aircraft control algorithms. This feature is provided by the XPLANE flight simulator(Ask me if needed). Since I bought the version of XPLANE-6 in due time, I use it. Why XPLANE? It allows you to output data from the simulated aircraft sensors to other programs or computers by various means. I have chosen the UDP protocol for this. The picture shows a block diagram of the simulation complex.
Name: SimXplaneDia.png
Views: 10
Size: 198.2 KB
Description:
An example of one flight and an explanation of the simulator configuration and the autopilot program can be seen in the video. The video shows the various modes of flight of the aircraft and contains instructions for setting up the X-Plane simulator and the autopilot program.

4.1 PPJOY and VSPE.

To control the aircraft in the simulator usually a joystick is used. For training in the management of radio-controlled aircraft, the corresponding simulators are also used. To interface standard remote controllers with simulators, there is a PPJOY program that converts the input data stream of the RS232 interface, created according to certain rules, to virtual joystick control signals. The program also contains a driver, which is defined in the system as a joystick. Description of the program PPJOY can be found in free access on the Internet. Here you can find an application that can work...Continue Reading
Posted by Maksimuzz | May 12, 2018 @ 09:55 AM | 1,092 Views
3.6 GPS module

A GPS module with a built-in antenna is used. This is a small modul, located outside the shielded box of autopilot. (See previous Fig. with Pitot). The documentation for the module can be found in the GPS folder. The module S3126 is applied. The GPS module is connected to the controller via one of the UARTs. Communication with the module follows the standard protocol NMEA0183. In the 2017_09_02 test, before the launch of the aircraft, the GPS did not work properly, and the aircraft flew very beautifully... but with a wrong course. As it was possible to see from the data of the "black box" TRACK005.LOG GPS "thought" that it is a kilometer from the given point. This can be seen in the flight data from 2017_09_02. It should be noted that in this test I could not yet control the distance to the next flight point before the flight(i.e., the autopilot was turned off). Therefore, the distance of 134 M in the log file did not indicate that the place of the aircraft was correctly determined. The distance to the next point should be about 100 m, the offset is about 0, and the course is 323. However, as you can see, real data appeared only at the moment of takeoff at 14:10:33. And the course turned out to be 150, the distance is 1012M, the displacement is 121M (deviation from the axis, according to which the aircraft must fly in accordance with the task). After this test, a change was made to the program so that the routing data is displayed in...Continue Reading
Posted by Maksimuzz | May 03, 2018 @ 09:32 AM | 2,200 Views
3.3 Altimeter

As an altimeter an absolute pressure sensor is usually used. The MPXA4115A6U sensor is used in this project. The sensor outputs a voltage that is measured by the controller. Before the flight it must be warmed up. The warm-up time is 10-15 minutes. As the atmospheric pressure changes, the altimeter is calibrated automatically before each flight. The sensor has a significant temperature drift. Figure shows the graph of the altimeter drift. Since the speed sensor is also a pressure gauge, the drift is the same.

Name: AltitudeSpeedDrift.jpg
Views: 0
Size: 117.8 KB
Description:

The most interesting test of the pressure sensor is undoubtedly a trip to the underground. The data of the black box of the trip is shown in next Figure. About this graph it can be said that the autopilot is switched on on the 12th floor, (about 36 m). Further descent on the elevator, then I went by bus, and then by underground train. The final point of my journey, when I got off the subway, is really on the hill.

Name: Metro.jpg
Views: 0
Size: 228.9 KB
Description:

3.4 The air speed sensor (Pitot).

The speed of aircraft is usually measured with a Pitot tube. These things are usually calculated. But it is clear that if you blow to the tube (without touching it with your lips), then the pressure in it will increase. Measuring the pressure in the tube you can estimate the speed of flight. The tube is usually placed either on the wing or on the fuselage (if there is't the pulling screw). For correct measurement, it is necessary that the engine does not pump air directly into the tube. Being...Continue Reading
Posted by Maksimuzz | Mar 22, 2018 @ 02:09 AM | 1,512 Views
3.1 Accelerometr

The sensor is designed to measure of a linear acceleration. As an accelerometer a device ADXL202E (Analog Devices) is used. This is a two-axis accelerometer with output in the form of pulses, the duration of which is proportional to the acceleration. The pulse width is measured by a timer. Only one of the axes (X) is used to measure of the aircraft inclining. The Y axis can be used to calculate the lateral acceleration and its compensation by trimming the rudder position. This feature while is not implemented. This axis(Y) shows the position of the "ball" in the corresponding angular velocity sensor and airplane sliping (For example, Yak-18T, EUP-53).
Name: JEUP-53_web.jpg
Views: 0
Size: 32.8 KB
Description:
When turning (under the turn of the pilots is understood any course change of the aircraft), the pilot to reduce the slip usually levitates the pedals and holds the ball in the center position. The drift of the accelerometer when measuring the slope is shown in picture. As you can see, when drifting into the refrigerator for 15 minutes, the drift was -5 degrees.
Name: ADXL202-Pitch.png
Views: 0
Size: 13.8 KB
Description:

3.2 Gyroscope

The key element of the panel of any aircraft is the horizon. It is usually built on the basis of a mechanical gyroscope. It shows the roll and pitch of the aircraft in the instrumental flight mode. This project uses the MEV-50A semiconductor gyroscope to measure aircraft roll. However, unlike the classical gyroscope, semiconductor gyroscopes measure not absolute roll, but its derivative - angular velocity. This...Continue Reading
Posted by Maksimuzz | Feb 22, 2018 @ 05:11 AM | 1,515 Views
The functional diagram of the autopilot is shown on a picture. The heart of the autopilot is the LEVEL1 block. This module is a high-priority function and is executed independently of other events every (15.625 ms tested version) 46.875 ms. Its task is to keep the aircraft in the correct flight position.
Name: FunctionalDia.png
Views: 0
Size: 42.4 KB
Description:
The input data for the module is the FSSi structure, which contains the parameters Roll, Pitch and Air Speed. A correct flight position we will name roll = 0 and pitch = 0, when Ref signals are absent. Also this module controls the engine controller of the aircraft and ensures the holding of the speed received from the LEVEL2 unit in accordance with the flight task. The Level2 module disturbs the LEVEL1 module by the Ref signals and thus forces it to hold non-zero roll and pitch values that calculated in accordance with the flight task. The speed parameter is directly transmitted from the flight task. The output of the module is a data structure that contains the current position of ailerons, elevator, rudder and rudder (Throttle). This structure in the program is called FSSo, the Module has the name FltStSys (flight stabilization system). It can be fed into the PWMC (Pulse Wide Modulation Controller) if the autopilot mode is activated. Otherwise, a structure filled with a timer is sent to the PWMC according to the measured values received from the HF receiver. This is a traditional control mode for radio-controlled models. The Level2 module is slower, it generates...Continue Reading
Posted by Maksimuzz | Feb 12, 2018 @ 09:42 AM | 2,347 Views
1. Introduction
I started interest RC-planes at 2002 I made , when I had living in Prague. The first aircraft was with a wingspan of 1.2 m, engine 2-stroke ICE. Here is a fragment of a video recording of those times. Once in 2008, I got an accelerometer ADXL202E. Having experience developing devices on the MCS-51 family controller (it was Rubidium frequency standard and data acquisition system), I decided to make an autopilot for the Mentor radio controlled model. First of all, I connected the accelerometer to the controller. For simplicity, I chose a debug card with the AT91SAM7 controller, for the convenience and ease of handling it. It should be noted that I decided not to study anything about autopilots on the Internet, but to do everything myself with "0", so that it would be more interesting.
Name: sam7-h256.jpg
Views: 8
Size: 51.1 KB
Description: Controller board
So, by chance of the case in 2008, I happened to fly by plane and have the opportunity to use a laptop and my controller with an accelerometer on board. Today, any owner of a tablet or smartphone can carry out such an experiment independently, since accelerometers are available in almost all devices.
Name: IMG_0545.jpg
Views: 8
Size: 1.61 MB
Description: At board
That's where I made the first "discovery" for myself, that you can use the accelerometer to stabilize the pitch (since the aircraft cannot gain speed too fast or slow down), but for stabilizing the roll it is not good. Since with a correct turn without slip, the side accelerations are compensated by the aircraft's roll, and the accelerometer does...Continue Reading