I'm working on a project that includes counting the revolutions of a cylinder connected to an engine. This engine runs at a minimum of 5 revolution per second and a maximum of 9 revolution per second.

A device is fixed and mounted on this cylinder. The device integrates a lis2dh12 accelerometer which is mounted so that the z axis intersects the rotational axis. This video will give you a clearer idea of the situation (the device is the one in red):

Video here

For the calculation of the revolutions, my algorithm takes the data of the accelerometer (set to 100hz) of the weight force and calculates the angle of inclination (pitch) as follows: atan2(y,z)

Then, I convert it to degrees and use 4 flags to understand when the device goes from 0-90, then 90-180, then 180-270 and finally 270-360, so the revolution counter is increased.

This worked for the rotations done with the device in hand, but then I bought a motor to perform the tests and the approach no longer worked: not having taken into account the centrifugal force (which exceeds that weight) the calculation of the pitch no longer works.

This is the engine used for the tests:

Motor picture with dimensions

The engine is blocked by a wooden system that attenuates vibrations as much as possible. With a potentiometer, I adjust the speed of rotation of the motor between 3 rpm and up.

NOTE: In this case the mass of the device is very significant because it is large compared to the complete system, while in the final case (situation of the video) the device has a very small mass compared to the complete system. I do not know if mounting the device on the real roller the calculation of the pitch would be done correctly and at the moment I can not perform the test, but hypothetically I believe that the problem will occur in that case, as the centrifugal force is proportional to the radius (in rotary motion).

Centrifugal force

Am I saying right?

My question then: is it possible to compensate the centrifugal forces, calculating their intensity for each sample of the accelerometer (every 10 ms) and subtracting this force to z, in order to reuse the old approach of pitch calculation?

The data acquired by the accelerometer while the small engine was running at (about) 5 revolutions per second shows that the value of z had assumed a maximum of -0.828 g and a minimum of -2.484 g.

Increasing the speed, however, also exceeds -5 g.

Unfortunately, the device is not equipped with a gyroscope and no hardware can be added to it, so I would like to find a way to calculate the number of revolution made using only data from the accelerometer.

Thanks in advance

  • 1
    \$\begingroup\$ Form the frame of reference of the sensor, the centripetal acceleration will be constant (at a given speed) and in a constant direction - towards the center of the drum, so should be easy to subtract that. The problem you likely have is not the mass of the sensor, but its distance from the axis - the 'r' term. Can you not mount it nearer the driving shaft? \$\endgroup\$
    – Phil G
    Commented Dec 13, 2018 at 22:50
  • \$\begingroup\$ Hi, @PhilG Thanks for asking. Considers that the device mounted on the engine for testing is attached exactly to the driving shaft. I'm attaching the photo for more clarity. As for the real case, no. The device can be mounted (almost) where I want on the surface, but there is no way to decrease the distance from the driving shaft. i.ibb.co/vs3N8G5/photo-2018-12-14-01-04-05.jpg \$\endgroup\$
    – minimanimo
    Commented Dec 14, 2018 at 0:02
  • \$\begingroup\$ is there a reason why you can't use magnets and hall sensors? you could attach magnets along the outside surface of the cylinder and position hall sensor(s) to pick them up. 4 magnets and 1-2 hall sensors would give you the same resolution as your original setup. It'd be simpler and more reliable \$\endgroup\$
    – Ocanath
    Commented Nov 5, 2020 at 16:44

1 Answer 1


This will not answer your original question, but it might solve your problem.

I have two suggestions, assuming you're not interested in the shaft's angle at all.

A: I guess that, even tough the centrifugal force is higher than weight force, as long as the sensor is mounted somewhat near the center, the ratio between the two would not be very high. If this is the case, you'll have, for a constant speed, a constant force (centrifugal) and a variable force (weight). If their ratio is not very high, you might be able to associate the sensor readings over time as a sinusoidal signal. If you measure this sinusoidal frequency, I think you'll be measuring the shaft's speed.

Be aware that, as speed increases, the ratio between the forces and the sinusoidal signal's amplitude and offset will vary, to an extent where you might not be able to measure the peaks due to low amplitude and high offset (basically a flat line).

B: If you mount the sensor far enough of the center, you'll clear the weight force out of the signal. If you manage to implement a low-pass filter, you can compare the mean force with a calibration curve.

Again, as the speed goes down, the weight force might become significative. This approach requires calibration every time the sensor is moved around the radius.

You might try to combine both approaches with a smart algorithm switching between the two.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.