On Thu, 8 Jul 2021, John Dammeyer wrote:
Date: Thu, 8 Jul 2021 18:16:15 -0700
From: John Dammeyer <[email protected]>
Reply-To: "Enhanced Machine Controller (EMC)"
<[email protected]>
To: "'Enhanced Machine Controller (EMC)'" <[email protected]>
Subject: Re: [Emc-users] Runaway PID spindle.
From: Peter C. Wallace [mailto:[email protected]]
From: John Dammeyer <[email protected]>
Maybe it's a MESA issue? It's set up as output type 1 which is 0-100% which
means either the Out2 should invert when pwmgen gets negative? Or the output
should clip to 0 when the calculation determines a negative output.
http://linuxcnc.org/docs/html/man/man9/hostmot2.9.html#pwmgen
PWM mode 1 is basically sign-manitude mode so if you connect
the PWM direction to the drives direction control,
and give signed command and feedback inputs to the PID
it should work properly.
I don't understand that Peter. The PIN file for my device doesn't have an
explicit PWM Direction controlled by the PWM module. And in either case the
potential for a random change in direction as it approaches 0 RPM is
unacceptable behavior for a spindle.
This is required behavior if you wish to control the velocity around 0
via PID
What should the pwmgen do when hm2_7i92.0.pwmgen.00.value is assigned a
negative value if it's configured with setp hm2_7i92.0.pwmgen.00.output-type 1
The PWM duty cycle should be the same for positive and negative numbers
(only the direction pin will change), This is what is meant by sign-magnitude
If there isn't anything in the PIN file that assigned a direction output to
the pwmgen shouldn't the PWM output pin then stay at 0? For the spindle it's
not safe to have the pwmgen decide to change the direction because the
response to slowing down isn't fast enough so the error term goes negative.
If you need a valid direction signal, you could use the absolute functions
sign bit as Andy suggested. This is like the only way to get a stable PID
because if you have 0 output for negative number you have a nonlinearity
the PID cannot really deal well with.
If you really want 0 output for negative PWM values, you could choise
PWM mode2 (up/down mode)
I'll just double check again to see if indeed a negative value is assigned
into 00.value.
It should not, that would be contrary to mode 1's definition
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users
Peter Wallace
Mesa Electronics
(\__/)
(='.'=) This is Bunny. Copy and paste bunny into your
(")_(") signature to help him gain world domination.
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users