sakuraclamp / arducopter

Automatically exported from code.google.com/p/arducopter
0 stars 0 forks source link

Voltage and current monitoring inop with APM2, and can't adjust with MP #313

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Configuration: Arducoper 2.2 with APM2

Voltage and current monitoring are not working with APM2. The pin numbers used 
for the ADC didn't match the layout of the current and voltage sensors in the 
Wiki, so fixed this with automatic APM1/APM2 selection of the pins. The voltage 
display and battery remaining percentage values on the MP HUD page work now.  

Also noticed that the voltage and current scaling parameters cannot be set from 
the MP the way they are with Arduplane, so added parameters to parameters.h 
using the same names as in Arduplane. The same applies to APM1 and APM2. The MP 
dialog box for setting the voltage scaling still doesn't work, but you can make 
the adjustments via the parameter list in the MP. The default values should be 
close for anyone using an APM2. Default values for APM1 haven't changed. 

All changes are shown in the attached file. The code should work for APM1 and 
APM2, but I have only checked with APM2.

I also suspect that the sonar input pin is not correct for APM2 (should be 0 
rather than 2 to match the Wiki), but I am not running with sonar yet, so can't 
be sure. Probably needs something like
# define SONAR_SOURCE_ANALOG_PIN 0
# define CONFIG_SONAR_SOURCE SONAR_SOURCE_ANALOG_PIN
in the APM_HARDWARE_APM2 section.

I hope that this helps,
Andrew

Original issue reported on code.google.com by AndrewJF...@gmail.com on 15 Jan 2012 at 10:14

Attachments:

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Voltage and current monitoring were fixed in 2.2B3.

Thank you,
Andrew

Original comment by AndrewJF...@gmail.com on 24 Jan 2012 at 5:41

GoogleCodeExporter commented 8 years ago
Seems that I can confirm that there is something fishy about sonar operation 
with APM2.
I run APM2 with AC2.2v4 quad, loaded from MP, and sonar readings in CLI test 
constantly about 100cm. Analog signal from sonar sensor confirmed ok.

PLEASE correct this so that sonar works on APM2 without code modification. 
Thanks
Tomas

Original comment by tomas.so...@gmail.com on 26 Jan 2012 at 10:51

GoogleCodeExporter commented 8 years ago
Fixed!  
http://code.google.com/p/ardupilot-mega/source/detail?r=ed234399b0bea4cb79307d15
0989dcb02cebad02

@tomas,
    Sorry, there was some confusion about where to connect the sonar (A0, A1 or A5).  For arducopter it should be A0 as shown on this wiki page : http://code.google.com/p/arducopter/wiki/AC2_Sonar

    So if you're loading the code directly from trunk using git you should get the lastest code and attach your sonar to a0.  If you're using the code from the AP Mission Planner it's likely A1.

Original comment by rmackay...@gmail.com on 26 Jan 2012 at 1:55