Jump to content

Attention: RC-CAM.com will be closing down August 2021.

The RC-Cam.com forum was the very first online community dedicated to the advancement of wireless video cameras on radio controlled (R/C) models. This is now called "FPV" (First Person View). We are proud of the contributions that our members have made to the FPV hobby.

We've seen significant changes over the last twenty years. Initially there were a lot of eager R/C hobbyist that built their own video systems. Allowing these creative individuals to share their work was the purpose of this site. Now the FPV market is flooded with low cost systems; Sadly DiY FPV video projects are now rarely discussed.

RC-CAM.com (main site and forum) will be closing down August 2021. This is being announced now (March 2021) so that everyone has time to download any information that is important to them. After the site is shutdown the information will no longer be available here.

We appreciate every member's involvement with advancing the FPV hobby. It is indeed sad to say goodbye to all our online friends. Be safe and stay healthy.



My little NAV/OSD project - under construction


Recommended Posts

  • Replies 735
  • Created
  • Last Reply

Top Posters In This Topic

Everything is soldered. The display says "BOB-4" which, I believe, means there is no serial data being received.

Daniel - what connections did you use for the BOB-4. Did you program Init strings for the GPS in your code? If so, what baud rate are you using?

Thanks!

Link to post
Share on other sites

Okay, basically - you need to make sure you have your BOB-4SG configured correctly.

I'm going to try to get this right but here goes:-

The following needs to be grounded (BOB-4SG pins):-

2, 6, 14, 19, 29

You need a 10k from pin 1 (+3.3V) to pin 13.

Edit: And if you look at the BOB-4SG pin 1 trace - you will find a pad (marked J1) which you need to bridge with solder.

That should do the trick - I'm going to confirm this with my new BOB-4SG but you should at least make sure that you've got the above connections.

Edit: Pin 16 needs to be grounded too if you're using software version 3.0 and upwards. See later posts to find out more.

Daniel

Edited by Daniel Wee
Link to post
Share on other sites

Pin 1 AND Pin 13 on the BOB-4SG. All the references in the previous post relate to configuring the BOB-4SG on the BOB board itself. I just tested the connections and it is correct - I've successfully configured the fresh BOB-4SG board this way and it's working now.

Daniel

Edited by Daniel Wee
Link to post
Share on other sites

Ok. I need a break. Two etched boards and a breadboard later and I can't get it to work. It displays "Bob-4" and nothing else. Also, I can program the PIC independently from the OSD board, but, not with the ICSP. A little rest and I'll look at it again. :D

Link to post
Share on other sites

If the ICSP is not working, check the diodes. Make sure you got the 1N4148 in the right place. Can you take a photo of your board so I can take a look, maybe I can spot the problem.

1. Check that you've got all your voltages at the right places. 5V at the power points.

2. Check that your BOB-4SG is configured correctly - count carefully the pins.

3. Put a scope on the OSC1/2 to see if you can see the 10MHz signal.

4. Make sure there are no short circuits - check with a continuity meter.

5. Put scope on the pin 20 of the BOB-4SG to see if there is the SPI signal going there.

When testing, don't plug GPS in yet.

First step is to make sure the ICSP works.

Also, make sure IC orientation is correct.

I'll help you through this but I'm off to sleep now.

Daniel

Link to post
Share on other sites

The ICSP works until I connect PIC pin20 to the trace that will give +5v when the battery is applied. I checked with a continuity meter and everything looks ok. What's strange is that the breadboard I setup is doing the same thing.

Link to post
Share on other sites

Can you check if you've got a short somewhere? Pin 20 is power for the controller so it should be 5V. If you can show me a photo of your board I might be able to identify any misplaced components.

One way to test for shorts is to remove the IC and check for continuity between adjacent pins. Also make sure that it's the 1N4148 that you've got there. Oh, one more thing - if you're using the MPLAB with the ICD2 to program the ICSP - you need to apply power to the board before it will be recognized by the programmer.

Daniel

Link to post
Share on other sites

Ok, some updates - been a busy day for me.

