RPM Sensor Wiki - Knowledge Share

OK, so the param variables are being resized :+1:

Send me a link to your branch and I can have a look for you.

Matt¡ Thank you for doing this. This is the link of my branch. I really appreciate it. :grinning: :pray:

I have found the issue and created a PR against your branch. In short, it wasn’t anything that you were doing wrong. It was just a bit of a confusing situuation with the way that the param variables are created.

Dear Matt:

Thank you very much for taking the time to review this and for your patience. You are saving my life. I incorporated all the changes from your kindly contribution on the Fix parameter memory allocation you shared.
I made a clean build of the project with:
./waf configure --board fmuv3
./waf copter

Then I flash the firmware into the physical board Pixhawk, by selecting Load custom firmware and arducopter.apj in Mission Planner. After a successful load, I press Connect -> CONFIG and go to the Full Parameter List.
I hope to see the new parameters RPM3_PIN and RPM4_PIN and their corresponding RPM3_SCALING, RPM3_TYPE and RPM4_SCALING, RPM4_TYPE to be able to set up them. But these do not appear in MP. The same thing happens to you when you try to load the modified firmware with these changes in MP?
Do you think I should do an additional step to see these new updated parameters in MP?
I’m sorry, I don’t know if the solution of this would be related with chosing the wrong board in the compiling process, or do I have to request a pull request in the master branch so that MP allows me to see these changes or do I have to do an additional step in which these variables can be seen in MP? Please, any insights are greatly appreciated it.

Hi Giovanna,
This is getting outside of the RPM specific stuff now. So I will PM you to assist, so as to keep this thread specific to RPM senors.

1 Like

Dear Matt, we are trying to get the RPM. We have a standard outboard motor installed. The tachometer signal comes out from the motor, we send a 5 volt signal to the HEX Pixhawk CUBE BLACK 6 aux pin 55 through the optocoupler. The ardopilot does not show RPM1.
temp.param (14.8 KB)
Can you help us in any way?
Link to our project.

Hi Alexander,
I notice in your param file that relay_pin and relay_pin2 are set to 54 and 55 respectively. I assume you are not using relay. Try setting these to -1. That may be the cause of your issue.

What does the signal from the tachometer look like? Is it 0 to 5 V plus signal? Like that shown in the example on the wiki?

Hey, whats the maximum number of RPM Sensors (I would need 4/6) that can be accomodated on a Cube Black, looks like you did 4, and also is it supported by PX4 Firmware yet or just Ardupilot? Thanks in advance!

Yes that’s true, I was able to get 4 working with Matt’s @IAMMATT help. I think the maximum number of RPM sensors you can accommodate is 6, as it depends on the number of auxiliary pins on the Cube Black that you can program as GPIO. I think you will have no problem implementing them. Regards.

Thank you so much, I will test it out.

Hey, a couple of doubts, I feel the others might be benefitted out of it as well:

  1. Instead of the AUX Pins on the Cube Black, can we connect the sensor to FMU-PWM-OUT or IO-PWM-OUT of Pixhawk4 and get the RPM values directly? and if so, does the AP.RPM Library for Pixhawk4 does the same calculations like on the AP.RPM library in the Cube Black?
  2. What was the data rate that you used of the 4 sensors that you had implemented?
    Would be great if you answered these questions, thanks in advance!

Only sensors connected to the fmu can be used. There is a buffer between the fmu and iomcu that means we can’t read from the iomcu pins.

Regarding the rest of your questions, I would recommend looking over the wiki page on Rpm sensors for how Rpm Aux pin sensors work:

Hall effect Rpm sensors work exactly the same for every board and they do not have a data rate. We calculate the Rpm based on the time passed and number of falling edges in the voltage signal.

This is my setup and parameters, im testing out one sensor and it fails to read rpm.
Same thing works seamlessly on Cube Black and Arducopter v 4.0.6
Now i have flashed Arducopter v4.0.6 for Pixhawk4

Any help would be appreciated!

Is this causing any problem?

Relay is off so that’s good.

Also check that you have set BRD_PWM_COUNT to 4 or or less.

Ok will do so, can you verify my FMU-PWM-OUT connections, if thats right i dont see any other reason for it to not work

No, I can’t verify that your connections are correct from a picture.

And I have selected PixhawkAUX5 as RPM_PIN
Works just fine on Cube Black

If its too much I can fall back to Cube from Pixhawk 4, cuz I have made all changes and dont see results on Pixhawk4

So you are on a custom firmware as well?

No just parameter changes, firmware is this
My bad, check for the updated link