Showing posts with label Pi Zero Drone. Show all posts
Showing posts with label Pi Zero Drone. Show all posts

Pi Zero Drone: Part 9

Quad Post #9: Calibrating ESC Manually
Each of the ESCs (Electronic Speed Controllers) on the quadcopter has to be calibrated to the RC transmitter signal so that the full range can be read on the quadcopter. To start the calibration procedure first ensure the following steps are done prior to ESC calibration
  •     Bind RC transmitter to receiver and calibrate the transmitter using the steps from blog post #8.
  •       Disconnect ALL propellers from the quadcopter.
  •       Disconnect any external power source i.e. USB cables from computer and Li-Po battery.

    This method of ESC calibration is referred as the “All At Once” method. Here are the steps:
  1.       Turn transmitter on, and set the throttle to maximum.
  2.       Plug in Li-Po battery.
  3.      Wait for the 3 signal LEDs on the PXFmini to start light up in sequence
  4.      Once the LEDs illuminate, disconnect the battery. (Keep throttle at maximum!)     
                     The ESCs are now in calibration mode


            5 .       Reconnect the battery and wait for LEDs to light up in sequence and buzzer will sound.
            6.   Once buzzer and LEDs light up in sequence, move the throttle to minimum
            7.   You now have full control of the motors with new ESC calibration. 

Pi Zero Drone: Part 8

Pi Zero Drone Post 8: On board Instrument Calibration
From the on screen response to tuning PID controllers, APM Planner 2.0 software can give a newbie quad user (myself) a deep understanding of what it takes to control this quadcopter. The software is capable of display real time response of the IMU, RC controller and other instruments you wish to fly with. This post aims to give a brief introduction and how to calibrate your instruments while I wait for new ESC to come in from Amazon.
The APM Planner 2.0 has a very interactive GUI that can be used for multiple vehicle types. A full in depth tutorial of the software can be found on ardupilot.org/planner2/. First step is to download the software onto your computer and follow the instructions on the screen. To connect to the quadcopter, first plug in the battery and wait for the buzzer to sound. This time you can connect to your quadcopter using the 5 GHz Wi-Fi signal.

Steps to configure the Wi-Fi signal can be found in blog post # 6.

After you have connected, the on screen altitude indicator (Very similar to one on an airplane) should start responding to the onboard IMU. Now the calibration can begin. In the APM Mission 2.0 tool bar select ‘Initial Setup’ >> Mandatory Setup. From here you can pick the frame type, this drone uses the first X-style frame type.



Compass
Select Compass to start the calibration. The Compass will need a live calibration by rotation the quadcopter in the air slowly around all axis (front, back, left, right, top and bottom). This will be done for 1 minute. Calibration offset will be created and stored for future missions.  

Accelerometer
Selected Accel Calibration and the calibration wizard window will appear. Be sure to have the quadcopter on a flat surface and select Calibrate Accelerometer and follow the prompts on the screen. It is important not to move the copter immediately after pressing continue for each process, this may lead to skewed stored parameters.

Radio Calibration
Remove all propellers and bind the RC transmitter to the receiver.
Select Radio Calibration and start the calibration by pressing the Calibrate button. Move the sticks and switches to the maximum positions. When you feel that all the movements are correct, press End Calibration and the offsets will be stored for that radio controller.
Attach “RC_Calibration.jpg” here
Flight Modes
This setting can be used to assign switches on your transmitter to modes like loiter or stabilize. You can set your own settings based on what you wish your quadcopter to do.



Pi Zero Drone Post 7: Modular Body

Quadcopter Post 7: Modular Design

To the reader who has a smaller print bed and wishes to print this part I have designed a modular frame that will hold all the same components as before. Each print will not exceed a 114mm x 114 mm

I have attached the STL files with this post 

Here is a link to the STL Files:


Pi Zero Drone 6: After First Flight and Mods

Quadcopter Blog Post #6: After first flight and mods


After the failed test, instant modifications to the design must be made. The most importantly was to protect the hardware so that no more time and money is lost waiting for parts. I have added a 3-D printed ABS cover that will protect the PXFmini connections and also add some style to the quadcopter. The design of the cover can be seen in the picture below:


CAD MODEL OF ABS COVER


In addition to protecting the quadcopter brains, the controller of the quadcopter has not been as responsive. Some research lead to a possible solution, the APM software that I am connecting to via Wi-Fi was interfering with the signal of the RC controller. The theory is this the Wi-Fi of the PXFmini operates at its own frequency band and the same goes for the RC controller. If the PXFmini comes close to the same band the PXFmini signal will be distorted and must be changed. In the US, a certain frequency band must be used for operations set by the Federal Communication Commission (FCC). Without getting too much in depth, you must choose the channel bands if you are operating in 2.4 GHz (Channel 9) or 5 GHz (Channel 40). Check out the chart below:


CHARTS OF FREQUENCY BANDS (2.4GHz Bands & 5 GHz Bands image)  



To check if the PXFmini is operating in the right channel use this command:
WIFI HOTSPOT COMMAND

Check the channel # in the following file:
WIFI HOTSOT SIGNAL FILE
Make sure that the channel # is 40.
Now check the signal strength using this command:
WIFI SIGNAL CHECK