First of all - some more software changes. I have two EB-85A GPS modules with me and for some unknown reason, they both behave a little differently, even when sent the same command strings. The short of it is that, one of them - with an older serial number - seems to be sending more data than the newer module. Originally, I had some of the display events slaved to the reception of these said data packets. However, as a result of this anomaly, I can no longer rely on consistently sent data packets as I do not know what kind of module you will be getting. As a result, I changed the code so that now the display is slaved to a 4Hz event - so basically your screen will be updated constantly at 4 times a second, regardless of reception of data packets. This results in a more stable looking screen. I've not tested this change very much so I do not know if there will be any side effects. Off-hand, there seems to be no adverse effect so I'm going to stay with it and test it a bit before posting the hex file here.

Secondly, I finally got down to making a current sensor with the ACS755-050. Interestingly, even though this is a uni-directional sensor - the zero point floats at around 0.6V or so, which means that the code has to insert an offset to zero off the current readings. I have included this option in the configuration menu now. It just happens that this 0.6V is just enough to forward bias a diode so I slapped on a signal diode to rectify the output and feed a charge accumulating capacitor with a resistor to control the timebase. I also upped the sampling rate some 16 times (or is it 8, I can't remember now). After that I spent several hours calibrating the thing. I've not done extensive tests on the accuracy of the calibration but tomorrow I will run some field tests to see how the new sensor works. Initial impressions are that there is better accuracy and the changes make everything work better. I am gunning for an accurate mAh meter as I feel this is a very useful tool.

With those two out of the way - I also got down to a few outstanding tasks:-

1) Change my aluminium wheel struts to steel wire so I don't have to keep bending them back at every landing.

2) Made a power module for my LNA which I will also test tomorrow (not that I need it. My last flight to 1.4km had perfect video all the way there and back).

3) Built a second controller with the new BOB-4SG and tested it. This works now and I'm using it to test my code.

4) Did some research on building a long range r/c link. And also looked into a number of other potential projects.

While building the new BOB-4SG board, I found that the display kept disappearing, which I thought was the result of the interrupt routine hanging, because this only occurred when I touched one of the PWM inputs. As it turned out - I was touching the control input which interpreted my hand induced pulse as turning the display off. Of course, I didn't realize this until I ripped out a number of parts in search of potential short circuits. Oh well, live and learn.

Tomorrow also, I will be trying to set the autopilot up on the new plane. I really need to get a second battery for my flying. My 2100mAh is giving me good time though - between 20-28 minutes per pack, depending on how I fly.

Daniel

Link to post
Share on other sites
With those two out of the way - I also got down to a few outstanding tasks:-

1) Change my aluminium wheel struts to steel wire so I don't have to keep bending them back at every landing.

Methinks you should amend 1) to be "Learn to land my plane" :unsure:

/hug

Link to post
Share on other sites

Heheh... honest - those alum struts that came with the plane are putty. They bend when I sneeze at it. On the same note - the new struts work great - only 2g heavier and I don't have to bend them anymore. These are actually just 2.6mm wires. The alum ones look exactly the same, thin wires.

I got to the field today and managed to squeeze in one flight of about 18 minutes or so before it started to drizzle. Alas, still not much chance to fiddle with the autopilot as a result of the rush. I did however ascertain that the gain that was okay with my smaller plane seems to be insufficient for this bigger plane so I will start increasing the values for my next flight.

I had the opportunity to test out the LNA with this flight though, and boy, does it work well. Now, on a normal picture you won't notice anything but the difference comes when you realize that there are no dropouts of any kind - way out to 1.6km line of sight distance. Before, I'd have some dropouts when the antenna is in certain orientations where the null was pointing at me. So, score one for this LNA! Woo hoo! I need to rig it up to run off the same battery as my receiver though - I was running it off a separate battery.

The flight itself was pretty uneventful - which is how I like it. I crossed 1km altitude for the first time today! I could have gone higher but I was starting to get into the clouds and that was affecting visibility so I held off. The other reason was that I could hear thunder in the distance and I wanted to bring the plane back in case it started to rain (over here when it rains, it pours).

Lastly, the current sensor seems to be working quite well. I can't say anything about the calibration as yet since the battery is still being charged. I'll post more info in a bit. If weather permits, I'll be flying some more later today - my day off so making the best of it.

Daniel

