I have spent a considerable amount of time working on the code to get the sonar working straight of the PI. However because of the lack of interrupt support. This approach is not suitable for the project due to amount of errors and the high load on the CPU.
Instead, I’ve tested with the sensor connected to a Ardunio Uno and the PI. Instead of using serial I have used I2C to get the values. This was very successful and I was able to get >20 results per second. I did also look at using SPI but opted for I2C because is seemed easier to integrate and less wires.
The next step will be wiring this up with a smaller Ardunio board and testing this out in a flight test.