After it is changed, connect to APM and turn on the controller. The interference has now been fixed.

Pi Zero Drone: Test

Quad Post 5: Test

Check out the video to see how to arm the quadcopter.

Arming Video:  https://www.youtube.com/watch?v=9BmgpX3vKM0

Quad copter test 1….. FAIL

Crash Video: https://www.youtube.com/watch?v=GUAmSo_e-a0

Crash Picture


After this test the PXFmini GIPO pin connection sheared from the PCB board and became useless. But from the video evidence I suspect that the trim on the remote may have been to an extreme right and also a bad ESC calibration. I am waiting for a new PXFmini to come in and I will retry.

There have been some modifications of the design on the quad:

  • Shorter legs with Lipo Battery slot made from ABS plastic.
  • Roll cage that will save PXFmini from future crashes.

Pi Zero Drone: Part 4

Quad Zero Post #4: Calibrations
              In-between post there have been multiple snags in getting the quad copter in the air. Each are listed below in order of headaches:
1.       Power Sources: I would like to thank Ohms Law to convincing me that overloading the Pi Zero with too much voltage will indeed fry the voltage regulator. This will cause the PCB to smoke and make your board useless. DO NOT CONNECT THE POWER MODULE AND THE 2A POWER SUPPLY AT THE SAME TIME. I blame my lack of attention and ignorance for this mistake. My solution is to order a new Raspberry Pi Zero but in the mean time I will continue the build using a Pi 2 B+. This does have its advantages in more CPU power and faster processing. I will like to compare the two computers for future builds.
2.       ESCs: My original ESCs were HiTech 18Amp with no BEC power connection which became important in powering the ESCs for ultimate control. I then traded them for 12A Afro ESC.
3.       Wi-Fi Dongle: This part of the project had me researching network protocols and taught me a lot about specific IEEE protocols that help me pick the appropriate adapter. Because of the Wi-Fi hotspot on the PXFmini emitting a 5 GHz band and my failure of creating a similar frequency band, I choose Netgear AC600 Dual Band wireless AC adapter. This adapter is capital of emitting 2.4GHz and 5GHz frequency band.
Once these changes were made the Wi-Fi hotspot from the PXFmini was visible and I was able to connect using APM Mission Planner 2.0. Once the connection was made the accelerometers and gyroscopes were active and receiving positioning from the quadcopter.  Steps to configure the copter along with the radio controller and ESC can be found on the link:

Rotor Direction:
              To successfully control the quadcopter the Rotors have to spin in two different directions (Clockwise – C & Counter Clockwise – CC.) The figure below indicates what motors spin in the desired direction. 




 To test this without the propellers attached, I placed small sticker tabs on each rotor and determined the rotation. To change the direction switch any two leads and double check the direction. Now is time to test!



Michael Perry

The Pi Zero Drone Part 3: Connecting the PXFmini

Pictured below is the setup of the PXFmini RPi-0 shield. You can notice the lead pins go straight into the Pi and must be shouldered to ensure a good connection.
The PWM output pins will be used to connect the ESC and rotors. From the Erle Robotics website the diagram of the connections are pictured below.
 
There are also multiple ways to power the controller, I used a Power Module that plugs into the power port on the shield. Power from the lipo is used to power the board as well as the ESC. When I am developing language on the Pi’s terminal, I use a 2A power supply into the power port on the Pi. Both cases are shown below. 


To connect using a RC transceiver, the 9th pin is PPM enabled, that is Pulse Position Modulation. This allows multiple PWM signals to be used using one input. If you take a look on the previous post you can see the connection pins schematic, I used this to connect the ESCs. With the vast number of radio controllers at the Boca Bearing Workshop, not one is PPM enabled. Any of the controllers can be used if a PPM encoder is used to convert the PWM signal to a one wire PPM signal. These are cheap and easy ways to use any radio controller that you are comfortable with.  To date, I am still waiting on my encoder and once it comes in I will post a video of everything connected with a flying quadcopter. 







The Pi Zero Drone Part 2: Construction of the Frame

With the correct thrust calculations from the Gartt 2300KV motors being done. I can now begin the design of the quadcopter. I would like to include that I have no real quadcopter experience other than cheap micro-copters and have spent a lot of time breaking props and arms with those. Any information from design has been from online sources in forums and experience in engineering projects from classes and extra-curricular clubs. This would be a great build for anyone excited about learning new skills and not afraid to break a couple of plastic parts along the way.






The Pi Zero Drone Part 1: Introduction

Figure 1: X Frame Quad Copter
Introduction: The multirotor copters or ‘multicopter’ is a highly popular recreational hobby but are also being implemented into professional use in cinematography and even surveying landscapes that may be hard to access by foot. There are many types of multirotor copters that come in various sizes depending on the cargo onboard the copter. For this build a quadcopter with 4 propellers will be the main focus. Now comes the time to pick the style of the frame. Popular quadcopter frames include X and H frame designs. Just as the shape of the letters depicts, the location of the rotors offer minor differences depending on the use of copter. X frame quadcopters are a highly stable platform with endless possibilities for various motors and propellers.