Sunday, August 25, 2013

Arducopter tuning history

Update Aug 25, 2013 3 scary flights with the arducopter today. One of the first was when I setup an auto way-point flight and when I started the flight it started heading in a slightly off direction than I expected it to go. At first I thought it was just I judged the way-point on the map a bit off. But suddenly without any input to the controls the arducopter suddenly stopped flipped almost completely sideways for a moment. It had 20 meters of altitude so I froze for a moment prepared to take it to stabilize mode and bring it down. Also now this position had moved directly over the pilot flight area. I must have screamed or something like “shit what the FUCK” very load since everyone seemed to have taken notice. The aircraft at that point had only lost about 3 meters of altitude even after the flip so I put it in stabilize move and moved it to a safe location and landed it in one peace in releaf. I sat it down and took a break after that and tried to think what could have happened. I did note after the flight that the way-points that I thought I had programed were not updated in the aircraft and that it still had the way-points from soi 5 that was about 12km from where we were flying. So lucky I got it into stabilize mode before it flew away forever. But that still didn't explain why it did the near flip over the flight area. So after that I setup the fence mode thinking that would be safer to prevent the aircraft from flying off if I were to fail to get to stabilize mode in time. But that ended up causing another bad and more scary flight that the last one. This time when I hit the fence mode barrier at 30 meters away from launch it was having problems returning to landing in RTL mode. This day we had very heavy winds up to 12 and 17mph at times. Just so happens at that moment was one of those 17mph wind times and the settings for auto flight were setup to work in only 9mph winds with the large heavy 6000mah battery that I was flying with in this flight. So the auto mode didn't have enough flight authority to over come the wind so it continued to drift farther away from me instead of returning to the landing zone. I could see it wasn't getting closer to me and I knew it was in RTL mode from the android mission planer voice that signaled the present mode change. So again I thought no problem I'll override it to stabilize mode and bring it back. But every time I would try to put it in stabilize mode the aircraft would see it was outside the fence and force back into RTL mode. So I kept trying to over come the conflict of the aircraft not returning with just short durations of stabilize mode until I finally got it back within the fence mode boundaries. When I finally and barely got that to happen I was able to bring the aircraft back to landing zone and land with out any more problems. So that fence mode seems a bit scary if you are flying on a windy day and don't know if auto modes can handle wind drift rates. Later I tested Position mode with the 6000mah battery and it seemed to hold position OK in the wind at that time but it was only about 11mph when I had a chance to test it as the winds were not consistent. It did circle the location lock position with a 2 meter radius so not perfect but it did have authority to fight the wind. I also later found that the way-point program switch doesn't always work in the android. I'm not sure how to verify that the way-points have been programed as compared to the PC version of the mission planer that has a read way-points button that can be used to download the values in the aircraft and view them to be sure they are what you want. I don't see such a button on the android version of the software. What I think seems to work to pull the present way-points from the aircraft is if you reset the android software and unplug and replug the 3DR telemetry TX/RX on the android to verify that it has a link that is working. It seems the plug sometimes gets disconnected on the 3DR and there is no easy way to know if it's working or not. Update Aug 23, 2013: Todays tweaking on Paul's Arducopter 3.0.1 had a bit more success than yesterday. Partly due to just a bit less wind on this day but still a bit to keep it challenging. This time we got altitude hold to stop it's quick oscillation. This was done by lowering THR_RATE_P down to .3 from what is was set to 1.5. It originated value started at 6 so we have moved it a lot from the defaults. With this change we don't have the pulsing quick reactions to altitude change. Now it has a bit of a tendency to drift in altitude up to 1 – 2 meters if I do aggressive lateral push movements before it slowly creeps back into position, but when in a stationary loiter it holds altitude quite well. Also changes were made in LOITER_LAT_P, LOITER_LON_P down to 1 (the original default value in 3.0.1) were it was 1.8 in yesterdays setting. With this value in the low wind we had on this date we held a good loiter position without too much unstable and sometimes scary movements from the previous values we had set yesterday. Also to prevent the loiter mode from going in a circle around the loiter position the values of HLD_LAT_P and HLD_LON_P moved up to 3.0 from the last value of 0.6. With this combination of values loiter seems to work with both size batteries at least in these wind conditions with gusts of up to 11 knts or a bit more. I could also snap it into loiter or position as I had a lot of lateral movement in the aircraft before setting to loiter without any problems. So I will try these present values in a few other conditions to finalize on this as the settings. Also I have setup another model on the DX6 TX radio called APM_SLOW that has limited the throttle to 75% max throttle where it was originally (and still is in APM_QUAD) to be set to 125%. This will require testing as it's not been flown with this value yet. With APM_SLOW setting I plan to simulate the max vertical acceleration that is available in the H2OQUAD. I failed to find a way to change max thrust in the APM config settings and this might be the best way as you can change the speed with the TX radio without having laptop or android system available in the field to change them. So we will see how that goes and see how Paul wants to set it to his preference at some point and depending on the flight application. Update Aug 18, 2013: Today we got a few more modes tested as working on Paul's Arducopter. We made a few changes to basic gains of pitch and roll and increased gain for loiter rate to hold even in winds of up to 8 knots or maybe more within 3 - 4 meter radius. I also cranked up throttle altitude gain to make alt hold work with the bigger 6000mah batts. See my published param files for Aug 18, 2013 to see the details of the end parameters of todays flights, and you can compare them to the day before or back to day one to see what has changed in the params over time at the temp FreeNET site that will at some point be moved to my Google drive site at some point to be preserved for long term archives when it all works or when we end working on it. We also tested altitude hold, acrobatic mode and way point auto mode between 2 way points. I have been having some problems with altitude hold when I use different size batteries as we now run from 2200 mah to 6000 mah batts that have a big difference in mass. I am working on figuring out how to make them both work in altitude hold and loiter mode to some reasonable degree without having to make changes to setting in the field. So next planed mode development is to setup a fence mode for the soi 5 lot and another for the stadium with a cylinder shape fence to see how well we can get that to work. The fence mode is supposed to prevent the aircraft from flying outside a boundary so good for training and for safety. Maybe you could learn to fly aerobatic flight with a quad in a fence without worry of crashing? That would be very cool if at all possible. After that or at the same time I would like to try the follow me mode to track an android phone that has gps and version 3.1+ version of android. As far as using this for camera video work, the system would require some changes in vertical gain to make it more stable in that axis. The mass of the camera and gimbal will add some stability and will require increase of P gain in roll and pitch in stable mode as I have it tuned down to 2.5 P gain for stable in pitch and roll and note it's already slow for the heavy 6000 mah batts in roll and pitch movement with these settings. I might also change yaw gain down a bit for a video camera as it's now cranked up to 4.5 P gain for yaw. But this can also be adjusted with the TX radio with dual rate settings, so not sure how far down I will need to go for yaw. I'm not sure what would be required to get the added mass of the camera equipment to get loiter and altitude hold mode to work stable enough to film. But we already have the servo gimbal in the present inventory that we can try that the APM can already drive to stabilize and steer a camera at a target in auto mode. So that will be fun to try at some point. At some point when it gets stable we will also have to try the FPV equipment on it. This again will require tuned down vertical gain to not be scary to fly. Another cool thing we learned today thanks to Tone that just happened to be at the stadium this day is that the default settings of the 3DR telemetry being set to network 25 that he was able to see my Arducopter data feed without any changes of settings that he had set for his APM aircraft that he flew this day. He found that if he changed his settings to network channel 60 that he could no longer see my feed and I could no longer see his and we no longer conflicted in operation. So in the future I might want to change my network to some random number other than 60 in hopes the next 3DR telemetry user won't be on my channel or network. The other cool thing is If I wanted I might also be able to monitor and control a flight from more than one location on a separate 3DR telemetry unit if set to the same network and made sure not to setup conflicting traffic.

