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

Implementation of RPM sensor #14018

Merged
merged 23 commits into from
Feb 2, 2020
Merged

Conversation

roman-dvorak
Copy link
Contributor

@roman-dvorak roman-dvorak commented Jan 24, 2020

Hi,
we have developed an RPM sensor for the measuring of the speed of rotary things (propeller, rotor, engine RPM, ...). Our colleague @slimonslimon assembled software for collecting data from the sensor and logging them in PX4 autopilot.

TFRPM01 sensor is based on PCF8583 counter. The sensor is fully open-source and manufacturing data are available on GitHub. The sensor board is equipped with a (two troughtpass) px4 standard I2C connectors, with led for quick diagnostic and with sensor 3 pin connector.

063A9592c

TFRPM01 does not contain the sensor itself, because it supports to connect many of types of sensors. For example a hall probe with magnets, some optical gate or reflecting light sensor.

RPM is quite important to know for rotor based aircraft (helicopter, autogyro, ..). It can be also used for in-flight diagnostic of ESC (and engines).

Snímek z 2020-01-24 01-23-34

So, with this pull-request, I would like to merge our driver with the master.

@dagar dagar self-requested a review January 24, 2020 01:31
@@ -18,6 +18,7 @@ px4_add_board(
DRIVERS
adc
barometer # all available barometer drivers
rotor_frequency
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
rotor_frequency
rotor_frequency

Can you keep the list sorted alphabetically?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, repaired in new commit

@@ -0,0 +1,702 @@
/****************************************************************************
*
* Copyright (c) 2013-2016 PX4 Development Team. All rights reserved.
Copy link
Member

Choose a reason for hiding this comment

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

Year

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


/* Configuration Constants */
#define PCF8583_BUS_DEFAULT PX4_I2C_BUS_EXPANSION
#define PCF8583_DEVICE_PATH "/dev/pcf8583"
Copy link
Member

Choose a reason for hiding this comment

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

The dev and ioctls can be gutted. Everything is done over uORB and parameters.

Copy link
Contributor

Choose a reason for hiding this comment

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

Done in last commit. But these defines remains for I2C class..

int _reset_count;
int _magnet_count;
uint64_t _lastmeasurement_time;
work_s _work{};
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Done.

@jinchengde
Copy link
Contributor

jinchengde commented Jan 25, 2020

that's very useful with hall sensor to monitor the status of gas engine, that will be better if support any hall sensor connect aux pin directly.

…l - (its usefull for debuging i2c drivers on linux machines, but it makes build problems on other systems

)
@roman-dvorak
Copy link
Contributor Author

that's very useful with hall sensor to monitor the status of gas engine, that will be better if support any hall sensor connect aux pin directly.

@jinchengde This counter can measure frequencies to 20kHz without any additional load to autopilot CPU. Therefore we decided to design this sensor.

As I mentioned above, this PCB doesn't contain the hall sensor itself. And it supports the connection of external sensor. For example hall sensor, optical gate or other puls signal. And yes, it can be used for measuring engine RPM.

@roman-dvorak roman-dvorak requested a review from dagar January 25, 2020 17:57
@roman-dvorak roman-dvorak marked this pull request as ready for review January 27, 2020 19:46
@slimonslimon
Copy link
Contributor

I have renamed rotor_frequency to rpm in last commit. I think this name is better, because the driver is not limited only to rotors.

@@ -18,7 +18,7 @@ px4_add_board(
DRIVERS
adc
barometer # all available barometer drivers
batt_smbus
batt_smbus
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
batt_smbus
batt_smbus

Copy link
Contributor

Choose a reason for hiding this comment

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

probably fixed.

@@ -160,6 +160,7 @@ set(msg_files
vtol_vehicle_status.msg
wheel_encoders.msg
wind_estimate.msg
rpm.msg
Copy link
Member

Choose a reason for hiding this comment

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

We try to keep the list sorted alphabetically.

Copy link
Contributor

Choose a reason for hiding this comment

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

sry - fixed

@@ -0,0 +1,435 @@
/****************************************************************************
*
* Copyright (c) 2013-2020 PX4 Development Team. All rights reserved.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Copyright (c) 2013-2020 PX4 Development Team. All rights reserved.
* Copyright (c) 2020 PX4 Development Team. All rights reserved.

Copy link
Contributor

Choose a reason for hiding this comment

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

okey

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.

4 participants