Showing posts with label Problem. Show all posts
Showing posts with label Problem. Show all posts

Thursday, 17 July 2014

GPS Glitch

  1. The vehicle is loitering normally and then suddenly takes off in the wrong direction.  This is generally caused by a GPS Glitch.  There is no 100% reliable protection against these which means the pilot should always be ready to take-over manual control.  Beyond that ensuring a good GPS HDOP before take-off is always good and it may help to reduce the GPSGLITCH_RADIUS and/or GPSGLITCH_ACCEL parameters (see GPSGlitch wiki page for details) to tighten up on the glitch detection.


ERR-GPS 2 means a GPS glitch. ERR-GPS 0 means a recovery.


FS_GPS_ENABLE should be set to 1

Tuesday, 15 July 2014

Loiter_turns Command Troubleshooting

The problem we faced at today's flight test was:
  • The LOITER_TURNS command recognised the centre of the circle, BUT it seemed to rotate around the point with no radius
  • However, the CIRCLE_RADIUS is correctly set, and it is working in CIRCLE mode
  • After it completed LOITER_TURNS, and heading to the next waypoint, the altitude drift to ~33m, far away from the designated 20m height.

The first two bullets indicate that the problem is something to do with the code. AND IT IS!

Here is the code of our concern:
---------------------------------------------------------------------------------------
case MAV_CMD_NAV_LOITER_TURNS:                      // MAV ID: 18
          copy_location = true;
          num_turns = packet.param1;                      // number of times to circle is held in param1
          radius_m = fabs(packet.param3);                 // radius in meters is held in high in param3
          cmd.p1 = (((uint16_t)radius_m)<<8) | (uint16_t)num_turns;   // store radius in high byte of p1, num turns in low byte of p1
          cmd.content.location.flags.loiter_ccw = (packet.param3 < 0);
          break;
---------------------------------------------------------------------------------------

This clearly shows that the third parameter of the LOITER_TURNS command is used to store the radius data. HENCE, we shall not simply put 1 or -1 to indicate direction of turn, but should type in something like +20 or -15.


There is a minor issue hiding in the code above. The cmd structure in the code only accept one general parameter. This means that the num_of_turn and radius_m must be squeezed in to the single uint16_t variable. This is evident below:

-------------------------------------------------------------------------------------
struct PACKED Mission_Command {
        uint16_t index;             // this commands position in the command list
        uint8_t id;                 // mavlink command id
        // CHM - the commande structure have only 1 parameter in short int. This cause the loiter_turn cmd to be squeezed (num of turn + turn_radius).
        uint16_t p1;                // general purpose parameter 1
        Content content;
    };
-------------------------------------------------------------------------------------

In conclusion, the 1 should be changed to larger number. TO BE VERIFIED BY TOMMOROW


Week 13 Day 1 Video quality summary

Test 1

Video 1: Week 10 First video test
Remarks: Rubber duck antenna (below) was used for both transmitter and receiver for our first flight. Video quality was not ideal as flickering was noticed in the second half of the video.
Rubber duck antenna

Problem: The flickering of video could be the usage of rubber duck antenna which is not the best for video transmission.

Solution: To change rubber duck antenna to clover leaf (3-leaf and 4-leaf) for better transmission.

Clover leaf antenna

Test 2

Video 2: Testing of high speed video quality

Remarks: After replacing the antennas to clover leaf antenna, we brought it to test the video quality when attempting high speed. Video quality is definitely much better than test 1 but there is still a bit of flickering and colour loss.

Problem: The problem we guessed was that the transmitter we used had some faults in it.

Solution: To replace it with transmitter available in the lab.


Test 3

Video 3: New transmitter

Remark: Lesser flickering of video. Yet to try high altitude flight video testing.