Current turning capabilities status

More
21 Oct 2013 19:27 #40126 by emcPT
The compensation is very useful for corners or if the path is not straight in diameter (a sphere is where the compensation is best noticed).

I am not using any patch (only the one that you pointed out in .axisrc)

It is not necessary to call G43 as the axis displays the tool "in normal axis mode", only with the .axisrc to invert the X, the tool disappears. Without it, the tool is displayed correctly even without the call to G43.

Like you said, orientation 2 is for Z- and X-. But this only happens, as far as I know, in linuxcnc. All others controllers use differently. It would be then much better to use equal to all others.

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

More
21 Oct 2013 20:03 #40127 by andypugh

Like you said, orientation 2 is for Z- and X-. But this only happens, as far as I know, in linuxcnc. All others controllers use differently. It would be then much better to use equal to all others.


Looking at books.google.co.uk/books?id=JNnQ8r5merMC...0orientation&f=false I think you are right.

Unfortunately I think it is too late to change LinuxCNC now, doing so would break the existing configs.

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

More
22 Oct 2013 01:06 #40139 by cmorley
Well it's never too late to change linuxcnc.
It's just very inconvenient for people during the transition.
The upgrade between major numbers (eg 2.6) are not guaranteed to be compatible.
Obviously such a large change is not taken lightly though!

Chris M

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

More
22 Oct 2013 01:27 #40140 by emcPT
better late than never ...

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

More
22 Oct 2013 19:30 #40165 by andypugh

better late than never ...


It is only a tool-table change.

It is very unlikely that anyone would expect to import a tool table directly into LinuxCNC from another control. The data formats are different and I don't even know how you would physically do it in many cases.

I think it is regrettable that the naming conventions are different. However you are the first person to notice in the 7 years that tool orientation has been supported. I think that the cost of conversion is likely to be greater than the benefit.

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

More
22 Oct 2013 20:58 #40172 by emcPT
Sure, I will not import the tool table from another machine.
The issue is when adding a tool you must remember that the tool orientation is swapped. It is also not a big deal, although it could be better.

For example in my work we use only a few tools as the job that we make is specific. For all tools we have documentation where the tools have its description including the tool direction. In this case I need to add to the documentation "WARNING: for linuxcnc the tooltip is swapped!"
If there is a wish to linuxcnc to be industrial, not only hobby it should follow the industry "standards" and try to improve what can be improved.

Changing it should also be simple. But I can also understand that things can be keeped this way.

Maybe I will change the source code (for my internal use) on the part that reads the tool tip direction from the table and interpret it swapped.

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

More
26 Oct 2013 18:10 #40308 by emcPT
Currently we have almost all things figured out about the servos, and now the VFD arrived and we are testing the spindle.

I am quite happy with the working motor; high speed is obtained but deceleration is taking too long. I think it will be solved with a braking resistor.

My current issue is about the PID settings.

Background:
0-2500 rpm is the objective that I can achieve with 0 to 10VDC on the VFD. This is done.
I have encoder feedback that is also working and connected to the PID (I think). The output is made from a mesa, using the PWMGEN.
I tested a lot of settings on the PID values (only in P I and FF0) and until now I get a unstable operation or a stable operation that in the end does not do what I think it should. As I get the unstable operation, I believe that the PID is at least working as I get different outputs changing the PID settings.

The problem:
If I set the spindle speed to S100; it will achieve that speed (what is good), but if I put a load on the spindle, it will tend to stop. In fact I can totally stop it. My poor knowledge about the PID tells me that if the speed gets lower than the desired speed, the PID should compensate it and should increase the output value analog value, so that it will counterbalance the fact that the input speed is lower than the desired speed.

I have checked the pwmgen.03.value; and I can see that the value changed with the load, this is, I think it is really trying to compensate and that the PID is working - but necessarily in a not enough "powerful" because the compensation is not enough to get the desired output (in this case that the spindle do not stop).

The relevant part of the HAL:
setp   hm2_5i20.0.pwmgen.03.output-type 1
setp   hm2_5i20.0.pwmgen.03.scale  [SPINDLE_9]OUTPUT_SCALE


# ---ABS functions set up
loadrt abs count=3
addf abs.0 servo-thread # analog output
addf abs.1 servo-thread # Real spindle speed display
addf abs.2 servo-thread # Commanded spindle speed display

# ---Encoder feedback signals/setup---

setp    hm2_5i20.0.encoder.03.counter-mode 0
setp    hm2_5i20.0.encoder.03.filter 1
setp    hm2_5i20.0.encoder.03.index-invert 0
setp    hm2_5i20.0.encoder.03.index-mask 0
setp    hm2_5i20.0.encoder.03.index-mask-invert 0
setp    hm2_5i20.0.encoder.03.scale  [SPINDLE_9]ENCODER_SCALE

