By Land... By Sea... By Air...
Another good working session on the electronics today. Plenty of wire cutting, soldering and testing. We’re quite happy with our work. Obviously we’re not professionals but we’ve tried to keep our boards clean, neat and tidy.
Happy New Year!
Our objectives for today were to finalise the Bill of Materials (BOM) for the electronics and to start soldering the parts we have already received.
Reviewing the BOM was harder than we thought. We went through our electronics design and queried every aspect to ensure we were happy with it. This highlighted some unease about our choice of connectors. Terminal blocks are good but can be fiddly in tight spaces and would need cable stress relief that wasn’t easy to add. Furthermore, they would not be very good for quick connections/disconnections. So we looked at alternative connectors and decided to use RJ45 plugs and sockets. RJ45 plugs are easy to insert / remove, provide a positive connection and RJ45 sockets are simple to solder onto small breakout boards to align with the 2.54mm pitch of our PTH boards.
We had already planned on using Cat5e or Cat6 cabling to bring signals back to the rear of the glider so this seemed like a practical, logical choice. The cat5e/cat6 cables have the advantages of being AWG26, twisted pairs enclosed in PVC sheating, therefore providing clean cable runs that are easy to tie to the tubular frame of the glider. This choice meant we had to review all our connections and assign functions to the wires in the cat5e/cat6 cables.
We also revisited our choice of connectors for the front and rear control panels (to connect the switches, LED strips and LCD displays to the panel PTH boards. We decided to use JST XH 2.54mm connectors as they are compatible with the pitch of our PTH boards, keyed (so they cannot be inserted incorrectly) and fairly robust.
We finished our day by soldering RJ45 sockets onto breakout boards and soldering the pins of the ardunio micro pros and of the component breakout boards.
Our objective today is to control the virtual glider with one of our prototype kits. So we assembled the cirtcuits required to connect the MPU6050 sensor, the real time clock and the LCD display.
While the code showed no problem, Condor wasn’t seeing the MPU6050 sensor. After troubleshooting for a while including using a logic level analyser, we created a new sketch to scan the I2C bus. This gave us some unexpected results. It seemed that some of the devices connected to the I2C bus weren’t connected. We checked and re-checked our connections but they were fine. So we proceeded by elimination, removing 1 device at a time from the bus. This made us realise that 2 of our devices use the same 0x68 I2C address: the RTC clock and the MPU6050 sensor.
Fortunately, the MPU6050 datasheet gave us a convenient work around. The sensor will define its address as either 0x68 or 0x69 depending on the logic level of the AD0 pin. We connected the AD0 pin to our 3V3 supply and re-ran our I2C scanner. Thankfully, all devices now appeared. We were back on track!
Our next hurdle was the MPU6050 library. The library offers no way to define the sensor’s I2C address when the object is created. There is, however, a constant defined in the library’s header file with the address of the sensor. Modifying the value of the constant and recompiling fixed our problem.
We also resolved a couple of issues with writing messages on the LCD display.
Once we had reflashed our firmware on the Ardunio Leonardo, we spent time working out what our firmware needed to send Condor in order for Condor to recognise it as a valid input. This took quite a bit of fiddling but led us eventually to fly our virtual glider using the prototyping kit and the firmware. This was a major breakthrough and a perfect end of 2019: not only was it satisfying to see our code working but, more importantly, it proved our design beyond doubt.
We can now focus on soldering the boards, finalising our firmware, assembling everything inside the glider and creating support frames.
What started as a dream in February 2019 is now becoming reality.
Another day working on the simulator firmware. We added the logic for the momentary and toggle switches. This made us review and change the purpose we had originally intended for the switches. We realised that we needed to rethink the shortcuts needed while flying with a virtual reality headset.
We replaced the DS1307RTC library in our code with the RTClib library which saved us a few 100 bytes of flash memory and committed our code to the Github repository.
We also created the code for the lighting controller and committed it to its own Github repository
We connected the VR headset to the laptops and installed Condor V2. After a little bit of configuration work, we were able to fly virtually. What an experience! It took us a while to work out how to control the glider using the keyboard (and later with a mouse). We possibly died a few times after losing wings in flight but it’s ok since it’s quite hard to fly a glider you cannot control!
We were on airfield duties today. The day started reasonably well and all 3 explorers got some decent flights. However, the weather closed in after lunch so we put everything back in hangars / under cover and headed back to spend a few hours on our code.
Our 2 new laptops has arrived (we managed to find a good deal on the 2nd one – we’re rather pleased with ourselves). We’ve also ordered an Oculus Quest VR headset that should arrive in a few days. We also received the power supplies we had ordered.
We continued to work on our code, looking for ways to optimise it to fit in the 2.5 KB of SRAM and 32KB of flash memory. With the libraries and sensors added to the code, we’re getting close to running out of flash memory.
We replaced the HD44780 library with LiquidCrystal_PCD8574 and added both libraries and code to work with the OneWire and DS18B20.
Swapping libraries for smaller, less functional but good enough ones coupled with our code optimisation work paid off. It allowed us to save several KB of flash memory and 200 bytes or so of SRAM.
Yet another Github commit followed at the end of the day.
We’re back together today.
Our first task was to look again at the air frame, take measurements and decide where we would place sensors and other equipment as well as how to run cables. We also looked at how we would transfer the movements of the mechanical controls to the back of the glider where we want to place the Arduino MCU.[ngg src=”galleries” ids=”36″ display=”basic_thumbnail”]
We created a sketch of the rear shelf.
We spent a couple of hours creating a first draft bill of materials, selecting power supplies, FR-4 PTH board sizes. We investigated the advantages and disadvantages of several types of potential connectors to link all the different parts together. What seemed like an easy task turned out to be more challenging than we had expected.
We also ordered our first laptop for the simulator. A refurbished Dell G7 15 gaming laptop with the specifications we needed. We purchase it from the Dell outlet store taking advantage of an additional discount code. Unfortunately there was only 1 device in stock so we decided to keep an eye on stock levels and order a 2nd laptop when more outlet stock became available. Hopefully the laptop won’t be long to arrive.
It’s all starting to take shape and come together…
We were on airfield duties today but the weather was so poor, the duty instructor cancelled flying in advance. So instead we got together to work on the simulator again.
We discussed our further thoughts on hardware specifications before focussing on the firmware. We wrote a lot of code today. We had to add some funny maths to ensure we return values that Condor can use. We’ll also have to test which axis we need to tie to Condor: X, Y or Z?
We added the code for our LCD display and for the real time clock.
Out of curiosity, we compiled our code at the end of the day. To our great surprise, it compiled first time. This is somewhat worrying!
We committed our code to the Github repository at the end of the day.
Our simulator will be using Condor Soaring’s Condor v2 simulation software. This is one of the most important pieces of the jigsaw. We would also like to have both the Ka8 and ASK21 plane packs as these are aircraft types that we either fly regularly today or would like to convert to.
We asked Condor if they could sponsor us and we received a reply today. Condor gave us a 50% discount code, effectively giving us 1 simulator licence and 1 licence of each of the plan packs we wanted for free.
Thank you Condor Soaring!
We sold poppies for the Chippenham branch of the Royal British Legion in a local supermarket this morning. Once we had finished the small group working on the electronics got together: we’re back working on the simulator again!
We spent time revisiting the budget and the parts we were thinking of purchasing:
We created a list of things we had to work on and worked on our code. Our first commit to our Github repository since April! And since the unit was granted charitable status by Github we now have access to additional features such as making our repositories private. Thank you Github.
Unexpectedly, we received an email today informing us that the grant committee had approved our grant request? Really?
It took a little while to sink in. We now have grants from:
And Ausculta Ltd, a small local IT services company has agreed to provide funding for the electronics components we need (£250-300). Together with the money we have saved from our subs, we have all the funding to make our simulator a reality.