Home > other >  Arduino nano development framework of flight control design, the couple's fantasy
Arduino nano development framework of flight control design, the couple's fantasy

Time:10-22

First of all, on the industrial development, I was a newcomer, learning control in the arduino has four months, although make software before, but the C language and hardware are a novice, here to discuss the major topic is because baidu information is too little, want to come here, the author especially I don't like to read other people's code, all only oneself study,

Many people think that the nano is too small, could not achieve flight control, it is said that the apm is not a piece of arduino,
Although the nano resources is too small, but if save up and use, do a simple flight control is possible,
A lot of people want to design a flight control, but how to build the framework of all the time,
I designed a simple flight control framework, hope the great god of all stripes on brick, if don't even focus attention, that I too too failed,

Said the first design goals: to do a simple flight control, not business needs, to achieve the basic flight control, such as providing stability and control support,

Listed first flight control design content list

1, read six channel receiver data
2, read the gyro attitude data
3, read the other sensor information, such as GPS information
4, all the algorithm implementation of
5, control motor or servo

Process goals: read the receiver control requirements, read the gyro attitude, combining both stead to or the action of steering gear, can achieve good, no other considerations,

First of all, the whole framework is a receiver as the center, why? Because the receiver is active data sources, all other tasks can be viewed as a passive, I mean, the receiver of the data is sent by the receiver, rather than I come over, when data arrives at, if I don't receive the data in the past, a data frame, so the receiver must first arrange read data, after the receiver full access to data, consider making time to deal with other tasks, probably is also for this reason, it is said that the APM is to use a separate receiver chip to read data,
Thankfully, receiver of the frame frequency is 60 or so, that is to say every frame takes 17 milliseconds, and a frame six channel receiver reads only need 4 milliseconds, about 13 milliseconds to deal with other things, enough,
When you complete reading the receiver data and save all 13 milliseconds to deal with other tasks, your flight control is accomplished the basic framework (from),

Here said the steering gear and motor
Steering gear and motor control frequency is 50, 20-80 can actually, slightly higher as more stable, I tried, 60 or so can work very well, so I use the frequency of the receiver, each receiver a frame of a motor, so for the rest of the 13 milliseconds, can spare two or three milliseconds to control all of the steering gear and motor, I tried, 4-6 steering gear is quite stable, good, we have 10 milliseconds,
The other is to say, to read gyro attitude calculation in less than 3 ms, including calculation, timing more than two milliseconds (such as complicated calculation), ok also
Regardless of the other sensors,
Algorithm implementation mainly combine data receiver and gestures after processing, it is concluded that the need of motor servo data, this is not time-consuming,
Handle all of these can be in the range of 60 hz, if afraid didn't have enough time, can also use a single number, singular process receiving posture, dual processing different sensors or calculation, the press 30 hz processing is also enough,

On this basis, the simple basic flight movements can probably,
If you want to do automatic flight, only need to do a read/write module provides a series of flight data
If you want to do to learn, you just need to keep all the control data can

Have on each module I tested, basically reached the use requirement,
Receiver data drift around 16, can make do with the, basically stable,

CodePudding user response:

refer to the original poster weixin_42039994 response:
first of all, on the industrial development, I was a newcomer, learning control in the arduino has four months, although make software before, but the C language and hardware are a novice, here to discuss the major topic is because baidu information is too little, want to come here, the author especially I don't like to read other people's code, all only oneself study,

Many people think that the nano is too small, could not achieve flight control, it is said that the apm is not a piece of arduino,
Although the nano resources is too small, but if save up and use, do a simple flight control is possible,
A lot of people want to design a flight control, but how to build the framework of all the time,
I designed a simple flight control framework, hope the great god of all stripes on brick, if don't even focus attention, that I too too failed,

Said the first design goals: to do a simple flight control, not business needs, to achieve the basic flight control, such as providing stability and control support,

Listed first flight control design content list

1, read six channel receiver data
2, read the gyro attitude data
3, read the other sensor information, such as GPS information
4, all the algorithm implementation of
5, control motor or servo

Process goals: read the receiver control requirements, read the gyro attitude, combining both stead to or the action of steering gear, can achieve good, no other considerations,

First of all, the whole framework is a receiver as the center, why? Because the receiver is active data sources, all other tasks can be viewed as a passive, I mean, the receiver of the data is sent by the receiver, rather than I come over, when data arrives at, if I don't receive the data in the past, a data frame, so the receiver must first arrange read data, after the receiver full access to data, consider making time to deal with other tasks, probably is also for this reason, it is said that the APM is to use a separate receiver chip to read data,
Thankfully, receiver of the frame frequency is 60 or so, that is to say every frame takes 17 milliseconds, and a frame six channel receiver reads only need 4 milliseconds, about 13 milliseconds to deal with other things, enough,
When you complete reading the receiver data and save all 13 milliseconds to deal with other tasks, your flight control is accomplished the basic framework (from),

Here said the steering gear and motor
Steering gear and motor control frequency is 50, 20-80 can actually, slightly higher as more stable, I tried, 60 or so can work very well, so I use the frequency of the receiver, each receiver a frame of a motor, so for the rest of the 13 milliseconds, can spare two or three milliseconds to control all of the steering gear and motor, I tried, 4-6 steering gear is quite stable, good, we have 10 milliseconds,
The other is to say, to read gyro attitude calculation in less than 3 ms, including calculation, timing more than two milliseconds (such as complicated calculation), ok also
Regardless of the other sensors,
Algorithm implementation mainly combine data receiver and gestures after processing, it is concluded that the need of motor servo data, this is not time-consuming,
Handle all of these can be in the range of 60 hz, if afraid didn't have enough time, can also use a single number, singular process receiving posture, dual processing different sensors or calculation, the press 30 hz processing is also enough,

On this basis, the simple basic flight movements can probably,
If you want to do automatic flight, only need to do a read/write module provides a series of flight data
If you want to do to learn, you just need to keep all the control data can

Have on each module I tested, basically reached the use requirement,
Receiver data drift around 16, can make do with the, basically stable,

Using PPM to read the receiver, the rest of the time is enough to handle other operations, but read data is a bit strange, also in further experiments, what I use is rodek receiver, with PPM,
  • Related