Reading pulse data from delta servo drive

I'm using ASDA A2 delta servo drive and arduino controller. I'm getting encoder output from servo drive which is in the form of pulse. Initially I checked with oscilloscope and it displayed proper pulse waveform consistently with 0.2 ms interval. But when I tried connecting the pulse output pins to digital pin of arduino, the pulse value is not consistent as it is displaying random values ( 0,1,0,1,1,0,1,1,0,0,1,0,1,0) unlike oscilloscope. Please help me out to resolve this issue.

Your oscilloscope checks the value continuously! Bet your program does not do that!!!

Paul

PS: You probably set your scope to a certain horizontal sweep speed and have not done the equivalent to your Arduino code. Also you probably synced your scope trace to a rising or falling signal and have not done that with your code. You would use an interrupt to sync your coed the same way.

Sujai_123:
when I tried connecting the pulse output pins to digital pin of arduino, the pulse value is not consistent as it is displaying random values ( 0,1,0,1,1,0,1,1,0,0,1,0,1,0)

i recently completed a project using an inexpensive encoder to control motor position.

i triggered an interrupt on the rising edge of one quadrature encoder output and determined the direction from the state of the other output. But saw inconsistent results, the ISR would sometimes read the output that triggered on the rising edge as zero.

untangling the encoder and motor wires made some improvement, as well as using ~20" twisted pairs for each encoder signal. I noticed that the invalid events occurred much sooner than expected and tried a quick fix of simply ignoring events that occurred in < 1/2 the previous valid period between interrupts (i was also tracking speed).

that sufficiently reduced the size of the problem allowing me to complete looking at PD control of the motor.

but in retrospect, I think running the encoder signals thru a schmitt trigger might be rquired. while a 7414 could be used, it only switches between 0.8 and ~1.6V while an NE555 switch between 1/3 and 2/3 Vcc.