-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
Implementation of RPM sensor #14018
Conversation
boards/px4/fmu-v5/default.cmake
Outdated
@@ -18,6 +18,7 @@ px4_add_board( | |||
DRIVERS | |||
adc | |||
barometer # all available barometer drivers | |||
rotor_frequency |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rotor_frequency | |
rotor_frequency |
Can you keep the list sorted alphabetically?
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Year
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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{}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the work queue within PX4. Here's an example - https://github.com/PX4/Firmware/blob/47cab3dba52520c4c3e9b42529152baf1148f1ee/src/drivers/lights/rgbled/rgbled.cpp#L63
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
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. |
…rkItem. Clean code.
…l - (its usefull for debuging i2c drivers on linux machines, but it makes build problems on other systems )
@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. |
…re not limitated to rotor frequency
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. |
boards/px4/fmu-v5/default.cmake
Outdated
@@ -18,7 +18,7 @@ px4_add_board( | |||
DRIVERS | |||
adc | |||
barometer # all available barometer drivers | |||
batt_smbus | |||
batt_smbus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
batt_smbus | |
batt_smbus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably fixed.
msg/CMakeLists.txt
Outdated
@@ -160,6 +160,7 @@ set(msg_files | |||
vtol_vehicle_status.msg | |||
wheel_encoders.msg | |||
wind_estimate.msg | |||
rpm.msg |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sry - fixed
src/drivers/rpm/pcf8583/pcf8583.cpp
Outdated
@@ -0,0 +1,435 @@ | |||
/**************************************************************************** | |||
* | |||
* Copyright (c) 2013-2020 PX4 Development Team. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Copyright (c) 2013-2020 PX4 Development Team. All rights reserved. | |
* Copyright (c) 2020 PX4 Development Team. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okey
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.
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).
So, with this pull-request, I would like to merge our driver with the master.