AP3.5: RPM not returning anything

As per plane.ardupilot.com/wiki/ardupla … parameters , I set:
RPM_MAX 20000
RPM_MIN 1
RPM_MIN_QUAL 0.5
RPM_SCALING 2
RPM_TYPE 1
RPM2_SCALING 1
RPM2_TYPE 0

I tried chagning RPM_MIN_QUAL to 0.1 or 0, but it didn’t help.
rpm1 shows up a 0, and rpm 2 as -1
I have a castle ESC that returns RPM on a wire, I can see the wire gives 3.3V when the motor is not turning, and 1.65V when the motor is turning.
While my ESC supports a lot of data via live link described here castlecreations.com/support/ … ve_2.0.pdf
I’m using the dumb RPM pulses over one wire RPM OUT as per page 3 castlecreations.com/support/ … _guide.pdf

I have the AUX white wire port connected to the signal wire of AUX5 on my pixhawk, but get nothing.

I’m attaching a scope trace of my castle AUX wire showing 3V differential and the timing offset between the lowest and highest RPM my motor can get
Looks like highest RPM is giving 1000 pulses per second while lowest RPM is giving 160 pulses per second

Hi Marc,
Do you have any of the RELAY_PIN parameters set as well? On a Pixhawk RELAY_PIN defaults to 54, which is the same pin as the RPM input pin. That stops the RPM from working.
Set RELAY_PIN to -1 and reboot to test.
If it still isn’t working then please try directly connecting a normal RC output channel (eg. aileron) to the RPM input pin (aux5) and see that you read 3000 RPM (which is 50Hz).
Cheers, Tridge

Thanks Tridge, I’ll have a look with whatever’s left of my plane (the electronics). It looks like GUIDED finally managed to crash my plane quicker than I was able to disable it :frowning:
viewtopic.php?f=115&t=15302

Ok, tried on the bench, indeed I had relay_pin and relay_pin2 set and I had no idea that they were breaking anything I plugged into AUX5 and AUX6.
Now I’m getting rpm1 with a value of 6000 no matter what’s plugged into AUX5 (including nothing)

Hi @tridge. I gave it another shot with AP 3.5.2
Now I get 0 and 0 for rpm1 and rpm2 in mission planner, even after you plug in a servo lead into AUX4 and AUX5.
Before I was getting 6000, weird.

I checked that RELAY_PIN values are set to -1.
Not sure what else to check.

when doing the loopback test, ensure that:

  1. safety is off
  2. that you loopback from a channel that is definately producing output (eg. an aileron channel)
    If you still don’t get any RPM with the loopback test then post your full parameter file and I’ll load it on a pixhawk here and run the same test. Let me know which channel you are doing loopback from

Hi @tridge, so first, to confirm, I’m not even seeing rpm1 and rpm2 in the list of variables shown in apmplanner 2.0.19-rc4. I do see them in mission planner (which I have to run in virtualbox).
I init pixhawk, move a servo plugged into AUX1, disconnect the servo, plug a cable from AUX1 to AUX5.
At some point, not sure when, rpm1 went back from 0 to 6000 and stayed at 6000 after I unplugged the cable from AUX5, but while the servo output was plugged in, changing the servo output value changed nothing.

params: http://marc.merlins.org/tmp/bfg9_3.5.2.param.txt

you shouldn’t actually expect changing the servo output value to change the RPM. The servo output value is the width of the pulse. The value the RPM code reads is the period (how often pulses happen).
With normal APM:Plane code you should expect a pulse every 20ms (ie. 50Hz pulses). That is 3000RPM. If you had a scaling value in the RPM settings of 2 then you would get 6000 as the RPM reading.
I see in your parameters that you do indeed have RPM_SCALING=2, so 6000 is the expected value when you use a loopback cable.

Thanks for correcting my false assumption.
Still, something is not right. I plugged in a servo cable again, plane is armed, motor is running, and rpm1 is 0
Dang, this is worrisome, RELAY_PIN and PIN2 self reset to 54 and 55. I put them back to -1.
Ok, now I’m seeing 6000 again, unplugged the servo, stilll getting 6000 with nothing plugged in (is that normal?)
then I plugged my RPM wire from the ESC, and still get 6000.
I power cycle pixhawk, have it reboot, still get 6000 (with ESC RPM wire plugged in)
I unplugged the ESC RPM wire, power cycle pixhawk, stilll get 6000
Plugged the ESC wire back in (white/signal wire pointing down on the pixhawk, like the other servo wires), used a Y cable, measured voltage on signal wire and saw it go from 0.2V to 2.xV when revving motor.
During all this time, rpm1 is still 6000

Has anyone else gotten this working?
Is it even normal for rpm1 to still show me 6000 rpm when nothing is plugged into AUX4? (does it keep the last known value?)
Also, is rpm1 showing up in anything other than Mission Planner? (I don’t see it in apmplanner)

Perhaps a bit late but I got this working in ArduCopter 3.3.3 TradHeli. I have a Castle ICE2 so no direct reading from the ESC. I use a Microbeast brushless RPM sensor. Both ESC and Pixhawk logging give the same RPM value.

I noticed that when the motor is OFF, RPM value stays at the late read value. Value changes as soon as the motor is running or if it has beeped (Castle ESC make to motor beep every 30 seconds or so).

By the way, I don’t see RPM_MIN and RPM_MIN_QUAL params on my param list.

Hope this helps…

Maybe the RPM code is not the same for copter and plane. That said, tridge uses the plane code and RPM works for him, so have no idea why it won’t work for me :-/

Hi all ,

Dose it mean we can now read the RPM in mission planner ??!!

Yes, there are 2 values now, rpm1 and rpm2. I think rpm2 isn’t connected to anything yet, and rpm1 is supposed to work, but does not work for me.

@marcmerlin ,

I think they need to add topic to describe the steps to get it work . .

I really need to read the RPM

RPM 1 defaults to the AUX 5? Is that what I am understanding? So if I want to relay something I need to disable AUX 5 and put my relay on AUX 6? I am monitoring RPM for a gas motor. Any help would be great!

I believe the default is AUX5. I got this working thanks to Tridge’s explanation, with a servo output on AUX5 (as described above I had to disable the RELAY_PIN by setting it to -1) I get a reading of 3000 for rpm1 in mission planner.

I have a twin and am using a pixhawk, does anyone know if it’s possible to setup a second RPM reading?

I have the same issue, rpm1 returning 0, even if all relays are set to -1 , brd pwm count to 4, rpm input on aux5 …
APM 2.7.1 mission planner 1.3.40

Got it working on Plane 3.7.1
http://discuss.ardupilot.org/t/how-to-read-rpm-signal-from-esc/8326/21?u=georacer