Thanks for the updated smoothing formula, the results look good.

Using scipy.optimize, I have been able to calculate the shaper coefficient for SNA (specified negative amplitude) shapers. This way, it should be possible to experiment with different trade-off between shaper duration and high-mode excitation. I’m also not sure if larger negative impulse can interact with the stepper in a bad way.

So far, I have been having good results near the limit of the ZV shaper. I think it only works for relatively rigid motion system with consistent resonance across time and space. Also, it looks like for anything faster than MZV, damping factor estimation is no longer optional.

If anyone is interested, here’s the code. No support will be provided, and I don’t expect this in mainline. Also, I have only run simulations, not physically tested.

```
def get_sna_shaper(na, shaper_freq, damping_ratio):
df = math.sqrt(1. - damping_ratio**2)
omega_n = 2 * math.pi * shaper_freq
omega_d = omega_n * df
zon = damping_ratio * omega_n # zeta omega n
t_d = 1. / (shaper_freq * df)
a = (1 + na) / 2
A = [a, -na, a]
fun = lambda x: x[2] # optimize for shortest duration
guess = [0, 0.2*t_d, 0.4*t_d]
bnds = ((0,0), (0, t_d), (0, t_d))
# sin of first impulse is always zero, cos of first impulse = a
cons = ({'type': 'eq', 'fun': lambda x: - na * math.exp(zon * x[1]) * math.sin(x[1] * omega_d) + a * math.exp(zon * x[2]) * math.sin(x[2] * omega_d)},
{'type': 'eq', 'fun': lambda x: a - na * math.exp(zon * x[1]) * math.cos(x[1] * omega_d) + a * math.exp(zon * x[2]) * math.cos(x[2] * omega_d)})
res = scipy.optimize.minimize(fun, guess, method='SLSQP', bounds=bnds, constraints=cons)
#print(res)
(t0, t1, t2) = res['x']
T = [t0, t1, t2]
return (A, T)
def get_sna05_shaper(shaper_freq, damping_ratio):
return get_sna_shaper(0.5, shaper_freq, damping_ratio)
def get_umzv_shaper(shaper_freq, damping_ratio):
return get_sna_shaper(1.0, shaper_freq, damping_ratio)
```

References:

https://www.researchgate.net/publication/2584317_Design_And_Implementation_Of_Time-Optimal_Negative_Input_Shapers

http://singhose.marc.gatech.edu/courses/2998/labs/NegativeSNA.pdf