xfce

  • **
  • 91
Hi all
      I have a question, I use a simple basic voltage divider, two resistors 10K and 30K, 3S battery

from the code
Code: [Select]
flightBatteryData.Voltage = (PIOS_ADC_PinGetVolt(voltageADCPin) - batterySettings.SensorCalibrations.VoltageZero) * batterySettings.SensorCalibrations.VoltageFactor; // in Volts
So in the GCS
does it means the VoltageFactor=4 ? thanks

f5soh

  • *****
  • 4572
    • LibrePilot

It cuts voltage by a factor of 4, but only if the 10k is attached to ground and 30k to V+.

xfce

  • **
  • 91
It cuts voltage by a factor of 4, but only if the 10k is attached to ground and 30k to V+.
yes i connect this way. but the result is not right.
i use PWMOUT6 for ADC,  and in GCS set as bellow

f5soh

  • *****
  • 4572
    • LibrePilot
When you say the value is not right... whats the reading ?

If you want to use the servo output6 as adc input you should set  "Battery Voltage" on adc6

adc1 is one FlexiIO pin
« Last Edit: January 23, 2016, 10:59:39 am by f5soh »

xfce

  • **
  • 91
When you say the value is not right... whats the reading ?

If you want to use the servo output6 as adc input you should set  "Battery Voltage" on adc6

adc1 is one FlexiIO pin

Thanks ,It's OK now.
I read from the nano codes' comment as bellow, so i consider output6 is adc1, could you please tell me all the right IO mapping,thanks.


 

f5soh

  • *****
  • 4572
    • LibrePilot
Maybe this comments are a copy/paste from Revo...

xfce

  • **
  • 91
Thanks!
Does the software uart used for upgrade blheli ESC? And is there some user guide link

f5soh

  • *****
  • 4572
    • LibrePilot
This feature is not implemented

Klingan

Hi

I have a Revo and am trying to setup my current sensor. The main port and the flexi is used for telemtry and gps so I want to use the sonar port.
My PWR/sonar port is disabled and grey on my configuration/hardware tab so I can't enable it. Inside the wiki it says (somewhere) that the port is disabled for future implemenatation of sonar support etc. But the wiki also says that I can use a attopilot current sensor and hook it up to the "sonar port"/pwr.

How do I enable it?


Klingan

Re: How to setup the battery's VoltageFactor use simple basic voltage divider
« Reply #11 on: January 31, 2016, 04:53:31 pm »
I already read from that guide but midway I got confused since the hardware tab says that the port is disabled and grey.
But after finishing the guide it works (even though the port is "disabled"). Thank you : )

f5soh

  • *****
  • 4572
    • LibrePilot
Re: How to setup the battery's VoltageFactor use simple basic voltage divider
« Reply #12 on: January 31, 2016, 04:58:23 pm »
The wiki page do not mention the hardware tab, why got confused ? :)

Klingan

Re: How to setup the battery's VoltageFactor use simple basic voltage divider
« Reply #13 on: January 31, 2016, 05:18:43 pm »
Well I forgot to restart the board so it didn't work at first. And all other ports main/flexi etc need to be enabled and set to something to work so I just thought that was obvious. But like I said, now it works : )