Why is my encoder causing my pendulum angle to drift?

  • Thread starter Thread starter jgeating
  • Start date Start date
AI Thread Summary
The discussion focuses on an issue with a rotary encoder causing angle drift in a pneumatic inverted pendulum system. Despite using an Arduino to read the encoder's quadrature output, the pendulum's angle drifts several degrees after a few seconds of operation, even when manually shaken. The encoder model used is the S1-1250 by US Digital, and the user has tested different Arduino models and encoders without resolving the issue. Recommendations include using an external counter to monitor interrupts and simplifying the program further, but the drift persists regardless of these adjustments. The problem may stem from missing interrupts or asymmetric processing times, as the drift tends to occur in a consistent direction.
jgeating
Messages
35
Reaction score
0
So I am reading a rotary encoder through an an arduino using interrupt pins for the quadrature output. I'm not an expert, but the system seems to work fine, i.e. gives correct output readings. It is for a pneumatic inverted pendulum, which can jitter, and change the cart velocity very suddenly. I have noticed that after running for several seconds, the angle drifts. When I realign the pendulum with gravity, the angle has drifted several degrees. Even shaking it with my hand (pneumatics turned off) causes the angle to drift.

Encoder is a S1-1250 by US Digital. 1250 counts per revolution, with standard, ground, power, ChA, and ChB outputs. (Unused index channel). Have tried an arduino mega as well as duemilanove, and two separate encoders (same model number). Someone recommended getting an "encoder counter" because the pulses are probably too high for the arduino.

However, a previous student did the exact same project without problems. The only differences are that my rail friction is much lower (3X lower), and my pendulum is a carbon fiber rod with a weight on the end, while his was just an aluminum shaft.
See http://dasl.mem.drexel.edu/~jiyueHe/pneumatic_inverted_pendulum/ for the tutorial I'm following

Thanks,
-Josh
 
Last edited by a moderator:
Engineering news on Phys.org
I would place a small bet on missing interrupts. If the drift is always in the same direction you might have asymmetric processing times on one input.

You could try an external counter to compare the number of interrupts you get, or simplify your program somehow to keep an accurate count.
 
Drift is in both directions, but usually CW. The program is simplified to the point where only the encoder related code is present. I also directly downloaded a simple encoder program from the arduino website and the problem still remains. I also eliminated serial output and used an LED to indicate where the supposed 0 point is. It always still drifts when I shake it about.
 
Hi all I have some confusion about piezoelectrical sensors combination. If i have three acoustic piezoelectrical sensors (with same receive sensitivity in dB ref V/1uPa) placed at specific distance, these sensors receive acoustic signal from a sound source placed at far field distance (Plane Wave) and from broadside. I receive output of these sensors through individual preamplifiers, add them through hardware like summer circuit adder or in software after digitization and in this way got an...
While I was rolling out a shielded cable, a though came to my mind - what happens to the current flow in the cable if there came a short between the wire and the shield in both ends of the cable? For simplicity, lets assume a 1-wire copper wire wrapped in an aluminum shield. The wire and the shield has the same cross section area. There are insulating material between them, and in both ends there is a short between them. My first thought, the total resistance of the cable would be reduced...
I am not an electrical engineering student, but a lowly apprentice electrician. I learn both on the job and also take classes for my apprenticeship. I recently wired my first transformer and I understand that the neutral and ground are bonded together in the transformer or in the service. What I don't understand is, if the neutral is a current carrying conductor, which is then bonded to the ground conductor, why does current only flow back to its source and not on the ground path...
Back
Top