Jump to content
Mr.RC-Cam

Artificial Horizon

Recommended Posts

Mr. RC-CAM,

I don't have lots of luck with my version AHI either. One thing or another keeps me from making a good run. I am now investigating if CRC routine in my modem causes some frames to be dropped. Anybody has a reference for CRC calculation written in C?

There is no rush for making an order unless we confirm that sensor actually works.

Mike,

Third sensor helps in several ways. From a very general point of view: model flies in 3-D world and one needs 3 dimensional sensor to get the orientation right. 2-D sensor is a simplification that reduces cost but creates all the different problems: not able to distinguish up from down, drift in exact angle measurements, etc.

Zero level calibration still needs to be done with 6-sensored version but it only needs to be done once to configure sensor on a particular model. That calibration step can also be performed during AHI device assembly but then one needs to make sure that sensor is perfectly alligned with the model, sensors are always clean, etc.

Share this post


Link to post
Share on other sites

I'm looking at some C code that I based a Tcl implementation. The code references RFC-662.

It was really quite easy to build a checksum or verify the validity of a checksum based on a (pre-generated) lookup table and a C (or Tcl) 1 liner.

Also, a buddy did a similar algorithm (we're always re-inventing the wheel) here's the web site he referenced:

http://cell.onecall.net/cell-relay/publica...s/software/CRC/

Our CRC's matched (for the 32 bit version), so we figured we got it right.

Dave Thomas

Share this post


Link to post
Share on other sites

Should have said RFC-1662. And when I tested the link, I found it to be dead. However, I surfed the website and found the following:

http://cell.onecall.net/cell-relay/publica...32bitCRC.c.html

The implementation looks very similar to the code on which I based my Tcl implementation.

Dave Thomas

Share this post


Link to post
Share on other sites

Thanks Dave,

I am looking at the code now.

Val.

PS. Is this the longest thread on this forum or not?

Share this post


Link to post
Share on other sites

I finished up the digital gain routines. Now the scaling of the IR signal can be adjusted in software. That, along with the zeroing function, are bare essentials.

I originally thought I would just have the system decide what the gain should be based on the ambient conditions during the nose down cal step. But I had no idea what would be best (should I make it really sensitive or dull it down?). The solution was to just let the user choose at the field via menu selections.

There are 10 levels of digital gain sensitivity. At this point dynamic adjustments are NOT made during flight if the conditions change (3rd axis sensor is not used). Doing that now would probably cause me to go into a mental melt down. ;)

Next step is to create the menus that allow the user to configure the system. The user will be able to enter their ham call sign, set the digital gain, perform the zeroing, axis reversing, and enable/disable the filter. And whatever else comes up.

I guess what I am saying is that the project is still moving forward. I will post updates as more is completed.

Share this post


Link to post
Share on other sites

Cyber-Flyer, I can now disable the filtering at will. The glyph response time is very quick with it off. I have not performed a video frame review to see what the response is in mS, but when I view my hand waving madly at the sensors, the glyph indicators appear to be in sync. With the filter on I can definately see a little lag. I'll try to post another backyard video that shows the digital gain and filtering differences.

I am nearly done with a crude menu that will allow me to perform field setups. So, I can go forward with a test flight in the next few days. At this point a convenient R/C test platform is needed. So, earlier this week I started a brushless upgrade on the retired SlowStick. But some parts are needed to get it ready (on order).

There is just too little time in a day to do all these little chores. ;)

Share this post


Link to post
Share on other sites

Cool, please let us see the video when available. I'm where I was last week, no progress, really looking forward to the long weekend.

Share this post


Link to post
Share on other sites

Here is the latest video of the prototype: MAHI DEMO VIDEO

The video is similar to the samples of what has already shown, so please don't expect anything exciting. Probably not worth a dial-up modem download.

I have not performed a video frame analysis to determine the response times. So, I'll leave that up to one of you folks that wish to measure it. With the filter off, the delay is expected to be less than one video frame (<33mS) plus the thermopile's IR response times.

