Welcome! Log In Create A New Profile

Advanced

PID tuning of the extruder motor

Posted by sam0737 
PID tuning of the extruder motor
September 01, 2009 03:43PM
---------Some unimportant BS---------
The Al motor mount parts came back from the workshop. minor issue during assemblying because I am not aware the controller board is actually that TALL and hence those designed mounting position doesn't work. Nevermind, at least the magnetic encoder is positioned correctly.

I rewrote the firmware, I rewrote the EMC2 HAL userspace driver, the pyvcp UI. I don't like the stock V3 firmware that it has basically no safe guard.

Say if the RS485 link is down, it won't stop. if the thermistor is disconnected, it won't stop. if the heater doesn't heat up the thermistor (suggesting thermistor fall off from the block), it won't stop...I would definitely share the codes on github in a few days.

I spent a two days to hook everything up. Now I could press a button and the motor starts spinning.

It's a pinchwheel design, constructed by T2.5 pulley mounted on the shaft, and a 5mm*11mm*3mm(thick) skate bearing mounted on an M5 which is then mount in parallel with the output shaft, leaving ~2.5mm spaces in between. Result? It grabs so well that I couldn't even pull the ABS stick out of the way! Sonuds too good to be true.

I then started trying to drive it with PID instead of PWM. As I always think, writing program is much easier than making mechanicial system works...
----------end of BS-----------


I am using a geared DC motor, hooked to AS5040 magnetic encoder to do closeloop feedback. However, the encoder is sensing to the geared output shaft. I just wish there was a shaft at the back side, but there isn't. So it gives me only 512 resolution per revolution. (Recall that we are interrupting the pin A edge changes only in the firmware)

I don't know about the gear ratio, as it's a 2nd hand motor customized for OEM, the spec couldn't be found...but the speed is like 80rpm at free load.

Now I have really bad luck in tuning the PID loop. Spend a few hours and couldn't get it works in acceptable shape. No problem at high speed but at low speed, it's simply stop-and-go-and-stop-and-go...

I am thinking...is the motor spinning too fast? Would buying a motor with single-digit free load RPM helps?

What is the usual extrusion rate? I am not sure if my Math is right here.

Nozzle: 0.5mm, ABS Thread: 3mm. Target should be around 36mm/s?
36mm/s / (3*3 / 0.5/0.5), that would be 1mm/s on the thread. My pulley is dia 11.4mm => ~36mm circumference.

which means I need 1/36 revolution per second, with 512bit encoder resolution, I need to be at about 14-steps per second.

Wow. Looks like a small number. Could PID loop really tuned for speed as slow as that?

Anyone know if there is any good PID loop tuning guide around?

Edited 2 time(s). Last edit at 09/01/2009 03:46PM by sam0737.
Re: PID tuning of the extruder motor
September 01, 2009 05:12PM
Found this comment when I was hacking on Zach's PID loop in his Gcode Experimental firmware for the extruder code last year:

// somewhat hacked implementation of a PID algorithm as described at:
// [www.embedded.com] - PID Without a PhD, Tim Wescott

That helped me get things moving nicely.

I run my GM3 at around 30 rpm on a screw drive; that works out to 0.5 mm of plastic feedstock per second, or about 3 mm^3/s of plastic.

Goofing around, I did get the GM3 to run like the second hand of a clock, at 1 rpm, ticking along nicely, so 2 rpm should be doable with some tweaking. As long as you've got enough torque to move.

Wade
Re: PID tuning of the extruder motor
September 02, 2009 12:29PM
Today I finally got the heater assembled, and I got my first filament extruded!

I found that the pressure inside the nozzle acts as a very good low pass filter...hence the PID really doesn't have to be so accurate.

My gear is not tight enough though, it's keep slips if the speed is >5mm/s.

Let me have the machine cool down and try to do some adjustments-
Sorry, only registered users may post in this forum.

Click here to login