> I would assume the motor(s) in question are being
> microstepped?

Yup, quarter-stepping. It's a modified Sherline controller 
with custom firmware that I described in my Circuit Cellar 
magazine column a few years back.

Given my ferror blunder, I decided to figure things out from 
first principles. The complete INI and HAL files are at:
http://pastebin.ca/266891
http://pastebin.ca/266894

Here's my reasoning; but check to see if these values make 
any sense...

The controller can run a bit over 8000 quarter-step/sec = 
2000 full step/sec = 10 rev/sec = 0.5 in/sec = 30 in/min. 
That's aggressive for a Sherline, although I long ago 
captured the end of that Y axis leadscrew in a bushing 
block to keep it from whipping around.

The max step rate means a 125 us period. I set base_period = 
25000, giving 5 ticks per step. The controller firmware 
triggers motor steps on the falling edge of the Step 
signal, so the timing parameters in the HAL file are:

steplen = 2
stepspace = 3
dirsetup = 1
dirhold = 3

I applied a 'scope to the pins of the PIC microcontroller 
and found the RC filters knock the rise and fall times to 
about 20 us. That means a 50-us Step pulse rises to full 
amplitude with no problem.

Back in the INI file, the settings are:

default_velocity = 0.0167       (slow enough)
max_velocity = 0.50     (30 in/sec, at best)
default_acceleration = 2        (limited by axes)
max_acceleration = 4    (ditto)

All three linear axes are identical:

max_velocity = 0.50     (optimistically)
max_acceleration = 0.5  (see below)
stepgen_maxvel = 0.60   (about 10% up)
stepgen_maxaccel = 0.6  (ditto)

ferror = 0.015          (seems OK)
min_ferror = 0.002      (ditto)

In the middle of long jogs the thing actually ticks along at 
about 320 us/step = 3000 step/sec. So it seems EMC2 limits 
the velocity to 11 in/sec. I don't know why that should be 
true, as lots of you folks are running -way- faster than 
that.

The max_acceleration value is experimental. Below 0.4 the 
motors wind up veeery slooowly, above 0.5 it produces 
following errors. That seems to be an unduly small range, 
but the raw step pulse parameters shouldn't be the limiting 
factor.

I based the ferror values on the "under half a turn" 
principle, then cranked it down until I got following 
errors.

I think these settings are sub-optimal, as G1 moves at 20 
in/sec (actually much less) around a 0.5-in square produces 
really nice fillets on the corners: perhaps 1/8" radius. 
Obviously, slowing down reduces the fillets, so it's an 
acceleration thing. The motors are audibly winding down for 
the corners, so I -think- they should be able to withstand 
far higher acceleration, but higher max_acceleration goes 
into following-error territory.

Perhaps this is caused by the internal PID loop tuning for 
the steppers? Or maybe it's just another round from my 
footgun?

Anyhow, these settings have completely (uh, so far) 
eliminated the "half turn the wrong way" and "completely 
wrong direction" behavior, but I can still hear the motors 
taking an occasional hit from the bogus Direction signals 
at the start of some motions.

I connected a counter to the Step signal and found that it 
always squirts out the correct number of Step pulses for 
either move, so the Direction signal really is backwards 
for a bit.

When a motor takes a hit, it moves a few mils short of the 
command, anywhere from a fraction to maybe 0.007 in). With 
quarter-stepping, 0.001 in = 16 steps, so the motors really 
do get confused by those Direction glitches.

These events are fairly rare and I did not have time to 
capture screen shots that provide more information that we 
already know.

It's entirely possible the hypersensitivity could be due to 
an error in my controller firmware, but this seems to be 
new behavior with EMC2 and may be explained by the (known) 
Direction glitch and (supposed) motor mechanics.

I'm off on an unexpected journey, but should be back by this 
weekend. I'll try scoping the PIC microcontroller's I/O to 
nail down exactly what's going on when the motor takes 
those hits.

-- 
Ed

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to