VMC related HAL questions.
It doesn't matter. Much like it does matter where the physical connection in an electrical circuit are made as long as they join to the correct net.But in my file "pid.0.feedback is first, but that might not matter?
There is no sense of a "sequence" to a HAL file. Don't try to read it like a computer program. The fie is read once when the configuration starts and once the signal connections are made the components run independently processing inputs and updating outputs.[1]
A signal can be connected to one or more pins. You can reference that signal by name anywhere in any HAL file.
The signal can only be connected to one "output" pin, that is, a pin that supplies a value. In your spindle-vel net the output pin is hm2_5i25.0.encoder.03.velocity and all the other pins connected to the net see that value.
Also,
M3 S500 = 5V
M3 S1000 = 10V
But in my previous config that was pretty much spot on, S500 = 1V, S5000 = 10V.
If the PID gains are trying hard to ramp up what they "think" is a stopped spindle then that might be the explanation.
[1] This isn't strictly correct, the components actually run one at a time in the order they were added to their thread.
Please Log in or Create an account to join the conversation.
You might as well change "net spindle-revs => motion.spindle-revs" to net spindle-pos => motion.spindle-revs"
Other than that, it looks like it ought to work and I am perplexed if it isn't doing.
In Halmeter (or Halshow (Machine->show hal config)) can you see the PID error reducing, or does it increase?
If you look at the pins of pid.0 you should see the command signal being your S-command, and the feedback signal should be very close to that.
With P = 0, I = 0, in fact everything zero except FF0 = 1 you should have exactly the same behaviour as before. Then a bit of I should make it more linear, and a bit of P should make it correct itself more quickly.
Please Log in or Create an account to join the conversation.
net spindle-pos pid.1.feedback orient.0.position
Should I also change this line to "spindle-pos"?
net spindle-revs <= hm2_5i25.0.encoder.03.position
Gonna check halmeter and come back with a screenshot.
Please Log in or Create an account to join the conversation.
Actually I would expect that to trigger an error when loading the config.I saw that I had two of these lines for some reason. That should not make any difference in my mind but I deleted one of them.
net spindle-pos pid.1.feedback orient.0.position
Yes, I missed that one.Should I also change this line to "spindle-pos"?
net spindle-revs <= hm2_5i25.0.encoder.03.position
Please Log in or Create an account to join the conversation.
"pid.0.error" stays close to commanded value
Seems to me that there is some timing issue as S-value and actual rpm differs with a factor of 6.
But then pid should correct that?
I've confirmed that encoder scale is correct, 4096pulses/rev
M19 still times out even at 20sec. Spindle turns at a slow crawling speed. And does not speed up or slow down.
Please Log in or Create an account to join the conversation.
Should not "orient.0.tolerance" be >0?
Please Log in or Create an account to join the conversation.
"pid.0.command" is the requested S-value
"pid.0.error" stays close to commanded value
pid.0.error should tend towards zero as the PID does it's thing.
What is the pid.feedback showing?
The problem might well be that command is rpm and feedback is revs per sec...
If that is the case then the answer it so use the motion.spindle-speed-out-rps pin as the command, and to alter the SCALE / MAXLIM / MINLIM for the analogout to also work in revs per second.
www.linuxcnc.org/docs/html/man/man9/motion.9.html
Possibly that is a combination of a x60 for rpm/rps and a x10 for 10V - 100%Seems to me that there is some timing issue as S-value and actual rpm differs with a factor of 6.
Does it manage more than one turn in the time available?M19 still times out even at 20sec. Spindle turns at a slow crawling speed. And does not speed up or slow down.
Please Log in or Create an account to join the conversation.
Should not "orient.0.tolerance" be >0?
Oh, yes, definitely. :-0
Please Log in or Create an account to join the conversation.
So how do I specify orient tolerance?
setp orient.0.tolerance (number)
Added a screenshot of hal config. M3 s60 is active.
Please Log in or Create an account to join the conversation.
The speed command should come from the position PID.When M19 is active there is no speed command, it just enables the spindle so the rotation is just the drive drifting slowly.
Do you see any output from the PID (if not, have you tuned it?, are the gains being read in from the INI correctly?)
When you say there is no speed command, where are you looking?
Yes, just like that. In degrees.So how do I specify orient tolerance?
setp orient.0.tolerance (number)
Please Log in or Create an account to join the conversation.