Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High current - stall torque ripples #21

Open
dzid26 opened this issue Nov 10, 2023 · 7 comments
Open

High current - stall torque ripples #21

dzid26 opened this issue Nov 10, 2023 · 7 comments
Assignees
Labels
In progress Work in progress

Comments

@dzid26
Copy link
Owner

dzid26 commented Nov 10, 2023

When a high current is commanded (e.g. 3Amp), the torque is choppy. The effect is especially noticeable when coupled with a gearbox - due to springiness/stiction in the gearbox - causing vibration and snapping when backdriving. #15 (comment)

Precisely, there are 4 torque peaks/troughs per electrical rotation. Some are stronger than others.

@dzid26 dzid26 changed the title High current - torque nonlinearity High current - torque ripple Nov 10, 2023
@dzid26 dzid26 changed the title High current - torque ripple High current torque ripple Nov 10, 2023
@dzid26
Copy link
Owner Author

dzid26 commented Nov 10, 2023

  • To investigate the following:
    Does high phase current magnetically influence encoder angle enough to cause noticeable commutation angle shift
image

Calibration was performed with CALIBRATION_TABLE_SIZE 200U to have a point per full step. The variation is less than +/-0.1deg at 3.3A command. Default - double pass.

And single pass, to avoid potential influence of data averaging:
image

@OxygenLiu
Copy link

Is it simple feedback closeloop control? Did you check the step response of sPID controller? Probably there is much overshooting and/or ringing.

@dzid26
Copy link
Owner Author

dzid26 commented Nov 12, 2023

Close loop would refer here to simply using position feedback to precisely set commutation currents based on read position (corrected with calibration table). No PID is involved in torque mode. Basically, we read the angle and apply current based on where we are in between the motor teeth.

Above (the calibration) is done in "open-loop". Full steps are applied - position is read back and stored. This procedure generally should be done without significant load, so we always know what the angle is for given full step (1.8deg * n step). We compare that to position from the sensor and store it in a table. If steps are commanded with high current, the bumps appear in the table. While they don't matter for normal operation (since they are so small), they are an indication that something is happening to angle reading under high current.

I want investigate if that is significant for the issue.

@dzid26 dzid26 self-assigned this Nov 16, 2023
@dzid26 dzid26 added the In progress Work in progress label Nov 16, 2023
@dzid26 dzid26 changed the title High current torque ripple High current - stall torque ripples Nov 17, 2023
@OxygenLiu
Copy link

Calibration was performed with CALIBRATION_TABLE_SIZE 200U to have a point per full step. The variation is less than +/-0.1deg at 3.3A command. Default - double pass.

What is the meaning of variation +/-0.1deg at 3.3A? Is it the difference of calibration table between low and high currents?

Can we use FEMM model to evaluate the influence on encoder readings by phase currents? And place the magnet a bit further away from coils with a plastic gasket.

@dzid26
Copy link
Owner Author

dzid26 commented Nov 18, 2023

+/-0.1deg refers to those little jumps
image
3.3Amps is the default calibration current. It is high by default to overcome (light) loads on the motor (external gears, etc).

I quickly ran the test:

  • 4mm spacer,
  • 3 magnets stacked on top of each other (not ideal as I think they align north/south and the magnetic field is not stronger than a single one),
  • 1mm gap between top magnet and PCB.

The torque is still notchy at high current and the periodic noise in the calibration is still present:
image

One more test:

  • 3.5mm spacer
  • 0.5mm gap between top magnet and PCB.
image Looks and feels the same.

So spacing and magnet strength doesn't seem to matter.

I went back to no spacers. I run it with 1Amp calibration:
image

It's even more pronounced.

The variation doesn't seem proportional to current after all.

I run the same thing but slower to avoid resonances:
image
It is better.

I run it slow again, but with 200mA:
image
Again quite pronounced.

Increased oversampling to 30:
image

Oversampling at 300:
image

Oversampling at 0:
image
But the torque ripple feels same.

I am having Déjà vu.
Ok, I remember. Oversampling is adding some delay. Without it, the calibration progresses too fast and some resonance shows up.

Again, 0 oversampling, but with 100ms stabilization delay:
image
It's back to where we were.

I am starting to remember that I was trying to figure out this variation in the past...
I think it might be just the nonlinearity of the TLE5012b sensor.

I think this variation is too small to explain the choppiness. It's only ~5 electrical deg. Besides, the fact that it shows up in calibration means it would be compensated already.

With the scope measurement of phases current, I can precisely see when the snap occurs in each quadrant. However, the drop is very nonlinear. I am afraid it might be some weird stepper teeth magnetic interaction. I will still investigate.

@OxygenLiu
Copy link

Excellent investigation! Some observations and questions,

  • The +/- 0.1 deg variation does beyond average stepper accuracy +/- 0.027 deg (+/- 1.5% of 1.8deg). Is it meaning a poor build quality of the stepper motor you are testing? Once the accumulated error when backdriving is larger than half step (0.9 deg), the commanded current may flip the direction, and then the torque snaps.

  • The calibration variation seems quite senstive to the stablization delay (100ms). Is it because of the coil inductance? The stepper I have is specified as 3 ohm and 5.1mH, thus the time constant is t = 5.1mH/3ohm = 1.7ms. It may take 4*t = 6.8ms to reach the target current, and another 6.8ms in slow delay mode to zero. The stablization delay of 100ms is certainly sufficient even including resonance.

It seems quite challenging to control the current indirectly through Vref to achieve stable torque output under overloading conditions. Hopefully the voltage control can provide better performance.

@dzid26
Copy link
Owner Author

dzid26 commented Nov 19, 2023

  • It could be that the teeth on the rotor drum are shifted a bit - this may be the source of that 0.1deg periodic variation. It is so small though. 0.1 translates to only 5deg electrical - it would reduce torque only slightly, so I don't think it has anything to do with the ripple. Besides, if software calibration accounts for it (in case of 200 samples calibration), the problem should be minimized. But whether I calibrate with 25 values (which only contains correction "wave" due the sensor magnet misalignment) or 400 (which additionally contains the periodic "noise" information) the motor behaves the same. I tested a few different steppers, and they have this snapping behavior, so I don't think it is the source of the problem.
  • With enough stabilization delay the tested the variation looks like this
image and if we go faster (no oversampling which slows down the routine and no explicit delay) then it looks like this image

But 100ms makes calibration slow.
Based on testing last year, default oversampling was providing good quick calibration with my motors.
I measured how much compute time oversampling takes:

  • 3 samples: 54us
  • 50 samples: 650us
  • 100 samples: 1285us

By going this fast, the calibration is basically slow continuous rotation. I think I chose that to avoid mechanical resonances due to stopping and going. There were diminishing returns going slower. And since there are two passes, even if something is lagging it averages itself out.

In any case,

I don't think it's worth pursuing optimizing calibration timing. (Unless some motors have resonance issues).

Whether it looks like this (200 points, 100ms stabilization delay):
image

, or like this (50 samples, 100ms stabilization delay):
image
Filters out all periodic variation.

, or default 50 samples and 0ms stabilization delay (single pass):
image

, or default 50 samples and 0ms stabilization delay (default double pass):
image

...it all is indistinguishable during operation. And all of them experience the high torque choppiness.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
In progress Work in progress
Projects
None yet
Development

No branches or pull requests

2 participants