VMC related HAL questions.

More
11 years 4 months ago #59547 by andypugh
Replied by andypugh on topic VMC related HAL questions.

thewho wrote: Tried I = 0 & ff0 = 0 and then the pid value stays the same as do the rpm's
Don't know if you saw in the screenshots that the spindle turns about 6times the requested speed. S60 = 380rpm

EDIT: Also, "orient.0.angle" & orient.0.position" is always 0. I would thing one of them should be actual angle of the spindle?


While testing you might have to M5 to get motion.spindle-orient to go to zero so that the orient comp can calculate a new angle.

Spindle too fast seems to mean that your [SPINDLE]OUTPUT_SCALE is wrong. That should be the spindle speed at 10V command signal.

You said that spindle pos increases by 1 for forwards. Does it decrease backwards?

I have absolutely no idea what is going on any more. Do the PID command and feedback numbers make any sense?

The problem is probably these two lines
Code:
net spindle-vel pid.0.feedback # & encoder.3.velocity for a real machine ... net spindle-vel-fb <= hm2_5i25.0.encoder.03.velocity

You need to be consistent in the signal naming. If you want to use spindle-vel-fb then use it everywhere.

Also, the position pid has no feedback either, so that is why that isn't working:
Code:
#net spindle-pos pid.1.feedback orient.0.position near.0.in1 # & encoder.5.position for a real machine #net spindle-pos-cmd orient.0.command pid.1.command near.0.in2

You have commented out the command _and_ the feedback to the position PID. Just delete the "near" stuff, don't comment out the rest of the net, that is needed.
Elsewhere in the code you are using "spindle-revs" for the spindle position, so be consistent with that again here.

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

More
11 years 4 months ago #59548 by thewho
Replied by thewho on topic VMC related HAL questions.
I've done M5 several times while testing, no change.

Output scale is the same as before all closed loop testing, and then it was pretty close to requested.

Yes, it decreases if I turn it ccw.

I've not written any lines in that hal file myself, at best I copy/paste, edit or remove the lines you tell me to :)
So it should be "spindle-vel" and not "spindle-vel-fb" ?

I commented those lines because they contain "near.0" Didn't understand that I just should remove the near part of the line.

I will continue tomorrow as it's getting quite late here now :)

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

More
11 years 4 months ago #59549 by andypugh
Replied by andypugh on topic VMC related HAL questions.

thewho wrote: Output scale is the same as before all closed loop testing, and then it was pretty close to requested.

The PID components both believe that the system is at zero position and zero velocity, so there is no surprise that they are not working.

I've not written any lines in that hal file myself, at best I copy/paste, edit or remove the lines you tell me to

Well, yes, but you need to try to understand what you are pasting, especially when combining two different HAL files.

So it should be "spindle-vel" and not "spindle-vel-fb" ?

Whichever makes the most sense to you, it is your HAL file and you can call signals (the first thing after "net" anything you like. kara-nopeus-palaute would be fine too.

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

More
11 years 4 months ago #59559 by thewho
Replied by thewho on topic VMC related HAL questions.
I did my best to edit and understand the hal file but there is still no change from yesterday :(
I understand that "net" connects "signals" to each other. But is there no difference in what order they come in the file?
To me this seems the most logical way to do it.
Example:
Code:
net spindle-vel <= hm2_5i25.0.encoder.03.velocity net spindle-vel => motion.spindle-speed-in net spindle-vel pid.0.feedback
But in my file "pid.0.feedback is first, but that might not matter?

Also,
M3 S500 = 5V
M3 S1000 = 10V
But in my previous config that was pretty much spot on, S500 = 1V, S5000 = 10V.

I'll attach my hopeless little hal file and hope that the gurus of this forum has the time to check it out.

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

More
11 years 4 months ago #59561 by andypugh
Replied by andypugh on topic VMC related HAL questions.

thewho wrote: 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
11 years 4 months ago #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.

Time to create page: 0.374 seconds
Powered by Kunena Forum