Monday, August 12, 2013

New APM arducopter quad first test flight

As we looked up and saw kun Ooh's truck arrive at the Pattaya Stadium RC field and with a smile on his face and a nod, we knew what that meant. Yes the new toy (APM ardupilot quadcopter) was finished and had arrived. This is a 550mm quadcopter that Paul custom ordered from Kun Ooh that designed and constructed it for him. Kun Ooh came back to the table with the new ardupilot quad without props installed yet, ready to bind the receiver to the Spectrum DX7 and configure mode and other settings. It looked very professionally constructed with good quality motors and a good stiff tough aluminum frame. The best part is the APM arducopter flight controller with GPS, 900mhz telemetry and the optional current voltage sensors added and some cool led lights to fly it at night also added. This APM flight controller has so many cool modes and features you would not believe me if I told you including way point autopilot and control from just about any android cell phone for support for “follow me” mode and much much more. After some effort from Kun Ooh's and Kun Jit's to figure out how to setup the mode switches on the Spectrum DX7 TX radio we finally got a chance to try it out in stabilize and loiter modes. We also had RTH (return to home) and auto pilot mode available on the radio but didn't test them yet. First test flights were done by Kun Jit our field expert test pilot. The first was a very short flight as an adjustment in gain, trim and others were needed to make it flyable. After a few more adjustments Kun Jit had it flying nice and stable. This quadcopter also has full telemetry that we could check out on Kun Ooh's laptop at the time. From the laptop we could also setup way points, view location of the aircraft on a moving map and change PID gain values and much more. We also did a test using Paul's new Android tablet with andropilot installed that also worked with the telemetry device plug and play to control the same things that can be done on a laptop. Then Paul asked me to give it a try before he had ever flown it. So I was the proud second pilot to get to try and fly the new toy. I was very slow and careful not to over control and found it much more responsive than what I was used to in the gps quad or the h20quad. As I got a bit more comfortable with the controls I started to test the vertical acceleration with just 60% to 70% throttle it was already flying faster than I could handle at the time. By this time it was also dark but no problem for this quad as it's totally laden with a perimeter of led lights that make it easier to see at night than in the day time. But I'm not accustomed to flying in the dark with lights so that's something that will require a bit of getting used to for me also. So I only did close flight no far away high speed yet. Also I had Kun Ooh reduce the P gains from 0.15 down to 0.10 but it still seemed like too much gain for me and no noticeable difference that I could detect from the change. I also had him try adjust the vertical gain down from 0.7 to 0.5 for P. But I again detected no change when I did another short test flight. Kun Ooh suggested we should continue to make the changes in the dual rate of the Spectrum DX7 RC TX. I agreed that would be what we would try next later. I also noted that the battery telemetry data wasn't being received at the laptop but Kun Ooh had that figured out in less than 5 minuets after I detected it and told him. So from that we considered the preliminary flight test complete and planed to do more tests in the lab to learn more about mode setup and way point input and PID control changes made over telemetry with the android tablet and maybe a phone. I got a message this morning from Paul that he had already flown a few more batteries on the APM quad at the beach last night with the lights. This is his input so far: [12:34:42 AM] laserpaul: I have a blog to write to you [12:35:02 AM] laserpaul: needs plenty of adjustment to come close to the H20 [2:27:27 AM] laserpaul: lets put it this way. I deserve the silver star on my forehead. Went through six batteries last night flying at the graveyard, soi 8 soi 10 and soi 11 or so. Every one loved the lights, but it was a bitch to keep stable. I know something is wrong. If you tell me in one week after tinkering with this quad that this is the best it gets, I will be disappointed. Very sluggish on the ascent but goes to full throttle like having too much expo. something very wrong you will see at soi 5 today. So looks like we have a road ahead to learn about what makes these new arducopters APM flight controllers tick. It looks like a lot of fun ahead to tinker and try all the new modes at our disposal. The “follow me” mode sounds like one high on the list when we get it figured out. It should be cool to be able to control and setup with any android phone to do just about anything. I can't wait to try them all and start creating new ones. The source for the software is open source so there are no limits to what I and others will end up being able to do with them. A fun future awaits.

