Groundhog Autonomous UAV – Going faster with sunglasses

The Groundhog is being developed to line-follow at low altitude and higher speeds.  This video is of the field testing taking the speed up to 1.75 m/s.  It also explains why the Groundhog now sports sunglasses.

The Track

An oval of 50mm red webbing, bends of radius approx 3m and straights of approx 15m. Testing took place in early morning with glancing sunlight on dew-soaked webbing – great for walking the dog but not so good for computer-vision.

On-board at 1.75 m/s

Image recognition is by OpenCV on a Raspberry Pi 3 as explained in previous blogs.

Image Processing

Frame rates of over 40 fps are achieved by:

  1. Capturing and processing images in a separate thread;
  2. Processing only two roaming regions of interest as shown by the blue bands above;
  3. Using trigonometry to calculate bearings instead of image transformations.

The reality is that the PiCam is only delivering 30fps, so many frames get processed twice.

Flight Control

The position and bearing of the line is calculated in NED space from the orientation of the UAV and pitch of the camera.  A velocity vector is calculated to partly follow the line and also to ‘crab’ over it.  The velocity vector is sent to the Pixhawk via Dronekit, set to a fixed magnitude.  The Pixhawk is running Arducopter in Guided flight mode.  In these videos, the velocity is set at 1 m/s,  1.2 m/s, 1.4 ms and finally 1.75 m/s.


  1. Line following was reliable at all velocities up to 1.4 m/s at an altitude of 2m.
  2. The polaroid filter was effective at cutting out much surface reflection, permitting better performance when flying into the sun.
  3. At 1.75 m/s and 2m altitude, lock was lost occasionally when turning into the sun. This was due to more of the line passing out of the field of view and the challenging conditions due to surface reflection.  This is clearly seen from the on-board video above.
  4. Raising the altitude to 3m increased the field of view and allowed for reliable lapping of the track, even at 1.75 m/s.  However, the intention is to fly lower, not higher!
  5. A separate yaw test (full lock in loiter) indicated that despite being 3Kg, the maximum rate of rotation was not a limiting factor to following the track at higher speeds.

What Next?

To get lower and faster, we need to find a way to keep the track in the field of view. Some possibilities are:

  1. Use yaw more aggressively;
  2. Use a wide angle lens.

So back to the drawing board, but in the next field test maybe we’ll target velocity of 2m/s at 1.5m altitude – so faster and lower.

Replacing the receiver on an Eachine LCD5800D monitor

LCD5800DWhilst I’m not into FPV, I use an Eachine LCD5800D monitor to check the view from the Raspberry Pi companion computer of The Groundhog.  With the super-imposed graphics, it gives a constant view of the status of the image lock on target etc.  It also has a nifty built-in recorder.

Recently the link refused to work, and after first replacing the transmitter, I realised it was actually the receiver that had failed.  I decided to upgrade the receiver, hopefully fitting a new unit within the existing case.

A good briefing on the internals is to be had from the excellent YouTube video from Albert Kim at

Replacement Receiver

The Eachine RC840 seemed a good candidate for the replacement.  Diversity was not needed and the RC840 has an audio capability not present in the original, even thought the built-in recorder can accommodate an audio signal if provided.  This might prove a useful addition for the future.  Furthermore, the RC840 is more sensitive and so can support a greater range if needed.

rc840The supply voltage for the RC840 is specified at 12V.  However,  I had it on good authority that it can be driven by the 7.4V battery in the monitor unit and a quick test seemed to confirm this.  It doesn’t have auto-tuning, but it was considered this was not an issue either, as normally the Groundhog is flown alone in a field, so there is no need to keep changing channels.

Wiring Up

It quickly became apparent that the RC840 would not fit inside the existing monitor casing, even with the (good quality) metal casing removed.  So a decision was made to mount it externally.

The existing receiver (below) was disconnected and removed after the battery was taken out to guard against short-circuits.   The three wires connecting the receiver were extracted from the connector block – video, supply and ground.


The video and ground wire was connected to an RCA phono socket for an external connection.  Conveniently, the phono socket fitted the old antenna hole perfectly.  The supply and further ground were run out of the casing to be terminated externally ready for connection to the RC840 power lead.  As shown below, some hot glue and heat-shrink were used to give strain-relief for the supply wires.


The new connections are shown below.  Note the recorder lower left.  It has an audio connection which could be wired up in future, if desired.  The usb charging circuit is lower right.


The final results are shown below.  The supply and video signal wires to the RC840 receiver are coiled reasonably neatly on the back of the monitor.  Given that the monitor will now be used on  tripod, it would also be possible to mount the receiver separately, perhaps higher up to improve range.





I’ll be using the new monitor set-up in the next few days to record The Groundhog doing some more line following – given a break in the weather!









The Groundhog UAV. Line following using velocity vectors – initial testing.

Several lessons were identified here  from the entry of The Groundhog hexacopter in the MAAXX Europe competition earlier this year.

Current developments are around correcting the issues so that we get a UAV successfully lapping the oval track at a minimum average speed of 1m/s.

A number of changes in approach have been made from that previously blogged.  Recall the platform is based on a combination of Pixhawk/Raspberry Pi3/OpenCV/Dronekit.

Image analysis:

  1. The birds eye view image transformation in OpenCV was causing segmentation faults on the RPi.  Instead the position and bearing of the detected line is calculated using straight trigonometry.
  2. Improvements made to the ranging ROI bands to further speed-up the frame rate.  This is now at a reported 50fps (which is faster than the PiCam is supplying them).

Control algorithms:

  1. The use of quaternions has been temporarily suspended in favour of control by velocity vectors.

As in MAAXX Europe, it makes sense to initially test on a straight line.  Initial testing was conducted outdoors using red-seatbelt webbing for the line.  It was not possible to fly below about 2m as the propwash blew the line away (will sort that next time!).

Initial Testing (Links to YouTube Video).

Video – Groundhog UAV initial testing on straight line.



Post 5. MAAXX Europe. Quaternions, control code and PIDs.

In this last post of the series I shall overview the main program including the control algorithms for the Groundhog.  Code is written in Python, using Dronekit and OpenCV all running on a Raspberry Pi 3.

As we are flying indoors without GPS and also without optical flow, we are using quaternions to control the vehicle in the GUIDED_NOGPS flight mode of ArduCopter.  To be honest, I’ve not come across anyone else doing this before, so it must be a good idea…

Continue reading

We are taking our F1 in Schools track to

We are taking our F1 in Schools track to the Big Bang in Swansea on the 12th July at the Waterfront Museum. Looking forward to the Motion Racing team from Ysgol Dewi Sant racing their new car. Taking along enough cars for lots of visitor racing – Come along and see the action!