White off

OK, I’ll stop on the “white” blogs after this one.

I’ve just done some more 0g calibration as per yesterday, but in the early-morning cooler temperatures outside.

Outdoor 0g offsets

Outdoor 0g offsets

Compared to yesterday’s indoor X, Y accelerometer offsets of (40, 200), this mornings results are roughly (3.5, 157.5) so there is a temperature drift, although the overall shape is similar.

I then flew Zoe outdoors on yesterday’s indoor offsets, and still got reasonable 10s flights with about 1m drift.  Later today, I’ll take her out in the warmth and fly with the offsets from yesterday, and try to video the results for you to see.

White out

I’ve been unable to get Zoe working in WAP mode with the mid-March release of Jessie.  Sometimes the hostapd starts fine, sometimes it doesn’t, and there’s some conflict between configuring the static IP address in the DHCP client config (dhcpcd.conf) and the booting of the DHCP server (udhcpd) – it starts OK according to the boot logs, but by the time I’ve logged in, it’s stopped.

So for now, I’ve dropped back to the end-January image that works, and I’ve stored off a copy of the working pre-WAP mid-March image so I can pick it up another time.

Then I did some tinkering with 0g offsets, measuring them 5 times, then twisting Zoe 90° and measuring again until I had 20 readings.  Here’s what it looks like suggesting an X offset of about 40 and a Y offset of about 200 is about right.

20 0g offsets

20 0g offsets

So I then took her out to fly several 10s flight including 6s of hover.  Some were immaculate, others less so, and the main factors (guess work) are the slope of the ground, and the weight balance, particularly if it shifts in flight because (for example) I’d not got one of the batteries tied down as tightly as possible!  Even for the imperfect flights, it was possible to see her successfully stopping the drift, and then the drift started up again, to be stopped again.  I think some PID tuning is required here as this suggests the correction is using the P part of the PID and it needs some I.

White WAP

All that’s required to get Zoe running on a post May 2016 kernel is to disable the new method of configuring interfaces:

sudo apt-get remove dhcpd5
sudo apt-get remove raspberrypi-net-modes

The just follow the standard instructions being careful about which driver you point hostapd at for your WiFi adapter.

‘m not going to give full instructions for how I switched Zoe’s WAP on as they are mostly unchanged from last time.

Only two minor changes were required:

  1. In /etc/network/interfaces, comment out the section related to wlan0.
  2. In /etc/dhcpcd.conf add
    interface wlan0
    static ip_address=
    static routers=
    static domain_name_servers=

With this, I could connect to Zoe from my iPad – the iPad was assigned an IP address in the range configured in udhcpd.conf so I took her outside for a flight.  It was rather jittery compared to how she flew prior to the move to Jessie lite so I have some investigation to do there, but I don’t think it can be WAP related.

One oddity that remains, and that’s gating me on investigating the above is that although the iPad connects perfect, neither my PC nor my main Raspberry Pi connect – the WiFi connection is fine, but (I think) no IP address is assigned by udhcpd, which means extracting diagnostics is hard to download.  More digging required.

Further investigation reveals that the iPad is working because it has a static IP address configured for accessing Zoe; The PC and other Raspberry Pi don’t work because the DHCP server (udhcpd) is not running when it should be. I have no idea why, so for the moment, I’ve reverted Zoe to the January release of Jessie. Very frustrating 🙁

White litening

There’s been a lot of churn in the Raspian Jessie image recently, so I thought it about time to dist-upgrade Zoe.  Something went significantly wrong forcing me to install her from scratch, and taking the opportunity to swap to Jessie lite, throwing away the unnecessary games, GUI and other gumph present in the full Jessie distribution.

Here’s the installation steps I took after the basic installation of Jessie lite and sudo raspi-config to expand the file system, set hostname, enable I2C and assign minimal memory to the GPU.

  • Set up a WiFi internet connection from the CLI:
  • sudo apt-get install i2c-tools python-smbus python-dev python-setuptools git ftp
  • edit /boot/config.txt adding
  • git clone https://github.com/PiStuffing/Quadcopter
  • cd Quadcopter
  • tar xvf RPIO.tgz
  • cd RPIO/source
  • cd c_gpio
  • touch *
  • cd ../c_pwm
  • touch *
  • cd ../..
  • sudo python setup.py install
  • cd ~
  • cp Quadcopter/qc.py .
  • cp Quadcopter/fp.csv .
  • cp Quadcopter/Quadcopter.py .

With this, Zoe lite runs fine within the home network.  The next step is to WAP her, which with the new interface management is unlikely to be the same as I’ve done before, so I’ll blog this separately once I’ve worked out how to get it working.

Snow White

Just sharing a couple of photos.

The first is my new prototype Pi with a discrete level shifter used to drive the URF I2C at 5V, while using 3.3V over the RPi I2C interface.  The type of MOSFET is not critical as long as its Vgs is much less than 3.3V – many use the BSS138 or 2N7000 – I just used a couple from my stash which fit breadboards better.  The next step is yet another PCB for Phoebe*:

Discrete I2C level shifter

Discrete I2C level shifter

The second is Zoe who I’m in the process of upgrading to the latest Raspian Jessie Lite – this is a start-from-scratch ‘update’ so I’ll blog the step next.

Zoe litening

Zoe litening

Zoe’s upgrade has so far gone pretty smoothly except for one minor glitch with updating to the new networking interface model and not having a GUI.  The one thing that’s made it a lot easier is that I’ve not had to dismantle her at all.  Also, in the past I’ve used a 10-port powered USB hub for WiFi, keyboard and mouse, but here I have a 2-port USB hub attached to Zoe’s OTG USB connector.  In all, that’s made the upgrade process much less painful than I was expecting.

*Nope, this URF won’t work with Phoebe – even with the level shifter, when I updated the I2C baudrate to 400kbps, the simple test program blocked, just like Phoebe’s own URF does on 3.3V. I also ran Zoe at 100kbps by mistake during her litening transformation, and that proved 100kbps is not fast enough to empty the IMU FIFO as fast as it is being filled.