GPS tube quad problems with changes from 3S to 4S batts

Fun day at the Pattaya Stadium field today with both the “gps tube quad” and a brand new APM ardupilot quad that “Paul the toy man” just received this day from Kun Ooh. We got to the field early before Kun Ooh arrived so we played with the “gps tube quad” that I brought with me on my bike. The main change on the “gps quad” was that we modified the settings in the naza M flight controller to allow it to run off 4S (4 cell) lipo batts instead of 3S (3 cell). The current draw on the 3S batteries was destroying all my 3S batts in my collection. With the increased 4S cell voltage the batteries could handle the current and also provided the needed additional watts to allow for longer 13 minuet flights instead of 3 – 6 minuets with 3S batts. We had already tested the 4S battery configuration at the beach the day before so we knew that was working OK. The first flight started out very good but ended in disaster. I started out flying very conservative and then I started pushing the sticks to the max positions in both thrust and roll and yaw to see how it performed. It seemed to fly fantastic with just a bit more power in thrust from the higher voltage batts that were providing a bit more max current to the motors. I was experimenting with methods of high speed decent first strait down that puts it into osculation and a second where I was moving forward at the same time as the decent. The later seemed much smoother until I approached the ground and started to slow the decent too quickly. As I was only about 3 meters above the ground it seemed the vertical gain thrust started to pulse without my input on the throttle. I felt I was loosing control as it seemed the flight controller had too much authority as I wanted to give less throttle it would provide more. And when I wanted more throttle it wanted to provide less. It was like osculation between me and the flight controller as to who wanted what. At that point I just wanted to put it on the ground and figure it out but that ended putting it down when it still had lateral movement so when it hit the ground the quad flipped over upside down and broke two props. The tube frame was undamaged but some of the motor mounts had also been rotated a few degrees. After replacement or the props and realignment of the motor mounts I took it for another flight. But now it flies with osculating vertical without input to the throttle even when I'm just hovering it will suddenly pulse and gain 3 feet then suddenly drop back down 2 feet. I recall noticing this action when we had a small crash on the beach the day before when Paul crashed it. At that time I found the motor mounts miss aligned and that seemed to partly fix the problem. Also note that the same prop that was slightly chipped at the tip (out of balance?) on Pauls crash, was still installed on the “gps quad” as we didn't have a replacement for ccw prop at the time. After a few more tests and one more minor crash (this time by Paul with an attempted manual flight mode flight) we ended up retiring the gps quad for the day. I also learned later it was not manual mode but atti mode that we played with on the gps quad when it crashed. That disables the gps as input but I think it still has the barometric pressure used to stabilize altitude. So that could partly be what's causing the problem with the gps quad. Over sensitive barometric gain settings. When I got home I did a gyro calibration check and it all looked good but I calibrated the gyros anyway just to be sure and will replace the chipped prop in hopes that will fix it. I also dropped the vertical gain from 90% to 80% as I read too much vertical gain can also cause this type of osculation. So it is now ready for another test flight with the new settings in hopes that we have isolated the problems.