Issue with linear SinCos encoder: sudden jumps of integer multiples of the line pitch

I have a question regarding IONI regarding a SinCos encoder. I have no experience using SinCos encoders so it is possible that I am making some stupid mistake.

My hardware configuration:

  • IONI with IONICUBE.

  • A linear motor with a linear SinCos encoder.

  • Drive firmware version 1.7.21.

  • 48V high voltage power supply.

Problems arise when:

I have successfully got the motor to move in the “Digital hall sensors” feedback device mode, but I experience problems whenever I try to use the SinCos encoder. The problems I describe below arise in torque control mode with setpoint 0.

How it behaves:

The first way that I noticed the problem is that the “position feedback” field under the Granity Testing tab tends to drift towards negative values. It almost doesn’t happen when the drive is software disabled (Esc in Granity). The motor has about 120 mm of motion range: If I enable the drive in torque mode with setpoint 0 and manually move the motor over to one side and then back again, the reported end position is very roughly 120 mm (it varies with each try) smaller than before, even though the real position of the motor is back to where it was originally. For obvious reasons, this prevents the system from working.

Because the drift problem is almost entirely gone if the drive is disabled, I figured that it might be an EMI issue (there is some motor hiss). However, I do not think this is the case, because what I see in the Granity scope is that the “position achieved” and “velocity achieved” plots display effectively no noise (never > 1 least significant bit), except that the position sometimes jumps by exactly one encoder line (20 μm). The jumps happen more when the drive is enabled, and when the drive is enabled, there are more jumps in the negative than in the positive direction. The jumps happen when the motor is moved (but happens also with tiny movements), usually not when it stands still (but sometimes it ends up in a state where it keeps drifting constantly when standing still).

  • graphs_3.png shows a couple of these jumps, and shows that the jump size is 20 μm with otherwise no encoder noise (other than quantization noise). For this capture I moved the motor slowly in one direction. I believe the drive was disabled for this one, and it characteristically for the drive being disabled jumps back to the right position here.

  • graphs_5.png shows a lower sample rate capture when I moved the motor back and forth by a couple of cm or so, with the drive enabled (torque setpoint 0). You can see the sinusoidal motion, with the erroneous jumps showing up in the velocity graph as random fixed magnitude peaks, and in the position graph as a negative drift.

I cannot think of a way that the SinCos encoder line could be connected incorrectly, or how they could be noisy or otherwise wrong in a way that could cause this particular result in the Granity scope. An instant jump of an integer multiple of the encoder line length should show up electronically on the SinCos data lines as nothing at all, no?

Could this be an issue with the encoder’s index line? The problem occurs along the entire length of the motor’s range of motion though.

How I would expect it to behave:

I expect the behavior to be the same as it is now but without seemingly random sudden 20 μm jumps.

I have attached following files:

  • Granity scope screenshots, see description above.

  • Granity .drc configuration file.

Thankful for any help,

Perlinear_sincos.drc (8.8 KB)

Ok so I tried a few more things: I swapped cables, IONI drive and tried the other axis, all with no change.

Then I measured the sin/cos signal with a real oscilloscope rather than the Granite scope. I see some quite large noise spikes (~2x greater than the actual signal) that correlate perfectly with the high voltage motor PWM signals, and from what I can tell they are mostly not common mode noise. So I guess that’s the source of the problem. From what I can tell, the cables are correctly shielded, but I can certainly experiment with adding more ferrite cores. Can I expect ferrite cores to be able to be sufficiently effective? The noise spectrum is in the 0-10 MHz range as far as I can tell.

[Update: Adding more ferrite cores to the motor UVW leads reduces the noise in the ferrite cores’ specified frequency spectrum, but even with low-frequency cores there’s enough noise in the 250-300 kHz range to break the readout.]

The EMI I see on the oscilloscope is only there when the drive is enabled, so I’m still confused about the position jumps when the drive is disabled, but I guess they might not be a problem if they cancel out.

That thing I said at the beginning about a stupid mistake? Yep. I found an error in the wiring that caused the motor to be effectively ungrounded. The cables were properly grounded, which explains why moving around the cables didn’t change anything. Fixing this removed the EMI on the encoder lines so much that I don’t even see it on the scope anymore, and the position drift is gone.

So… Hopefully this thread can help someone in the future: This is what EMI on SinCos encoder lines look like in Granity.

Glad to hear about the solution before we even reacted! I see true engineer spirit in you @per-gron :slight_smile:

BR Tero