Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ezosd current sensor integration #292

Closed
wants to merge 3 commits into from
Closed

ezosd current sensor integration #292

wants to merge 3 commits into from

Conversation

gtoonstra
Copy link
Contributor

This is a draft integration of the ezosd current sensor. It outputs voltage, current and mAh consumed. For every i2c request on the bus, it reads only 10 bytes. Every sensor has a slightly different configuration on current gain etc., so some calibration may be required (see immersionrc product page). Most important here are accurate readings for voltage, but current and mAh consumed can become useful in the future for mWh calculations and knowing when to go for home. This sensor is also useful as a regulator for a +5V power supply directly off the battery (with reasonable current consumption) and there is another terminal at +VBATT that can be spliced up for other equipments like 12V tx's and such.

I've got the GND, DAT, CLK connected during testing, but only connect +5V when USB is not connected on the LIsa for obvious reasons.

In this commit I also disabled the regular "electrical" module, which assumes voltage and current measurement on analog pins, as these would otherwise regularly overwrite the ezosd measurements. There may be better ways to do this, as now it probably depends on compiler optimization for the code not to be included.

The ezcurrent module is implemented as a standard sensor module in xml, so it can be 'loaded' as a module in the airframe. What may be necessary is a standard define on the port it's expected:

Testing:

  • voltage output correct.
  • current not fully tested in this implementation, but observed correct in other implementations of the same module on arduino.
  • consumption not fully tested in this implementation, but observed correct in other implementations of the same module on arduino.

Unsure:

  • Whether the sensor SCL/SDA are 5v/3.3v. the lisa pins are definitely 5V tolerant though, but not sure if the other side was built for either 5v or 3.3v.

<module name="ezcurrent" dir="sensors">
<doc>
<description>EzOSD Current sensor (I2C)</description>
<define name="EZCURRENT_I2C_DEV" value="i2cX" description="change default i2c peripheral"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add the default i2c port to the description? And a comment that this disables the normal electrical subsystem...

@flixr
Copy link
Member

flixr commented Oct 6, 2012

Thx, and sorry about the many comments about style, etc..
I know we are not consistently using doxygen, etc.. but no reason not to do this for new files while we clean up the existing ones bit by bit...

While this should certainly work nicely, I'm wondering if we should look at changing the electrical subsystem to allow multiple implementations. We are always adding more and more #if, which is really not so nice...

Also if it the current gain really needs to be adjusted, it would probably be nice to have that as a define in the module...

@gtoonstra
Copy link
Contributor Author

All comments taken care of. Please review again.

Better approaches to electrical monitoring should certainly be considered. None of the products do everything at the moment, but it's always a bit of a struggle to first take care of a BEC, then find out either 5v or 12v cannot be provided. A board that provides properly regulated 5v, 12v connectors, the current that's needed and does the electrical monitoring using i2c is certainly a very interesting proposal.

@flixr flixr closed this in 982dc02 Oct 8, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants