Jump to content

My little NAV/OSD project - under construction


Recommended Posts

Daniel,

Just a question on the Bob-4 connections. You've got the 1N4148 signal diode going to MISO on your schematic. However, if I trace your board, MOSI has the 1N4148 plus a 10K resistor. MISO is a straight trace to pin 18 on the pic. I may be reading it wrong. Could you please clarify?

Thanks!

Link to post
Share on other sites
  • Replies 735
  • Created
  • Last Reply

Top Posters In This Topic

Daniel,

This was using my Archos 504 for video. I'll try using another TV. It does this in both NSTC and PAL modes on my Archos, so I don't think that's an issue. I remember you mentioning something about the 74Mhz crystal having less available lines than the 75Mhz one in the Bob-4, so I suspected that.

Link to post
Share on other sites

In practice, the diode/transistor is needed to make it work reliably. I had it working for a while without anything in between but it stopped working after a while which necessitated the use of some level shifter.

If you look at the datasheet for the dsPIC30F4012, under the electrical characteristics, you find that the minimum Vih (voltage to be recognized as a High logic) is around 0.8V. If my understanding is correct, as long as your logic high swings over this minimum, it should be sufficient. The GPS module has a swing of about 3V so in theory it should work without any additional level shifting. I admit I was too lazy to hunt down exactly why I needed the level shifting but I was in a hurry to get the platform working so I can get on with the code development. Once I get the SPI issues worked out, I'll get back to looking at this design.

rimbo5,

The crystal should not affect the length of the screen, only the width. I'll check again but I think it may be an NTSC/PAL issue or a safe zone issue. I could print with a bigger safe zone but I wanted to keep all the data at the periphery of my LCD screen. See if you can check it with a different display in PAL mode (which has more lines than NTSC). Also, try feeding a PAL signal at the input. The auto-detect on the BOB-4 with no input signal appears to default to NTSC.

Edit: I've check this and it appears to be the PAL/NTSC problem. I've not decided how exactly to handle the NTSC lack of lines as I much prefer the higher resolution of PAL. I may have to produce a NTSC version specifically with different positions for some of the display items. I'll post a new version of the software which will default it to PAL when there's no input. When there is input, it will follow the input standard, which may be bad because the stuff at the bottom goes off the screen then.

This is the great thing about rolling your own software - you can fix it as you find it. No need to wait for some bureaucratic company to decide if it is worth their time to fix it.

Software here:-

NAVOSD software version 3.1

docphi,

That is correct. The output from the dsPIC is 5V logic, and the BOB-4's SPI input is not 5V tolerant. That diode arrangement is to prevent the 5V from the controller board from frying the 3V stuff at the SPI input. The pull-up goes to 3V for that purpose. The input however is a different story because the dsPIC (input is floating) can easily handle the 3V logic from the BOB-4 output and that is why no buffering is needed. This arrangement apparently works so I've not really looked at it further.

Daniel

Edited by Daniel Wee
Link to post
Share on other sites
If you look at the datasheet for the dsPIC30F4012, under the electrical characteristics, you find that the minimum Vih (voltage to be recognized as a High logic) is around 0.8V.

Actually, the dsPIC's ST input's logic highs are not 0.8VDC. Instead, they are 0.8Vdd. That means that with 5.0V operation, highs must be >4.0V. So, something like the diode trickery is needed when interfacing to 3V TTL.

I had it working for a while without anything in between but it stopped working after a while which necessitated the use of some level shifter.

Yup, that is the sort of thing that can happen. Just a minor temperature change can make it go from happy to sad. Or, swapping the PIC with one from a different silicon fab can ruin the party. The 3V TTL inputs are at "the edge" without the level translation.

Link to post
Share on other sites

OK, that makes sense that it would be the width, not the height affected. I'm still trying to located another display, but in the mean time, I'm not sure the GPS is working correctly. After switching the transistor around, I now get the main OSD screen, but it keeps saying "0 sats" (I took the assembly outside to be sure it was able to get good reception). Still no dice after 15 minutes.

Something occured to me. Some EB-85As are programmed from the factory for 4800 baud by default, while some are at 38400 (mine is 38400). Are you checking for both baud rates on init?

Link to post
Share on other sites

Yes, I am checking for all baud rates - my altimeter reads 137m when there are zero satellites but in working condition.

Now, if your BOB-4 is still using the 75MHz oscillator, then I can tell you that it WILL jam the GPS signal big time. If this is the case and you still want to verify that the unit is working, try this:-

