In the CLI when I enter the altitude test mode I never seem to get a response from the sonar. I get values that look like this:

B_alt: 3801088, S_alt: -805257695
B_alt: 3801096, S_alt: -805257695
B_alt: 3801122, S_alt: -805257695
B_alt: 3801122, S_alt: -805257695
B_alt: 3801114, S_alt: -805257695

or sometimes like this:

B_alt: 70, S_alt: -805257695
B_alt: 96, S_alt: -805257695
B_alt: 122, S_alt: -805257695
B_alt: 140, S_alt: -805257695
B_alt: 114, S_alt: -805257695

Which raises another question: what kind of values am I supposed to be getting for the barometer?

I've confirmed that the sonar is enabled, I've also checked it with a voltmeter to see that it's outputting a voltage relative to it's proximity to objects. I'm using a Maxbotix LV-EZ4 sonar.

I'm also pretty certain that my barometer was working under Ardupirates, as I was able to use altitude hold fairly high up. Anyway, it seems to respond to changes in the quad's height (me waving it around), I'm just not sure why I get values in the millions sometimes, and values in the hundreds some other times.

Tags: Sonar, barometer

Views: 79

Reply to This

Replies to This Discussion

Also looking at code it seems to default to use the XL sonar rather than LV. I tried changing that to LV like in pirates code , but it generates a compile error.

Al

Where did you try and make the change? On line 183 of ArduCopterMega.pde I changed:

AP_RangeFinder_MaxsonarXL sonar;

to:

AP_RangeFinder_MaxsonarLV sonar;

 

It compiles but I don't it makes a difference.

Am I correct in assuming that any #defines I add in APM_Config.h will override the same #defines found elsewhere in the code?

Yes that's were I tried it.

 

I just went back and tried again and it compiled - I must have made a typo initially.

 

Interesting that it made no difference. I will try in AM. with the ardupirates code, the change made a difference for me and the readings were much more accurate. I'll report back

 

Al

am also getting weird numbers, B_alt oscillates around 100+/-50, sometimes dropping to 0 and sometimes  up to 65000, without any movement of the apm, also no props installed, so that cant be the issue...
This has been fixed as of r2242 with a change to a printf type variable. Either check the changes in the trunk and make the modification manually, or download the latest trunk code to get up to date. ;)
I'm not too familiar with how the repository works. If I go to r2242 the only file with that rev is GCS_Mavlink.pde. Is that where the changes have been made for that revision?
download tortoise svn if youre using windows or versions if mac and checkout the whole repository, that way you get always the latest code.
Thanks! The latest version seems to be giving more sensible values for the barometer. From the sonar however, I get values around 330. They don't change when I raise or lower the quad, or when I remove the sonar! Something's not right there...

So to be a bit more clear on this...is the latest stable code on the download link from the main arducopter page (all zipped up) or should we go to the trunk for the best code?

 

its like this: the latest code wich should be stable is on the main page all zipped up. BUT! that code is in beta, and it means that there are some bugs wich are continually fixed and those fixes are revisions in svn. unfortunately, by fixing something somewhere, you can break something elsewhere, thats why the revisions in svn cant be "trusted" to be stable until someone wont test everything altogether and say that everything is working fine.

anyway, latest svn code is working much better than the beta. i wouldnt trust it to strap a dslr to a quad running it or even test it without strapped to something heavy so it wont flys away and kills someone...

Thanks, that clears that up.

Not too reassuring ;) 

but clears it up.

 

its better than it sounds. working on "large" opensource projects is like this :)

RSS

Social Networking

Contests

Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.

A list of all T3 contests is here

Groups

Advertisement

© 2013   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service