net spindle-revs <= hm2_5i20.0.encoder.03.position motion.spindle-revs
net spindle-index-enable <=> hm2_5i20.0.encoder.03.index-enable <=> motion.spindle-index-enable
net spindle-vel-fb-rps  hm2_5i20.0.encoder.03.velocity => motion.spindle-speed-in

#PID for spindle
setp pid.s.Pgain [SPINDLE_9]P
setp pid.s.Igain [SPINDLE_9]I
setp pid.s.FF0 [SPINDLE_9]FF0

# ---setup spindle control signals---

net spindle-brake <= motion.spindle-brake
net spindle-at-speed => motion.spindle-at-speed
net spindle-vel-cmd-rps => motion.spindle-speed-out-rps => pid.s.command
net spindle-vel-fb-rps   pid.s.feedback
net fwd motion.spindle-forward  => hm2_5i20.0.7i84.0.2.output-06
net rvs motion.spindle-reverse  => hm2_5i20.0.7i84.0.2.output-07
net spindle-on  motion.spindle-on hm2_5i20.0.pwmgen.03.enable pid.s.enable


net pid-out pid.s.output => abs.0.in
net pid-abs abs.0.out => hm2_5i20.0.pwmgen.03.value

and the PID settings:
#********************
# Spindle 
#********************
[SPINDLE_9]
P = 2 # (tested with 1 2 3 10 30 50 ...) from +-60 up the spindle commands do not work, and normally it clamps to the max speed to all speeds set
I = 0
D = 0.0
FF0 = 60
ENCODER_SCALE = -1440 # encoder is 360 ppr
OUTPUT_SCALE = -2500

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

More
27 Oct 2013 01:03 #40329 by PCW
What is the PID output when it runs away?

I suspect what is happening is this:

When you have the P gain high enough the PID output swings negative after an overshoot but since you have the absolute component the actual VFD control voltage is positive for a negative PID output so now instead of negative feedback in the loop, you have positive feedback and it runs away. (If my theory is correct, you will find the the PID output is full negative in the runaway condition)

This is definitely an unsafe situation so at the minimum I would shut things down on excessive PID error (and put the spindle commanded speed through a limit component to limit its rate of change so that the control loop can follow the command)

Maybe someone who has implemented closed loop spindle control can post some hal code for a more complete and working closed loop spindle control.

There ought to be some fairly standard HAL boilerplate for this

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

More
27 Oct 2013 05:12 #40333 by andypugh

0-2500 rpm is the objective that I can achieve with 0 to 10VDC on the VFD. This is done.
I have encoder feedback that is also working and connected to the PID (I think).


First get it working as well as you can with P and I both zero. FF0 should be capable of doing very nearly the whole job.
In fact I am not all that convinced that closed-loop is even necessary with a VFD.

Then I suspect that part of your problem is as PCW has explained.

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

More
27 Oct 2013 15:21 #40341 by emcPT

What is the PID output when it runs away?


It clamps to the max, so 10V in the analog output, so it should be doing exacly what you are saying. This is definitly a bad PID, and as I said in my post it only happens with a large P value = bad PID tunning.
For now it is not unsafe as the machine is under testing.

In fact I am not all that convinced that closed-loop is even necessary with a VFD.

This one I really did not expected, and it is for sure not my case.
In all of my parts I use constant surface speed, so it is necessary to have the spindle at the speed required by the controller. It is allowed to have a bit of variation, but as my test showed the PID is not working as expected. The rest of the PID's in my system for the servos are working ok, and I only have the P=1 set up.

PID settings applyed to my machine - this my also help others:

If i understand correctly the FF0 will place on the output the corresponding value for desired speed as a fixed value.
As example if I consider that I want a speed of 250rpm and my scale is from 0 to 2500 rpm, the FF0 will place on the output 10% of the output signal (in my case is 0-10V) so the FF0 will be responsable for placing in the output 1V. I am not sure why I have 60 in FF0 but it is sure related with 60seconds (1 minute).
So the FF0 (and the FF1 and FF2) will place on the outcomming value of the PID a value that not takes in account the feedback value.

So, if I ask for 250rpm, the analog value will be 1V, if the spindle is rotating at 0rpm; or 10rpm or 1000rpm (this would be enough, if the VFD was able to rotate the motor without the loss of torque, for example at low speeds).

Now, if P=1 with the same settings what would happen if the same spindle set speed is at 250rpm and the real spindle speed is at 0rpm? My basic math would say:

Final output (in volts from the mesa card) = 1V (due to the FF0 explained before) + 1 (from P) * (desired speed - actual speed)

now, and I probably I am wrong, the desired speed - actual speed are managed in relation with the output scale (in my case 2500), so the final formula should be:

Final output (in volts from the mesa card) = 1V (due to the FF0 explained before) + 1 (from P) * (1V - 0V)

and the PID output would be 2V.

This is correct? (I do not think so), because if it is, I am not getting this result on the machine.

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

Moderators: piasdom
Time to create page: 0.139 seconds
Powered by Kunena Forum