Pseudo Feedforward?
-
During a print here's a couple scenarios and the adjustments I would like to make-
- Using an external servo motor and drive we need to change, via G-code PID settings (vary resistance, hardware TBD) on the drive when a certain condition is met (programmed feed rate, accel). We want to do this because the PID settings are optimized for a combination of load and acceleration and is not optimum for much of the print.
- For a given feed rate we want to change configuration settings like acceleration, MISC, steps/mm, etc..
There could also be some combination of these scenarios.
I use Prusaslicer and although I haven't dug in to it too deep I know there is some functionality there using macros and in RRF too but I haven't come across examples where people have done this. Is this realistic and if so what would be the best approach to implement it.
-
gcode post processor may be easier for the first one than trying to trick the firmware. For the second, I wonder why heater feed forward isn't sufficient -- I assume this is not for a normal filament feeder but some kind of alternate system (syringe/pellet/other)?
-
@oliof I'll have to look into the heater ff to see if it can be useful. Changing the step rate is probably not realistic because the transition will probably introduce error. I remembered that acceleration can be independently set for infill, perimeters, etc in Prusaslicer so that may cover that. I understand what a post processor is/does but I'm assuming that would take a good bit of programming knowledge which I dont have.
-
@3dpmicro you may want to look into nonlinear extrusion https://docs.duet3d.com/User_manual/Reference/Gcodes#m592-configure-nonlinear-extrusion to change extrusion rate on faster moves. Combined with Feedforward https://docs.duet3d.com/User_manual/Reference/Gcodes#m309-set-or-report-heater-feedforward it may get you closer to your goal without post processing stuff.
-
@oliof interesting. I wonder how the values in the command correlate to the actual step rate? I also wonder if @dc42 has considered something similar to what Geckodrive does called Morphing https://www.geckodrive.com/support/how-morphing-works
But primarily to take some load off the processor for high step rates?Edit- I dont understand the capabilities of condition g-codes in RRF but could meta commands be configured to drive i/o's, pwm, etc.?
-
@3dpmicro Im not entirely sure what you mean with your first point.
For the second one, there is something along those lines already made. This dude just made his own firmware, specifically to focus on extrusion control: closed loop with an encoder running against the filament, feedforward adjustments for temperature based on flow required, extruder slip protection, etc.. its quite awesome
https://github.com/ErwinRieger/ddprint
it should give you an idea of the amount of work and effort needed for this sort of project.
-
@pjl thanks for the feedback. For clarity this all relates to the x or y axis servo motors not extrusion. Servos use PID to control part of their behaviour. With the wildly different motion profiles (accel,velocity, distance, decel profile, including rapid back and forth) 3d printers use (compared to a milling machine or anything else for that matter) the PID settings are not ideal for all types of moves. I want to be able to control that.
-
@3dpmicro in all honesty, PID is not the way for accurately controlling servos.. you are then talking at the very least about nested control schemes for position, velocity, acceleration, perhaps motor current.. all this is usually done in some manufacturer provided software to be adjusted. Then the question is, can they change the settings in operation? Then how to provide setpoints from the gcode for this? And I dont even know off the top of my head how to set up duet with servos haha
looks like you are talking about gain scheduling control where you "switch" between a bunch of different PID settings... Its an option, but far from the optimal one in my opinion. How many different cases are you willing to tune? Its a PITA.
-
@pjl What are you suggesting as a different control approach over PID? I agree it may not be ideal but improving inexpensive hardware (that I already have) that otherwise performs exceptonally well seems worth considering and PID, as far as I can tell is still standard for closed loop servos.
There are probably only 2 or maybe 3 desired schemes so not too bad. Getting past the software control part is only 1 element though. I would still have to sort out the hardware control of at least 3 trim pots (digipots?). At this point its simply an exploration of possibilities.