p.s. docphi - how's the build going? Did you manage to solve the problems yet?

Edited by Daniel Wee
Link to post
Share on other sites

How are you doing the etching Khalid? Are you using a laser printer and that iron on paper you can get or some other method?

If your not trying the paper i'd suggest trying to find some this is their website: http://www.techniks.com/

It's pretty cool stuff :D

If you want, i'll throw a page in with your OSD :)

Edited by Mark Harris
Link to post
Share on other sites

More updates - okay I got the autopilot configured and its working now. I think this autopilot configuration is a painstaking process but since I can change the settings while the plane is still in the air, this helps alot.

As for the current sensor - I think the initial "beeps" that the ESC makes, kinda throws off the sensor. Either that or I need to improve my design a bit more for greater accuracy. It works and the figures are in the correct ballpark, but not spot on. For the moment though, I"m going to leave it as it is because I'm just wanting to enjoy flying after nearly 2 months of testing stuff now.

Daniel

Link to post
Share on other sites
How are you doing the etching Khalid? Are you using a laser printer and that iron on paper you can get or some other method?

If your not trying the paper i'd suggest trying to find some this is their website: http://www.techniks.com/

It's pretty cool stuff :D

If you want, i'll throw a page in with your OSD :)

Mark,

I'm using toner transfer with a laser printer and glossy photo paper. There's some bleeding and some of the traces that are close together actually short. I've actually ordered the techniks transfer paper for more consistent results. Thanks for the link and the offer!

K

Link to post
Share on other sites

Phew, the last few days has been hard work for me - I've been doing some major re-working of the code to get the efficiency level up and to address some nagging issues. The main problem I had earlier was that the BOB-4 would sometimes print spurious characters and garbage would appear on the screen, occassionally locking up the display (although the controller continued working).

This I finally traced down to the update speeds with the BOB-4 buffer filling up and overflowing - which resulted in a crash on the BOB-4 board. This led to my trying to read the buffer status from the BOB-4 but I was getting no data from the BOB-4, that is until I realized that the BOB-4 wasn't responding with the data quickly enough, requiring multiple reads (between 14 to 140! at times) before the data appears. This is partly attributed to the speed on my processor so that can't really be avoided. I finally got this down and managed to monitor the buffer size so that helped considerably.

A secondly problem I had was with the two GPS modules behaving differently. I had left that until now to investigate. After trying all the easy methods I could not solve the problem. Finally, I stuck a second serial port into the line to see what was going on. Well, a number of things actually. First of all, the 4800 baud this newer module meant that it took a longer time to clear the serial shift buffer and I was changing the baud rate too quickly, before the data was completely sent. This meant that the tail end of some of the configuration commands was getting corrupted. A small delay was all that was required to solve the problem. I've not checked it but this should be working properly now. In the process I found that you can use both PMTK220 and PMTK300 to set the update rate to 5Hz. I also discovered that PMTK314 can take 17 or 19 parameters without problems (some docs indicate 17, others 19).

I'm glad I finally nailed down these issues - now I'm going to finish off that code.

Edit: To make matters worse, my ICD2 programmer has been acting up and sometimes won't program the part properly.

Daniel

Edited by Daniel Wee
Link to post
Share on other sites

Daniel,

I've built your OSD (I decided to breadboard instead of etching, in case I needed to make changes). It seems to boot up ok! It says "Waiting for GPS data ...". My GPS receiver is pointing out my window, so it should take a bit longer to acquire. I'll keep you posted about what happens.

One question though about configuration bits in the PIC. What operating mode are you using for the clock? I assumed EC w/ PLL 8x? Also, what about some of the other bits, like watchdog timer, etc.? If I don't use the MCLR pin for programming (I use an external eeprom programer), should I tie it to VCC?

Can't wait to see what it's going to do next ;)

Link to post
Share on other sites

Okay, a couple of things - I've made quite a number of changes to the code which also need some changes to the configuration on the BOB-4.

First of all, with the new code - Pin 16 on the BOB-4SG needs to be grounded.

With that change you should use this latest code (not tested yet but should work, I hope). I'm still working on this code. The changes are:-

1. Improved timing in relation to the differently configured EB-85A GPS modules out there.