1. Make sure you are using the latest software - version 3.1

2. Try to get as much distance as you can between the module and the BOB-4

3. I put my controller and BOB-4 module in a Altoids tin casing to shield it

That should do the trick but even then it's iffy. Get as much metal as you can between the BOB-4 and the GPS module.

Daniel

Link to post
Share on other sites

Okay, I've made some changes to the circuit in the light of the correction to my misreading of the Vdd Vdc thing in the datasheet. To be sure, think this is more of a purist type of change since the boards will likely continue to work just fine without it.

The changes I have made thus far, are:-

1. Instead of the pin-21 on the BOB-4 board, MISO sending data straight to the controller on pin-18 on the dsPIC chip, I have now inserted a 1N4148 diode pointing from the pin-18 towards the BOB-4 MISO. (Arrow direction outwards from dsPIC). In conjuction with this, I've added a 1.37k pull-up resistor (doesn't really have to be precise, just in the ballpark will do. I just happened to have those lying around.) from pin-18 to +5V. I actually added this resistor across the underside of the ICSP programming socket since that's where the connections go anyway. As for the diode, I cut the trace and put the diode across it. What this change accomplishes is that it brings the voltage swing of the logic levels closer to spec as per the datasheet. Like I said, this is optional as long as the BOB-4 is talking fine to the dsPIC. Call me paranoid but I prefer to err on the safe side.

2. I've taken out the 2N3906 transistor, the 4.7k and the 10k next to it, and put in a diode. Basically the diode points towards the GPS module side from the DSPIC. I added a 10ohm resistor in series with this diode, and added a 1.37k pull-up from pin-12 of the dsPIC to +5V. Basically, this is accomplished by replacing the 10k with a 1.37k, replacing the 4.7k with a 10ohm, and connecting a diode across where the transistor used to be, namely the diode pointing in the direction of the direction (physically) of the GPS socket (not using the grounded pin of the transistor holes). To put it another way, of the three holes where the 2N3906 used to go, the diode occupies the 2-holes furthest away from the GPS socket, and points in the directon of the socket. Electrically, the diode points towards the GPS TX connection, through the 10 ohm resistor that's replaced the 4.7k.

3. I added a wire from RE0, pin-26 on the dsPIC (there's an unused pad connected to it) to the RST\ line on the BOB-4S (pin-10). This is so that I can force a reset on the BOB-4 should the controller crud out for some reason and the watch-dog resets the controller. This way, when the controller has a watchdog reset, the BOB-4 gets reset as well. I can also force a reset through a function now, but I'm not doing that unless the thing is so unreliable that it needs it. This change is optional but if you want to do this, then you need to use the attached version 3.2 of the software (this is the version that I am going to try to fly with this afternoon).

NAVOSD software version 3.2

For those who are wondering, I still intend to release the full source code for this software but not until I've reached a level of stability with the code that I am happy with. We're getting there.

Daniel

Link to post
Share on other sites

Daniel,

Well, it was NTSC/PAL as you suspected. I unplugged my camera, and the screen size was perfect, all the menu items appeared... Too bad all my cameras are NTSC. PAL looks so much better on my monitor!

I'll be making the changes you mentioned tomorrow and will keep you posted. Still not getting anything from the GPS. I suspect it may be the transistor...

Link to post
Share on other sites

The transistor should work fine. If you have a scope, just put it on pin-12 and you should see a square-wave (serial signal) from the GPS. If you don't then check that the second pin from the right of the GPS socket has that serial signal. If not, it may mean that you have the wires mixed up from the GPS.

You don't have to change the transistor to get it working. Actually, I'd recommend not making the changes until you get it working. Just remember - traced the GPS TX line to the board, to the 4.7k and to the transistor. If you're not getting a decent square wave type of signal at pin-12, maybe you have the transistor reversed or something. I think you have have the GPS RX/TX swapped.

If you're not already using the version 3 software, I would recommend that. The version 2 software had some initialization issues with the GPS modules. Note that you need to ground pin-16 on the BOB-4 in order to use the version 3 software.

What is your BOB-4 oscillator frequency? What value are you getting for the altimeter on the top right (lower number)?

I am thinking about doing an NTSC version but you lose quite a few lines with NTSC. Just give me some time to sort out the basic stuff then I'll do the NTSC version.

Daniel

Link to post
Share on other sites

rimbo5,

Arrgggh.... sorry about it - it was my fault. I mucked up on the initialization for the 38.4k version of the GPS module. I was testing with the 4800baud version and missed the error until I tried it on my flying platform. Okay, now it should work:-

NAVOSD software version 3.3

Let me know if you have problems getting this to work.

Edit: I've just flown with version 3.3 and it's looking good.

Daniel

Edited by Daniel Wee
Link to post
Share on other sites

Success! It was the latest software, I had the circuit wired up correctly. It acquired 8 satellites, then switched to the main screen. It's moving my servos and everything! Very exciting.

But... in NTSC mode, I can't see the compass/heading display at the bottom. The bottom most text I can see is the "Range" (peak value) ;(

By the way, I do have the BOB-4 with the 74.250 crystal in it. From what I understand, this makes a big difference since the stock 75Mhz crystal interferes with the GPS module.

Link to post
Share on other sites

You REALLY want the compass at the bottom because the home indicator is also there. So is the mAh reading and distance readings. I'll try to see about getting the NTSC version done but it will be quite a bit of work to reposition everything.

Daniel

Link to post
Share on other sites

You're right in theory but it would seem that according to the docs, the RST line's 5V-tolerance is implied. Those lines that are not 5V tolerant were specifically stated as such in the docs. For the moment, I've decided to leave it as it is unless some problems occur. Truth is I'm kinda tired of pulling the board out of the plane for hardware changes :)