The direction of the glyphs' travel is arbitrary at this point (I have not worried, just yet, which way is what). So that I can start off on the right foot, can you fullscale pilots comment (again) on which direction the indicators should tilt for the two axis attitude movements. I'm not sure if I can trust my instincts.

Share this post


Link to post
Share on other sites

Mr. RC-CAM,

It looks great - both sensitivity and roll speed are pretty good!

I'd vote for glyphs displacement be in the direction of where center tick must go to make model level - the way you have it setup.

Val.

Share this post


Link to post
Share on other sites

I spent another full day on the software (took some holiday time this week to work on the project). The S/W seemed far enough along to warrant a beta code validation, so that is what was performed today.

I have not written the final code for the user interface. But, as mentioned, there is enough in place to allow a sensor calibration out in the field.

Everything seems to work well. I was even able to increase the roll axis resolution quite a bit; it is now less "coggy" at the high digital gains. Both axis have over 200 steps of resolution at low digital gains and about 80 steps at the highest gains. That is better than I expected and allows for very smooth glyph movement.

The PIC is getting full, but there are enough remaining ROM/RAM resources to do everything I originally planned for the 2-axis sensor equipped design. I have less than 1K of code space left (out of 4K), much of which will be taken up by the expected user interface code.

I benchmarked the PIC's clock cycles and found that I now have only 25uS of spare time left in-between video frames (the video gen S/W takes up the rest). That is good for about another hundred or so lines of code. Very close call indeed. This is the area where I was worried the most -- seeing that it all fit is a big relief.

Operating the unit in its present form is not too tough. The camera, video Tx, and battery, all plug into the little OSD PCB. A PCB mounted LED blinks to indicate that the video is gen-locked to the camera video.

There is a little push switch on the PCB that allows me to perform the zeroing function. Two removeable push switches (they plug in) allow me to set the digital gain (up/down). Later, I plan to use these three switches to traverse a simple setup menu. But that can wait.

I will continue to use this thread as a project blog/diary. I'll keep you all posted as things progress. In a nutshell: so far, so good. ;)

Share this post


Link to post
Share on other sites

Test Flight Status: The only major thing keeping me from the test flight is a brushless controller for the SlowStick. The vendor says it will ship next week.

I am about as far along with the project as I need to be for the initial field test. I did add a new feature -- battery voltage now appears on screen every 20 secs. It seems to be decenty accurate (under 2% error). I also now save the gain and offset (level/zeroing) in EEProm memory, so this stuff no longer needs to be re-calibrated with every power up.

Speaking of brushless controllers, I need another CC Phoenix 25. They are about $65 online. But, I am looking to save a bit. So, perhaps you know of someone that has one, with recent firmware, that is no longer wanted. If so, then let's talk!

Share this post


Link to post
Share on other sites

I'd like to add my bid for your board when you're adding up orders. I just got a new Co-pilot, and have not been watching this for quite awhile! Looks like it's almost a reality. Bill S.

Share this post


Link to post
Share on other sites

Here is a sample video from the test of my AHI system:

http://www.cyber-flyer.com/2004/0605_AHI_1.mpg

I worked to reduce lag as much as I could but it is still there at around 0.2-0.3 sec.

The biggest problem is that AGWPE introduces 0.1sec lag and this limits refresh rate to 10 Hz. Also you can see that horizon level is not perfect, the system makes left bank error as I fly South down the runway, and right bank error when I am going back the same route. The horizon appears to be terrain dependent, I believe the field is hotter than trees next to the river and this creates an error.

Share this post


Link to post
Share on other sites
Here is a sample video from the test of my AHI system:

Drat, the file does not play for me. I tried three different players and none liked it. For example, my MS Media Player 7 thinks it is a sound file.

Share this post


Link to post
Share on other sites
Drat, the file does not play for me.

This is very strange. Somebody else had the same problem. Yet I can see the video stream from home and from my office PC. I'll try to rencode the movie again.

Share this post


Link to post
Share on other sites

