')
While we were tormenting gyroscopes and accelerometers, a more detailed scheme of the device loomed in the heads and on paper, taking into account the assumption that the stabilization functions and the remaining functions should be divided between two independent processors:
Multicopter components
AHRS CPU - receives from the ADC (for example, let it be two low-cost MCP3208 , working on the SPI bus) digitized data from the sensors (50 times a second is enough for the eyes), filters them, calculates the slopes of the device, calculates the necessary rotational speeds of the propellers (perhaps by the PID control algorithm, the simplest and most popular), sends the values ​​of these speeds to the I2C bus controllers, and they, in turn, feed the motors ( vector control, if not mistaken). There are still a lot of free legs and some computational abilities to control the servos that align the camera (servos are standardly controlled by the PWM signal).
Sensors - previously described 3 gyros, a 3-axis accelerometer, a 3-axis magnetometer (remarkably shows orientation in a plane parallel to the ground), optionally a pressure sensor for measuring height. All sensors can easily be taken as analog ones, they are cheaper, the two above-mentioned microcircuits will be engaged in fast ADC conversion (one will not have enough channels).
Pilot CPU - directly autopilot, setting the second microcontroller the desired slope of the device and the camera and providing communication with the ground. It also measures the voltage on the battery, receives coordinates from GPS (possibly to fly to key points recorded on an SD card, or record your route on it) and transmits commands to the camera controller.
Camera control is a microcontroller that will be useful for controlling the camera (shutter, zoom, etc.). It can transmit commands to the camera via IR , or directly with wires.
Video transmitter - it is most convenient to take a standard one , such is used in video security systems.
Radio modems - you can take the popular X-Bee, which uses ZigBee protocols (2.4 GHz), but it will be much cheaper to have a modem based on the CC1100 chipset (433 MHz), it has good performance and detailed data.
A laptop will be used as a control panel (as well as to display the status of devices), and another microcontroller will be needed to communicate with the modem.
Designing the main board
For our purposes, the computing power of two ATmega microcontrollers is enough (for others we don’t know how to write software at all), the binding for them is minimal. We draw standard wiring of input-output ports of microcontrollers to connectors, to which we will then connect peripheral devices on the docking boards.
The important point is that the peripheral devices operate at different voltages: the servos and motor controllers are 5 V, and the modem, gps, sensors and sd card are 3.3. Fortunately, the stress distribution turned out to be profitable. The microcontroller responsible for the stabilization of the multicopter will operate on 5 V (this will also provide us with the ability to use it at 16 MHz), it is also connected to the 5V I2C bus leading to the motor controllers and 5V SPI connected to the 5V ADC. on the other hand, the ADC compares signals from three-volt sensors with three-volt reference, so everything is combined). The microcontroller pilot operates at 3.3 V (which limits its clock frequency to 8 MHz, but we don’t need it anymore), and is connected to the rest of the peripherals by 3.3 V buses. The question remains how to connect two microcontrollers. We were lucky again, there was a more or less free I2C bus, which has only two wires and a simple voltage coupling circuit:
It should be noted, before that, I almost didn’t deal with electronics, and a lot was new to me. But my colleague in our multicopter business helped me (the scheme described was born in lengthy discussions with him). I started to draw it all in Sprint Layout, but that fellow advised Proteus, and it was very good advice. Proteus is a great and convenient circuit design system, so I recommend it to anyone who is going to do this difficult job.
Next, draw a diagram with all of our devices:
I don’t remember why I didn’t capture the whole circuit when I was preparing the screenshots for publication, but only a pair of connectors and a power supply unit providing us with separate power supply of 5 V, 3.3 V, and 3.3 V filtered for power supply were not included in the frame sensors
We switch to the PCB layout mode, and here the most creative process begins.
When a compromise between perfectionism and curvature is found, you can relax by turning on the 3D visualization of the resulting board:
The entire board took about 15 centimeters in width and the same in length. Similarly, we draw docking boards for peripheral devices (these docking boards can be conveniently inserted into the connectors of the “motherboard”).
Board making
We made them on a slightly different technology, beautifully described by LJ-user alex_avr2. Its essence is that the pattern of the tracks is printed directly on the foil (it is rather scary to fill the printer with paper in foil), and then, after pressing the iron, the board is etched along with the foil. Due to the fact that you do not need to peel off the substrate, the pattern is clear and beautiful. Another tip for those who decide to engage in electronics - the quality of this method is much higher, the reject rate is less, and the production is easier.
We make a docking board for GPS:
And the main board: (in the second picture you can see how the relief of the tracks appears after pressing the foil with an iron, and in the last one everything is not as bad as it seems, it’s just polishing that)
Now you need to drill and metallize the holes to create contacts between the two layers of the board. At home, it is extremely difficult to achieve “fair” metallization (when metal is deposited on the walls of the hole), therefore copper wire is inserted into the hole and sealed from both sides. However, I decided to try a small variation of this method with the riveting of the wire (so it sticks out less and is easier to solder). Two things that we wound on the mustache this time: it is very difficult to drill a lot of holes with a home-made mini-drill, and if you rivet the wire, the area of ​​the contact wheels needs to be done more.
And yet, for convenient wire feeding, it can be tucked into an automatic pencil instead of a slate pencil, and a simple device will help to drill holes strictly perpendicular to the board. However, perpendicular drilling will not help if the board layers are not precisely aligned, so for those who have hands like mine, I would recommend using a photoresist .
Rama, first try
For fun, I will tell you how not to make a frame. It should not be made of flimsy PCB and carbon fiber profiles with a section of 5x5 mm, they will not withstand anything more than a 300-gram quadrocopter, for our purposes we need at least 1.5 mm aluminum and centimeter-diameter aluminum pipes. Well, if you want very much beauty, strength and low weight, then there is only one option: carbon fiber in several layers, impregnated with epoxy resin ("carbon").
In the last photo, one can notice what capaciously describes the concept of Epic fail: the ends of the propellers touch each other. I don’t know why, but I didn’t get anything from the above (and also below) the first time. If it was possible to screw something with the wrong side, I did it, although I rechecked it more than once. Sadly
Section that did not want to write
I have bad and good news for you. The bad thing is that all the “creativity” ends there. We realized that the project has already spent more than a thousand dollars and about a year of time, and the results, to put it mildly, are just around the corner. Writing software more or less from scratch takes at least another six months time, and debugging takes as much more. And given my krivorukost and limited in finance, you can say with confidence "will not take off."
Sadly of course, but we did not pull this project. I want to believe that someone will succeed better than ours, and I will willingly help such people with tips and information that has been deposited in my head and on the hard disk after studying a lot of material.
But there is good news: in the next part, we will finally move on to practice, and still collect this devil-machine (although again not without misfires), but already on ready-made software and hardware. Thank you for your interest in this topic and useful comments to the previous (and possibly to this) parts.
Conclusion
The development of electronic devices is a very interesting and exciting activity. But having no experience in this matter and a team of inspired and energetic colleagues, only experience will remain in the bottom line. Well and, maybe, not boring thesis.
Do not overestimate your strength, recruit more people (two heads are better than one, as well as two purses), preferably professionals in any of the relevant areas, and you will succeed at times more than ours.