Hello - I have the attopilot current/voltage sensor connected to AN0 and AN1, as per the arducopter2 wiki. I have also enabled battery mode "4" in the CLI mode.

 

However, when read the voltage, it is showing around 3 volts. I am aware that the scaling needs to be changed in the firmware, but am not sure where, etc.

 

Can someone help? What do I need to do to correct the scaling so I can get an accurate voltage measurement?

 

Thanks a lot!

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • set the voltage divide ratio by hit and trial in APM_config.h file. try a value between 5 and 15. use a voltmeter to calibrate at any two positions. this is the best way to get accurate voltage.
  • The wiki recommends not to use the Voltage sensor output on the ATTOPILOT, as the APM Oilpan has a better ADC.

    So I have connected AN0 straight to the Lipo 3S tap (fused, just to be safe :) using the 3.9k resistor on the board.

    AN1 is connected to the current sense output of the ATTOPILOT without resistor. 

     

    Below the scaling factor that work for me with an about 10% error on the Current measurements.

    If you figure out better ones, please share!

     

    //////////////////////////////////////////////////////
    #define BATTERY_EVENT                 ENABLED
    #define LOW_VOLTAGE                   10.6
    #define VOLT_DIV_RATIO                3.56
    #define INPUT_VOLTAGE                 4.86
    #define CURR_AMPS_PER_VOLT          15
    #define CURR_AMPS_OFFSET          0.0
    #define HIGH_DISCHARGE              2200

  • I am assuming you are using it for total curent and voltage? If so, AN0 gets a 3.9k resistor. Then connect gnd to gnd, A3 on APM to current on attopilot sensor, and A4 on APM to voltage on attopilot.

     

    Neil

    

    

This reply was deleted.

Activity

DIY Robocars via Twitter
RT @chr1sa: Donkeycar 4.4 released with tons of new features, including path learning (useful with GPS outdoors), better Web and Lidar supp…
Nov 27, 2022
DIY Robocars via Twitter
RT @NXP: We are already biting our nails in anticipation of the #NXPCupEMEA challenge! 😉 Did you know there are great cash prizes to be won…
Nov 24, 2022
DIY Robocars via Twitter
RT @gclue_akira: レースまであと3日。今回のコースは激ムズかも。あと一歩 #jetracer https://t.co/GKcEjImQ3t
Nov 24, 2022
DIY Robocars via Twitter
UC Berkeley's DIY robocar program https://roar.berkeley.edu/
Nov 24, 2022
DIY Robocars via Twitter
RT @chr1sa: The next @DIYRobocars autonomous car race at @circuitlaunch will be on Sat, Dec 10. Thrills, spills and a Brazilian BBQ. Fun…
Nov 24, 2022
DIY Robocars via Twitter
RT @arthiak_tc: Donkey car platform ... Still training uses behavioral cloning #TCXpo #diyrobocar @OttawaAVGroup https://t.co/PHBYwlFlnE
Nov 20, 2022
DIY Robocars via Twitter
RT @emurmur77: Points for style. @donkeycar racing in @diyrobocars at @UCSDJacobs thanks @chr1sa for taking the video. https://t.co/Y2hMyj1…
Nov 20, 2022
DIY Robocars via Twitter
RT @SmallpixelCar: Going to @diyrobocars race at @UCSDJacobs https://t.co/Rrf9vDJ8TJ
Nov 8, 2022
DIY Robocars via Twitter
RT @SmallpixelCar: Race @diyrobocars at @UCSDJacobs thanks @chr1sa for taking the video. https://t.co/kK686Hb9Ej
Nov 8, 2022
DIY Robocars via Twitter
RT @PiWarsRobotics: Presenting: the Hacky Racers Robotic Racing Series in collaboration with #PiWars. Find out more and register your inter…
Oct 23, 2022
DIY Robocars via Twitter
RT @Hacky_Racers: There will be three classes at this event: A4, A2, and Hacky Racer! A4 and A2 are based around UK paper sizing and existi…
Oct 23, 2022
DIY Robocars via Twitter
Oct 23, 2022
DIY Robocars via Twitter
Oct 19, 2022
DIY Robocars via Twitter
Oct 18, 2022
DIY Robocars via Twitter
RT @NeaveEng: Calling all UK based folks interested in @diyrobocars, @f1tenth, @donkey_car, and similar robot racing competitions! @hacky_r…
Oct 13, 2022
DIY Robocars via Twitter
RT @araffin2: 🏎️ After hours of video editing, I'm happy to share a best of my Twitch videos on learning to race with RL. 🏎️ Each part is…
Oct 13, 2022
More…