Cool video! Played on Real Player. Maybe if you took her up real high, you would get a better thermal horizon. Looks real good! The music wasn't great though.

Share this post


Link to post
Share on other sites

Ive not followed this thread too close so forgive me if I have missed the point. Are you sensing the horizon or the sky ? I have done some testing on a optical auto pilot myself and found the best results were using sensors that are sensitive to blue. I tried some others that were sensitive to IR and found they were good at seeing the horizon but if the horizon was lost it had big trouble locking on again.

Nice vid though !

Terry

UK

Share this post


Link to post
Share on other sites

This is very strange. Somebody else had the same problem. Yet I can see the video stream from home and from my office PC. I'll try to rencode the movie again.

It’s variable bit rate (VBR) MPEG1, any DVD player software will register the codec needed to view it. Then you should be able to watch it with media player possibly even after the demo expires.

M$ can only play standard constant bit rate mpeg1 files on it’s own, the Motion Picture Expert Group wants to be paid for every VBR DVD codec installed. I guess M$ didn’t want to play that game. ;)

There is a free trial of PowerDVD here.

http://www.gocyberlink.com/english/downloa...ad/download.jsp

By the way, cool video Cyber!

It’s neat to see what a co-pilot sensor is thinking

Share this post


Link to post
Share on other sites

Thanks IA-Flyer, for explaining this video codec mystery.

If anybody cares there is another video:

http://www.cyber-flyer.com/2004/0605_AHI_2.mpg

where the heli was pushed around at faster pace. Gives you an idea how error in horizon indication relates to the delay.

Are you sensing the horizon or the sky ?

Technically speaking co-pilot senses IR gradient between ground and sky. This is not the same as visual horizon but should be close.

Share this post


Link to post
Share on other sites

Val,

I've never had much luck in using the CoPilot at our flying field.

Our field is next to a large lake, so I thought maybe that's why the co-pilot didn't work well for me. It would correct attitude to near level, but I could never trim it or adjust the mounting of the sensor so that it wasn't "fighting me" for maintaining a perfectly level attitude.

Do have similar problems using your CoPilot for stabilization at your flying field (at the same altitudes as your AI test video?)

Dave Thomas

Share this post


Link to post
Share on other sites
I've never had much luck in using the CoPilot at our flying field.

I was never able to make co-pilot to work to my satisfaction with helicopter. It was kind of working ok but it felt that trim will be slightly off. Not huge errors, but enough for me to realize that I can not rely on co-pilot 100%. It may be good to keep model reasonably level, but not precise enough to maintain helicopter speed using attitude inputs. In other words I can not close my eyes, and know at what rate heli will be moving based on stick input. And often I needed to "fight" co-pilot to keep helicopter level. I was thinking that my calibration procedure was to blame and tried to recalibrate co-pilot, which took good amount of time and several attemtps before it would be acceptable.

My recent flights show that co-pilot is not as precise as many (including me) thought. It can be a premature conclusion, I need to put more flights on it. Hopefully Mr. RC-CAM will test his version soon and it will give more insights about how uniform IR horizon actually is.

Edited by cyber-flyer

Share this post


Link to post
Share on other sites

Where do you have the sensor mounted? Looks like the right side of the heli. I wonder, too, how quickly a 'real' glass AI responds. I doubt any plane could change attitude/direction as quickly. A shot making a long gentle approach, and landing would be easier to follow. Also, not sure how much of the original circuitry you are using, but does your design have to be adjusted for 'the day'? I notice the FMA instructions say to set first flight and and when weather changes 'signifigantly'-what does that mean? If it would benefit the cause, I have a NIB Co-pilot I would send you to test, who knows if there is any variation from unit to unit. You can email me your address if it will help. Project looks so close! Bill S.

Share this post


Link to post
Share on other sites

Thanks, no need to send co-pilot sensors, I already accumulated three of them.

They are all pretty close to each other in terms of their IR response. I placed original FMA's 2D sensor behind the main shaft on my heli and 1D (z-sensor) is on the tail boom near horizontal stabilizer.

Share this post


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