Fryer MB-11 Bed Mill Retrofit

More
03 Aug 2017 04:04 - 03 Aug 2017 04:05 #96958 by adamj12b
Tonight I was able to try this. I was work with "BeachBumPete" on the IRC channel testing some things.

What I found is the encoder needed to be inverted so that positive open loop motion incremented the encoder.

With that done, I tested the system again with the same results. I ended up turning the loop down more to P=0.5 and no other values other then max output of 10. Ferror and min-ferror are set to 4 now. Still the same issue. The servo does not hold. Here is a couple videos I took.

Here is a video showing the servo enabling and spinning in open loop test.


Here is a video showing a commanded move of G01 X-10 F2. You can see that pid.x.error is just counting while the x-output just stays at 0.0025.


Here is a video of me turning the servo shaft manually. When crossing the 0 point, you can feel a slight greater resistance then it gives up again. This makes me think PID as the window where it trys to correct is very tiny. A few encoders lines if that.


-Adam
Last edit: 03 Aug 2017 04:05 by adamj12b.

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

More
03 Aug 2017 13:28 #96973 by adamj12b
Progress!!

After sleeping, I thought more about it and realized the PID is most likely the culprit. It was not even trying to correct for the error.

I increased the P greatly and ended up with extreme oscillations. The servo wants to lock now. I will work on the tuning tonight.

Here is the setting currently programmed.
#********************
# Axis X
#********************
[AXIS_0]
TYPE = LINEAR
HOME = 0.0
FERROR = 10000.0
MIN_FERROR = 10000.0
MAX_VELOCITY = 110.0
MAX_ACCELERATION = 2.0
P = 5000.0
I = 0.0
D = 0.0
FF0 = 0.0
FF1 = 0.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
MAX_OUTPUT = 100.0
ENCODER_SCALE = -20000.0
OUTPUT_SCALE = -10.0
OUTPUT_MIN_LIMIT = -10.0
OUTPUT_MAX_LIMIT = 10.0
MIN_LIMIT = -30.0
MAX_LIMIT = 0.01
HOME_OFFSET = 0.0

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

More
03 Aug 2017 14:27 #96975 by andypugh
Glad you are making progress.
I think that your f-error limits are now _too_ big, you want to catch a runaway before it hits the end-stops.

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

More
09 Aug 2017 18:32 #97251 by adamj12b
This weekend I was able to install the control panel into the cabinet and start wiring everything into it. As of Sunday evening, the machine can move in Y and Z!!



As you can see I was able to jog the machine with the buttons and the MPG. One thing I asked about of the IRC channel was being able to smooth out the motion of jogging with the MPG. The machine is so heavy, and the acceleration is high enough that the abrupt motions vibrate the whole house... The wife wasn't too happy about this and the dogs started freaking out. Somebody mentioned using ILowPass to smooth the MPG, but I was not able to do this successfully.

The hal file was generated with pncconf, which I have now left behind as I have reached its limits.

Using this example linuxcnc.org/docs/html/examples/mpg.html as a simple guide, I added the component to my hal file, inserting the in and out in between what was in place already. Snippet below.
# ---Top of file with other loadrt's---

loadrt ilowpass
addf ilowpass.0 servo-thread

setp ilowpass.0.scale 1000
setp ilowpass.0.gain 0.01


# ---jogwheel signals to mesa encoder - shared MPG---

#net joint-selected-count     <=  hm2_5i25.0.7i84.0.2.enc0.count
net mpg-out ilowpass.0.in     <=  hm2_5i25.0.7i84.0.2.enc0.count
net joint-selected-count  <= ilowpass.0.out

Is there any reason this shouldn't work? The example mentions multiplying increment by the scale of the ilowpass, but I dont understand why...

-Adam

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

More
09 Aug 2017 19:11 #97255 by andypugh
MPG jogging moves the machine by (for example) 0.1mm for every encoder count.
The ilowpass component still has to work in integer encoder counts, so it outputs 1000 counts for every input count, but ramped in slowly and ramped out slowly.
However, as there are now 1000 more counts, the distance-per-count needs to be reduced by the same factor.

But: I don't know if ilowpass will work adequately in the servo thread.

You seem to be saying that it doesn't work. In what way does it not work?

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

More
09 Aug 2017 19:21 #97256 by adamj12b
I will get the exact error when I get home, but it would not launch and the debug said it could not create the pin ilowpass.0 and it was already in use.

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

More
09 Aug 2017 19:37 #97257 by andypugh
Make sure you reduce the jog increments, or you might get rather more movement than you expect (1000 times more)

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

More
09 Aug 2017 21:55 #97264 by rodw
Replied by rodw on topic Fryer MB-11 Bed Mill Retrofit

Make sure you reduce the jog increments, or you might get rather more movement than you expect (1000 times more)


Which is definitely not fun based on my personal experience. The examples showing lowpass and MPG's have quite dangerous parameters. I took it all out and do no filtering. (I'm using a 433Mhz wireless controller whose receiver is connected to a 7i76e MPG input)

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

More
10 Aug 2017 15:35 #97300 by adamj12b
Actually, Once I applied my default tuning to all axis, it was more stable. The servos are still in Torque mode which doesnt seem to be a problem so far. Tonight I will test the limits of the servos. I should be able to get 300IPM, but the best I could do without follow errors was 254. Im going to check and see what my output signal is. If its 10V, there isnt enough torque to make it to 300IPM... Well See.

The default tuning I came up with for the DMM-Tech 1.0KW servos is below. It seems strange that I needed so much P gain to get them to lock up hard. and I had to add alot of I to get them to react fast enough, which then needed a good amount of dampening... Just looking for some thoughts on what the tuning should look like.

What I did was set the P gain until I could not fight the servo any more, but also didn't have excessive oscillations. 6000 was stronger but I could not stop the oscillations without a load on the servo.

This is currently the same for all Axis.
FERROR = 0.5
MIN_FERROR = 0.05
MAX_VELOCITY = 5.0
MAX_ACCELERATION = 10.0
P = 4000.0
I = 600.0
D = 9.1
FF0 = 0.0
FF1 = 9.5
FF2 = 0.13
BIAS = 0.0
DEADBAND = 0.0
MAX_OUTPUT = 10.0
ENCODER_SCALE = 40000.0
OUTPUT_SCALE = -10.0
OUTPUT_MIN_LIMIT = -10.0
OUTPUT_MAX_LIMIT = 10.0

-Adam

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

More
10 Aug 2017 17:03 #97305 by PCW
Replied by PCW on topic Fryer MB-11 Bed Mill Retrofit
For torque mode drives I would first set the servo thread rate higher (period lower)
If your PC can do it I would run at 4 KHz (250000 ns servo thread period)

Then I would use a low P value (say 100) and then set D as high as you can until you get oscillations
Then back of about 30% on D

Next set P as high as you can without oscillations and again back off about 30% from the point you get oscillations

Then tune FF1 and FF2 (not sure why you have so much FF1, FF1 does not make much sense in a a pure
torque mode drive)

Finally tune I the same way (increase till you get low speed oscillations and the back off about 30%)

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

Moderators: cncbasher
Time to create page: 0.165 seconds
Powered by Kunena Forum