Daniel

Link to post
Share on other sites

Okay, here you go - I've not done much testing so it's possible that in making all the changes some bugs crept in. If you find any, please let me know. Basically, you can go to the menu and change the PAL to NTSC.

Just some notes about the menu.

1. You should adjust ELESERVORDIR (either NOR or REV) so that a down elevator stick will move the selection downwards.

2. You should adjust RDRSERVORDIR (either NOR or REV) so that a left aileron stick will decrease a parameter, and a right aileron stick will increase a parameter. This is assuming you have it hooked to the aileron channel instead of the rudder channel. I'm not entirely sure about the orientation of the rudder channel as I've not really tried it much on a rudder as yet.

If you get these two right, the autopilot should be okay as well. Note also that changing these two can be a bit confusing because the moment you change them, your stick selection direction is affected.

3. Any changes will take effect immediately but will not automatically be saved to flash. To do that, move to the "SAVE CONFIG" menu and hold the aileron stick right until it says "DONE". This indicates that all the settings have been saved to flash and will be the new default when you next power up the unit. In you case, you want to change the PAL to NTSC under VIDEOMODE and then save this to flash so you won't have to do this again.

Now for the fun stuff:-

NAVOSD software version 3.4 (NTSC support!)

Let me know how it goes.

Daniel

Edited by Daniel Wee
Link to post
Share on other sites

Well, after so much work got done, I decided to go fly the version 3.4 software to see how it held out under actual use. I got to the field with my usual setup and took-off (well hand-launched) into the wind and started climbing away nicely - so far so good. So now I'm looking through the goggles and chatting with my friend and then all of a sudden - wha?... where's my prop? What's that wood stick out - and hey - where's the cowling?

I immediately killed the throttle and turned back to the field, this was already over 100m up in the air. Glided in nicely like nothing was wrong at all and on the final, I did a U-turn into the wind and came to a perfect landing.

As it turned out, the motor mount had broken - and the motor was hanging by two wires with the cowling still attached to it. I must say I was pretty happy for some strange reason - after all I just did a perfect landing, one of my best ever, and didn't lose anything except maybe a screw for the cowling - this with the motor hanging out the front. It was quite funny really, especially when I first realized what had happened. Amazingly, the CG was perfect even with all the carnage up front.

Now, on a slightly different note - I think almost everything is sorted out but on the menu page - sometimes there are spurious characters bring printed. I'm trying to figure out what's the cause of that. Nothing serious though - everything else appears to be working well and normally, in the PAL mode at least.

Daniel

Link to post
Share on other sites

Haha, could that be linked to me telling about my similar problem yesterday? :blink:

The only problem on my easyglider is that the motor wasn't soldered to the ESC, but linked with 3.5mm connectors... so it completely flew away instead of just hanging down... :lol:

Nice to know there's no damage ;)

Link to post
Share on other sites

Ahh... but I did have connectors. 1 of the 3 popped out and the motor was hanging off the last two. Lucky me! Best part is everything is intact except for the broken mount. I'll have to get some stuff to repair that tomorrow but this is as good as it gets for this sort of accident.

Daniel

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...