2. Trying for a more stable SPI connection to get rid of the occassional spurious character. What I found now was that the BOB-4 needs to be sent a NULL every now and then to get it back into sync. Of course, this was not mentioned in the manual at all so lucky me!

3. User input loop has been changed to get much faster response to input.

4. Some display features such as blinking should work correctly now. Before, it depended on how the board was configured by default.

5. More of the routines are now written in assembly for greater efficiency and easier porting to a different compiler (later on).

I'm not 100% sure that I have the timing completely nailed down as yet so expect to see quite a bit of code changes as I get round to that. I've just managed to sort out the SPI status reporting from the BOB and even then there's the random erroneous reading which can only be attributed to the BOB-4 latency. I'll need a while to sort this out.

Latest code here:-

NAVOSD software version 3.0

....

As for the configuration bits, it should be automatically set by the HEX file but if you want to change it, it should be XT w/PLL 8x. You really should use the default settings in the HEX file. If you're doing this in the MPLAB IDE, just check the "Configuration bits set in code" option under the "Configure" page.

I'm assuming that you're using the EB-85A correct? If it says waiting for GPS, it means that the serial port is not seeing any kind of activity from the GPS module. This could be due to incorrect connection - for example - TX/RX wires reversed. You may want to trace the RX on the dsPIC to the TX on the GPS module. This goes through the transistor.

Note, about that transistor - the PNP 2N3906, note that the Emitter is going to Ground. This is NOT your regular way of connecting a PNP transistor. Strangely it won't work if you connect it the right way round, so I should amend the schematic to reflect that the Emitter and Collector of the transistor is reversed. The net effect of this connection is simply to raise the whole signal about 0.4V higher. This should not be necessary but on some modules, it seems to be necessary to get a reliable reading.

Please post your results.

Daniel

Link to post
Share on other sites
Note, about that transistor - the PNP 2N3906, note that the Emitter is going to Ground. This is NOT your regular way of connecting a PNP transistor.

That implementation is essentially using the PNP's base-emitter junction as a simple silicon diode. So, you should be able to use a diode instead.

Strangely it won't work if you connect it the right way round, so I should amend the schematic to reflect that the Emitter and Collector of the transistor is reversed.

"Normal" wiring won't allow the PNP to turn off in this situation. You could use a pair of NPN's instead for a more traditional logic level conversion. But the diode trick is fine for low cost implementations.

Link to post
Share on other sites

You're right, that was it, I was following the schematic, which shows the collector going to GND. As soon as I switched the transistor, it worked. i think I also had the TX and RX wires wrong...

I figured out how to get the menu up, but I can't see the last few menu items. Is this because of the lower frequency xtal in the BOB-4 I have? (I got one with a 74.25Mhz crystal).

Daniel, any chance to get a quick tutorial on the functions, and use of the OSD? Thanks again for making this public, This thing is going to be an amazing OSD.

Link to post
Share on other sites

Just a quick one before I run off to work - the display issue is probably due to the fact that I am printing some stuff outside of the "safe zone" that usual TV's use. If you have an LCD type of monitor, you should be able to see all the other data at the edges of the screen. If that doesn't work, please tell me because it may also be due to that I am using a PAL system for my development and have not checked to see what this looks like in an NTSC type of situation.

Daniel

Link to post
Share on other sites

Oh, and Mr. RC-CAM is exactly right. I started off trying a slightly unorthodox PNP solution but that didn't work too well, and knew that to do it right, I'd need a two-transistor solution but was short of board space, so I decided to just reverse the transistor as a cheap way of getting around the problem. You can do it with a diode too, or actually, you don't really need anything in this situation since that diode will bias in the direction of the GPS module anyway. I'll play with it a bit more and see what I come up with.

Daniel

Link to post
Share on other sites
You can do it with a diode too, or actually, you don't really need anything in this situation since that diode will bias in the direction of the GPS module anyway. I'll play with it a bit more and see what I come up with.

I believe that you will find it necessary to use the diode (or a transistor's B-E junction diode), and the related pull-up resistor, in order to reliably accommodate the ST input of the DSPIC. It's important to meet the 4V min logic high level. The diode will help with that.

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...