My little NAV/OSD project - under construction
Posted 14 June 2007 - 05:49 PM
I have an EB-85A GPS module (5Hz updates) and feeding a dsPIC30F4012 controller. So far I've managed to get the whole thing running at 115kbaud and pumping the output to a 16x2 LCD display (mainly for diagnostics - LCD will not be in the final config I think). The GPS is working and I have Lon, Lat, Heading, Speed, Alt, all coming out nicely. The module itself doesn't start reliably though, sometimes I have to disconnect power and reconnect - I need to look into this but it's not a major concern for me right now. I'm just happy to have the basic platform and code working now.
Next, I'll be slapping on the OSD (BOB-4 for the higher resolution - I like the pretty fonts) and getting the SPI portion working. Unfortunately I will be away for a few days from tomorrow onwards and won't be back till mid-week. Once I get back, I reckon I should be able to get everything going within a day or two.
After that, I'll be adding bells and whistles - homing stuff, voltage reading, etc. The BOB-4 OSD is very expensive and so is the GPS module. Between the two, we're already almost at US$200.
After I get done with that, I'll be starting on the artificial horizon unit. Anyway, that's the plan. I'll try to post updates as I move along.
Posted 15 June 2007 - 12:06 AM
just add a lithium coin cell to the battery backup,
then the EB85 works and remembers their settings, and aquire sats darn fast
Posted 15 June 2007 - 01:14 AM
As for my tests - I took the GPS out for a ride just now and noticed that the unit needs good GPS coverage in order to produce reliable altitude readings. This may be a problem of mine because I had the GPS sitting on the dashboard and driving in an urban area often with tall buildings obscuring the sky view. My tests, however, led me to think that a barometric altimeter may work much better for navigation. I guess that's what I'll be looking into next. I'll also have to start thinking about current readings and getting hold of a hall-current sensor.
What's encouraging though, is that the basic platform is working very well and now it's a matter of adding code and peripherals. I find with these projects that the hardest part is getting it off the ground and going.
Posted 15 June 2007 - 06:30 AM
Posted 15 June 2007 - 08:38 AM
The other thing that I'm trying to do is to see if I can run the SPI in a uni-directional mode, ie. I just want to send stuff to the BOB-4 and I really don't care about anything that's coming from it. If this works, I can cut down on one extra wire. There is also a supposed problem with the BOB-4's 75MHz clock interfering with the GPS signal. For this I have ordered a 74MHz clock to replace the troublesome part but that will have to wait a while. Right now my main concern is to get the interface working properly, grrr.... why can't they make up their mind about their operating voltage.
Does anyone know if the SPI will work if I just send data from the master to the slave device and not connect the return data path (assuming I only care about sending the data and there is only one device on the bus)?
Meanwhile, I've improved the GPS code a little bit and it's really nice looking at the info showing up on the LCD. I'm thinking of getting a bigger LCD for more on-screen info. The comms is interrupt driven so it should be quite robust. I need to test to see if it suffers from the lagging updates problem that Thomas mentioned. I'm running this at 115kbaud and I seem to recall a bit of lagging in the altitude earlier on, but was not sure if that was due to the satellite lock changing or if there is a problem with the system. The controller is currently running at 20MIPS so I should have enough computing power to get some other nice things done.
Posted 15 June 2007 - 10:54 AM
the way the height is calculated with GPS units makes height the most unacurate parameter, just dont change the height to fast up or down,
since it can also screw up your position information.
I have now also yesterday found another bug on the EB85A:
sometimes when changing direction and height fast,
the speed readout can goto 0 for 1-5 sec !!
while this happen all other parameters count fine, proving the NMEA still run fine.
try to fly 100m with the wind and 100m towards the wind,
and when you fly with the wind try to dive a bit so your ground speed change fronm 20kmh to 120kmh, the dive can be 10-20ms,
you need a powerfull plane or just plenty of wind,
I have a video clip that show I can make the SPEED indicator flip out this way,
I dont know if it is the direction change, or height change that confuses the EB85
but I have double checked the readouts and calculations to be relayable from 0-1500kmh
Posted 15 June 2007 - 01:58 PM
I just swapped out the 75mhz clock for a 74mhz on my Bob-4. It completely fixes the interference.
Posted 20 June 2007 - 10:05 AM
In the meanwhile - Woohoo!!!! Progress!
I must say, it's a nasty thing trying to interface 5V logic with 3.3V logic. I just spent 2-days straight with hardly any sleep trying to get the microcontroller talking nicely with the BOB-4. Halfway through that, I realized that the GPS wasn't talking either (it was earlier on another board) - which led to some panic, thinking I blew the GPS module. After much anxiety and lack of sleep, I finally nailed it down with a small level shifter (1-transistor ugly job but it works) - and the GPS was talking to the controller again.
So back to the BOB-4, after poring over it for hours upon hours, I still could not get it to talk on the SPI bus (although the UART interface works). As it turned out, eventually, there were a bunch of things wrong. First of all, that interface thing is finickier than I had anticipated. Furthermore, there was some confusion on my part as to the SPI I/O pins with the labelling. Then there was a problem that BOB-4 will only work properly in framed (handshaking mode) which was not mentioned anywhere. On top of that, it could not accept the clocking speed that I was testing at, which wasted me a lot of time barking up the wrong tree. To cut a long story short, I finally nailed each of the bugs down and got the framed mode going. When I powered up the controller, I thought something was wrong because the screen cleared - and to my surprise, text started showing up!! Before it was just gibberish!
So, right now - I got the GPS working and talking to the controller. I've taken it out with me for a few rides and it actually works quite well sitting on the dashboard. Usually I get about 10-11 satellites when driving on open roads. The GPS altitude is still a little quirkier than I like - there's still some lag on it (serial running at 115kbaud). Maybe it won't happen on a plane but I've not tested it. I should also add that I have added a connected on my controller for an LCD display which I can plug or unplug as needed. It's currently a 4x20 character display but can easily by a 2x16 one (which was what I was using earlier before I got the bigger display). This allows me to test the unit away from the computer (and show it off to my friends :-)).
I have the whole thing on a board about the size of the BOB-4 (SIMM version) and the two boards are stacked with brass spacers so it is quite small (though not as small as some of the dedicated units). I have ordered a pressure sensor to test so I'll be looking at that. Right now I need to clean up the code and get the basic display going before I start adding too many features. The good thing is that the biggest hurdles are over and I can't wait to really test this thing now. I'll try to post some photos of the board (now in it's second ugly incarnation) later. It's pretty compact and I'll probably just use it as it is although I'm likely to build another one, neater, now that I know all the design issues.
Posted 20 June 2007 - 08:31 PM
Posted 21 June 2007 - 07:06 AM
For most of the code testing, I am presently using an LCD display to give me more mobility. Of course, the LCD will not be on the plane (unless I want it there). The backlight consumes quite a lot of power but I can turn it off if I want to.
I have currently disabled the BOB-4 while awaiting the crystal to swap into the board so as to avoid interfering spurs on the GPS frequency. With the BOB-4 on, the GPS has a really hard time getting a lock from a cold start. In fact, I suspect my controller circuit may also be contributing somewhat to that. I'm going to try to find some ferrite cores and put them on the GPS module cabling to cut that down a bit if possible.
Here are some photos of the module thus far - this is my second test board.
Edited by Daniel Wee, 21 June 2007 - 07:08 AM.
Posted 22 June 2007 - 02:09 AM
Thanks for the heads-up. As a matter of fact I did find that site earlier but their proposed schemes didn't work. It looked very attractive because they offered a very simple passive solution but in the end I needed an active solution for the GPS UART interface. The diode scheme worked for the SPI interface though.
Now I wish I had another SPI port because I could have added logging to an SD card. Alas, pins and time are always too little. I'm running into a hardware resource crunch right now. In order to implement a homing scheme, I will need 2 PWM outputs and 2 PWM inputs, but I also need those same pins for my barometric pressure sensor. I also need another 2 PWM inputs to talk to my other pitch/roll attitude board (dedicated board running computations off the 5DOF IMU), and another PWM input for controlling the OSD remotely. At this moment, it is impossible to implement all of that so something must go. I reckon, I'll give up the artificial horizon for the moment and maybe just have a simple rudder home scheme without elevator control. I've no idea how this will work out though.
Meanwhile, I've got quite a bit of the OSD done and it's starting to look quite nice. I'm working on a nice recticule for the heading and homing indicators. I'll post something once I get some nice results.
Posted 22 June 2007 - 11:46 AM
Posted 22 June 2007 - 05:37 PM
And if you want to see the short clip of it in video format (DiVx):-
OSD Test Clip 1
Posted 22 June 2007 - 10:22 PM
Posted 23 June 2007 - 06:27 AM
I've started adding more advanced software features to the unit. One of the features I have is a progressive low altitude warning - that is, the further you are, the higher the altitude floor warning goes. Some of the information, such as peak values, will only show up once the plane has come to a stop. There are a few more such features I'm including. I'm still trying to decide on the final feature set. I've also moved the GPS data to a better position and added code so that this info only appears when hunting for satellites at startup and when you go below the altitude warning is active. Normal flight will not have the GPS position data visible, only when too low or landing.
Edited by Daniel Wee, 23 June 2007 - 06:34 AM.
Posted 23 June 2007 - 08:32 AM
Posted 23 June 2007 - 04:39 PM
Posted 23 June 2007 - 05:01 PM
Now, I will have to measure the camera and TX to try to see how much operating time I can get out of my batteries. I wonder how much the other OSDs are drawing as a norm. There's nothing I've got to compare with but I suspect those that are not using the BOB-4 in their designs are likely to draw a bit less.