VMC related HAL questions.

More
07 Jun 2015 17:35 #59561 by andypugh
Replied by andypugh on topic VMC related HAL questions.

But in my file "pid.0.feedback is first, but that might not matter?

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.

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.

More
07 Jun 2015 17:46 #59563 by andypugh
Replied by andypugh on topic VMC related HAL questions.
Looking at the HAL file, we still have a bit of confusion between spindle-pos and spindle-revs signals. (but that only matters for feed-per rev mode, so isn't the problem)
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.

More
07 Jun 2015 17:59 #59564 by thewho
Replied by thewho on topic VMC related HAL questions.
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

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.

More
07 Jun 2015 18:06 #59565 by andypugh
Replied by andypugh on topic VMC related HAL questions.

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

Actually I would expect that to trigger an error when loading the config.

Should I also change this line to "spindle-pos"?

net spindle-revs             <=  hm2_5i25.0.encoder.03.position

Yes, I missed that one.

Please Log in or Create an account to join the conversation.

More
07 Jun 2015 18:38 #59567 by thewho
Replied by thewho on topic VMC related HAL questions.
"pid.0.command" is the requested S-value
"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.

More
07 Jun 2015 19:07 #59568 by thewho
Replied by thewho on topic VMC related HAL questions.
If i run "M19 R0 Q60" with the spindle drive turned off and manually turns the spindle until "orient.0.poserr" is close to 0, "motion.spindle-is-oriented" does not light up.
Should not "orient.0.tolerance" be >0?

Please Log in or Create an account to join the conversation.

More
07 Jun 2015 20:34 #59576 by andypugh
Replied by andypugh on topic VMC related HAL questions.

"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

Seems to me that there is some timing issue as S-value and actual rpm differs with a factor of 6.

Possibly that is a combination of a x60 for rpm/rps and a x10 for 10V - 100%

M19 still times out even at 20sec. Spindle turns at a slow crawling speed. And does not speed up or slow down.

Does it manage more than one turn in the time available?

Please Log in or Create an account to join the conversation.

More
07 Jun 2015 20:34 #59577 by andypugh
Replied by andypugh on topic VMC related HAL questions.

Should not "orient.0.tolerance" be >0?


Oh, yes, definitely. :-0

Please Log in or Create an account to join the conversation.

More
08 Jun 2015 01:18 #59600 by thewho
Replied by thewho on topic VMC related HAL questions.
When M19 is active there is no speed command, it just enables the spindle so the rotation is just the drive drifting slowly.

So how do I specify orient tolerance?
setp orient.0.tolerance (number)

Added a screenshot of hal config. M3 s60 is active.
Attachments:

Please Log in or Create an account to join the conversation.

More
08 Jun 2015 01:21 #59601 by andypugh
Replied by andypugh on topic VMC related HAL questions.

When M19 is active there is no speed command, it just enables the spindle so the rotation is just the drive drifting slowly.

The speed command should come from the position PID.

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?

So how do I specify orient tolerance?

setp orient.0.tolerance (number)

Yes, just like that. In degrees.

Please Log in or Create an account to join the conversation.

Time to create page: 0.247 seconds
Powered by Kunena Forum