#linuxcnc-devel Logs

Oct 08 2017

#linuxcnc-devel Calendar

12:07 PM skunkworks: pcw_home, not 100% sure I have the thread orders correct - but it seems to be atleast trying to keep the voltage http://electronicsam.com/images/KandT/testing/plasma/PIDinitaltune.png
12:14 PM pcw_home: I would think thread order should normally be:
12:14 PM pcw_home: hardware read
12:14 PM pcw_home: do all PID and other timing critical things
12:15 PM pcw_home: hardware write
12:15 PM pcw_home: do all non-timing-critical things
12:15 PM skunkworks: right - but there is offset, scales and such.
12:16 PM skunkworks: I would assume that stuff should happen before the pid for z and thc
12:17 PM pcw_home: input signal conditioning to PID before PID, PID output signal conditioning after
12:18 PM skunkworks: makes sense
12:18 PM skunkworks: offset has an update output and update feedback. for some reason that has me stumped
12:19 PM pcw_home: Never played with offset so I don't really understand it
12:21 PM skunkworks: really simple componant..
12:21 PM skunkworks: FUNCTION(update_feedback) { fb_out = fb_in - offset; }
12:21 PM skunkworks: FUNCTION(update_output) { out = in + offset; }
12:22 PM skunkworks: it is hooked between motion and pid
12:22 PM skunkworks: for z axis
12:22 PM skunkworks: so I can use the torch voltage to 'offset' the z axis to keep the gap
12:28 PM pcw_home: Oh I thought you were using the "offset" branch
12:28 PM skunkworks: no - not yet
12:32 PM pcw_home: the offset component should be simpler as it does not have the requirement to partition the motion constraints between the TP and the offset input
12:33 PM pcw_home: (of in this case its all one or the other)
12:33 PM pcw_home: -of
12:38 PM pcw_home: It would be nice if you could simulate the control loop so it could be tuned without cutting something...
12:40 PM pcw_home: maybe siggen with scale/offset to simulate height variations and feedback from position
12:41 PM skunkworks: yes - it is a pain on the fly
12:42 PM pcw_home: its a bit opposite of tuning CNC servo position loops since the input is unknown (like the disturb input to a position servo)
12:43 PM pcw_home: so no helpful Feed forward terms...
12:51 PM skunkworks: right
01:05 PM pcw_home: but assuming the feedback is relatively linear it should be mostly P that used since its a simple position in/ velocity out loop
01:12 PM pcw_home: Might need the PID maxerror setting to avoid overshoot at the beginning
01:12 PM pcw_home: Also the accel and velocity limits of the stepgen will affect tuning but its probably
01:12 PM pcw_home: better to make sure the PID output can be followed without bounding
03:43 PM skunkworks: pcw_home, thanks. I really want a limit between the pid and the offset. otherwise the adding and removing the correction is very slow
03:43 PM skunkworks: but limit3 bugs haven't helped
04:05 PM pcw_home: Whys is the correction slow?
04:07 PM skunkworks: I am not quite sure - but if you set an offset (step change) the motion is pretty slow. I figured it had something to do with motion correcting it every servo cycle/.
04:07 PM skunkworks: but if you chop it up using limit3 - it offsets as fast as limit allows
04:08 PM skunkworks: if that makes sense
04:10 PM skunkworks: I know the maxerror of the pid effected the slowness
04:11 PM pcw_home: It should move as fast as the stepgen settings if you have enough P gain
04:12 PM pcw_home: limit 3 should only slow it down
04:14 PM pcw_home: what is the Z axis scaling? inches?
04:14 PM skunkworks: yes
04:17 PM pcw_home: so if you have a voltage difference of 50V and P=1 you should get a requested velocity of 50 IPS
04:17 PM pcw_home: (probably a bit too fast...)
04:20 PM pcw_home: this can be bounded by the stepgen velocity limit
04:20 PM pcw_home: limit 3 would be better but if its busted :-(
04:21 PM skunkworks: let me show it here
04:22 PM pcw_home: For the mean time I would set the stepgens max velocity and max accel to as fast as your mechanics can follow
04:23 PM pcw_home: and let them bound the PID output and rate of change
04:28 PM skunkworks: yes - that is what i have.
04:30 PM skunkworks: http://electronicsam.com/images/KandT/testing/plasma/withoutlimit3.png
04:31 PM skunkworks: that is without the limit. you see the step change to the offset - then motion correcting
04:31 PM skunkworks: this is with the limit3 hooked to offset
04:31 PM skunkworks: http://electronicsam.com/images/KandT/testing/plasma/withlimit3.png
04:31 PM skunkworks: same halscope settings
04:34 PM skunkworks: the correction happens at .5ips (30ipm) vs if I connect the limit3 in front of the offset - it happesn at the vmax of the limit3 - 2ips
04:34 PM skunkworks: and you don't get the step change to the following error
04:35 PM pcw_home: I would just set the following error to the full Z range
04:37 PM pcw_home: What is the maxerror setting?
04:38 PM pcw_home: that (and P) will limit your correction velocity
04:38 PM skunkworks: .0005
04:38 PM skunkworks: p is 1000
04:38 PM skunkworks: (mesa stepgen pid
04:39 PM pcw_home: I would set P to about 5 and maxerror to maybe 10, you are not running a linear feedback system as is
04:39 PM pcw_home: you are running a up/down only system with those settings
04:41 PM pcw_home: the P=1000, maxerror = .0005 make sense for a nearly perfect velocity mode servo where FF1 does the heavy lifting (the stepgen for example)
04:42 PM pcw_home: but will give you up/down action when you have no feedforward and are always running in saturation
04:42 PM pcw_home: (error always > maxerror)
04:43 PM pcw_home: in fact P may have to be really low (its scaled in IPS/Volt) to even P of 1 may be too much
04:44 PM pcw_home: so even
04:45 PM skunkworks: it is actually (if I am understanding what I am doing) V to position. (1v-.008") or so
04:45 PM skunkworks: there is a scale componant between the voltage pid and the offset that scales the voltage out of the pid to distance
04:46 PM skunkworks: this is hooked with the offset command between the commanded position and fb position
04:47 PM skunkworks: but yes - the P seems to need to be low - I was finding anything higher than 5 was unstable
04:48 PM skunkworks: again - if I am explaining myself very well
04:49 PM skunkworks: This is all my initial config to try things out
04:49 PM pcw_home: Oh you have a position mode stepgen driven by a separate PID?
04:49 PM pcw_home: I was assuming it was all one PID
04:50 PM pcw_home: you probably have to disable the stepgens maxerror since that assumes FF1
04:50 PM skunkworks: 2 pid's - the normal stepgen pid velocity setup - plus a pid controlling the offset command taking in a set voltage and the torch voltage feedback
04:51 PM skunkworks: for some reason - I thought that was a good starting point :)(
04:51 PM pcw_home: thats why it creeps at .5 IPS (= 1000 * .0005)
04:52 PM skunkworks: That is what I sortof figured.. (increasing the maxerror - increased the speed)
04:52 PM pcw_home: Its probabl neccesary since you need position mode for homing and torch-off motions
04:53 PM pcw_home: maxerror=.0005 is not really usable without perfect feed forward
04:54 PM pcw_home: and not really needed in this case as long as you have reasonable velocity/accel limits on the stepgen
04:55 PM skunkworks: I will have to play with it some more.. - when I increased the maxerror to increase the speed - I think I started getting rining
04:55 PM skunkworks: ringing
04:56 PM skunkworks: but that could be an issue with thread order.
04:56 PM pcw_home: set it to 0 and re-tune
04:56 PM skunkworks: I just need some more time to play
04:56 PM skunkworks: :)
04:58 PM skunkworks: but it seemed to be closing the loop - that is something :)
04:58 PM pcw_home: the THCs maxerror should probably be set to 10V or so (whatever the normal operating range is)
05:02 PM pcw_home: You want to make sure that the feedback is linear where it needs to be (say within 10V)
05:02 PM pcw_home: if its bounded (by the THC or Stepgen) you will have a up/down system that will hard to tune
05:12 PM skunkworks: ok
05:14 PM skunkworks: pcw_home, thanks for your insight.
05:16 PM pcw_home: Hope its helpful....
05:21 PM skunkworks: It was helpful - just hope I can apply it :P