⬆️ ⬇️

Homemade lights on quadrocopter

I'm tired of static lights on a quadric. I decided to revive her a little. There was an idea to make the backlight dependent on the position of the stick sticks. The forum already has solutions, but I would like to describe my version and present it with the most clear description.

LED strips are glued to the rays of 2pcs per beam. Front - white, rear - red. He made an analogy with a car to make it easier to navigate.

The backlight should work as follows: at the initial position of the sticks (gas at the minimum, the rest in the center), the backlight does not light up, as the gas rises, the backlight lights up and all the rays are constantly illuminated. Further, when the yaw stick is rejected, make an imitation of circular rotation to the left and right, respectively. When deflecting the roll and pitch sticks, blinking the illumination of the rays in the corresponding direction, the remaining rays should be highlighted constantly. When the sticks are deflected diagonally, only one blink. When returning the sticks (except gas) to the central positions, stop blinking and turn everything on. Consideration should be given to stick trimmers and possible gas and pitch reverses.





Sketched a picture of behavior:





Next, collect the scheme. You will need an AVR controller capable of operating at 16 MHz, 4 NPN transistors (for example, BC846B), 12Volt LED tapes, 16 MHz crystal resonator, two 22pF capacitors, 5 1kOhm resistors, a button without a lock or jumper. The jumper is used to enable the mode of setting the limits of sticks triggering (taking into account trimmers) and adjusting the gas reversal and pitch (done for my Turnigy 9x equipment and flight controllers QC and Multiwii; in other configurations, you may have to rewrite the code). Under the use of other voltages and LED strips need to make a choice of other transistors.

')

Electrical schematic diagram:





Used ATMega8A controller from cheaper and more affordable. For the firmware, you can use either the “5-pin” programmer or any other programmer. I used USBasp, because it is supported by the Arduino development environment. On-board made in-circuit programming connector. First you need to set fusions on the controller to use external quartz at 16 MHz. Exhibited the program "eXtreme Burner - AVR". Fuses Low EF, High C9. Capacitors for quartz are better to use 22pf, but it should also work from 18 to 30pf. When connected to the receiver, the copter made parallel connections of the conductors that I connected to my device. Powered the device (+ 5V) from the free contacts of the receiver, LED strips (+11.1) from the power distribution board from the battery to the engine controllers.



The device needs to be configured. I recommend to produce with REMOVED propellers in order to avoid something terrible, because may work reinforcement during movement of the sticks. It would be better to even open the wiring going to the flight controller or de-energize it.

Setup order:

  1. Set the jumper on the device when the power is off.
  2. Turn on the remote, receiver and device.
  3. The front LEDs will blink long and short (_.) And then everyone will quickly blink short (... ... ...) for 15 seconds.
  4. During blinking, the sticks should be moved twice to the extreme angular positions. I did counterclockwise rotation.
  5. At the end of blinking, the LEDs go out and the back ones blink long and short (_.), Indicating the end of the boundary setting and writing to the EEPROM. After that we remove the jumper.
  6. Next, set aside 5 seconds to set the reverse gas, during which, if necessary, set the jumper. If the jumper is not installed, the reverse will not occur, respectively, the installation of the reverse will turn on if the jumper is installed. After 5 seconds, the left front and rear LEDs will flash. At this point, the jumper is polled and written to the EEPROM. After that we remove the jumper.
  7. Next, set aside 5 seconds to set the reverse pitch, during which, if necessary, set the jumper. If the jumper is not installed, the reverse will not occur, respectively, the installation of the reverse will turn on if the jumper is installed. After 5 seconds, the right front and rear LEDs will flash. At this point, the jumper is polled and written to the EEPROM. After that we remove the jumper.
  8. Turn off the device and turn on with the jumper removed.
  9. Next, you need to check the work. We begin to raise the gas and the light should light up. If it lights up at the lower position of the stick and goes out at the top, then it is necessary to reverse the setting of the gas. Check the response to the deviation of yaw. The backlight should flash around in the direction of deflection. We check the deviation of roll and pitch separately, as well as along the diagonals. If the rear LEDs blink when the pitch stick moves up and the front LEDs flash down, it is necessary to reverse the pitch settings. To reverse, it is necessary to perform the adjustment again from the beginning (point 1).




After tuning, if wires or power were removed from the flight controller, return all connections. If after adjusting the device the sticks were trimmed, the setting should be done again.



The first version of the firmware. Hex file by reference:

r_lights_v1.rar



The blinking while yaw was not very much. Made everyone blink all the same 10ms on / 10ms off. On roll and pitch really liked it.

The second version of the firmware is the version without rotation for yaw.

r_lights_v2_wo_yaw.rar



Pros:

Dynamic design of the copter.

Adjust the reverse.



Minuses:

After trimming, you need to re-configure.



How it looks in practice:





If anyone is interested in the idea - try and share reviews!

Source: https://habr.com/ru/post/164491/



All Articles