Hello,
I'm adding support for a Kossel Pro delta printer with a BBB+CRAMPS 
controller.

For the extruder PWM temperature control, I used PID values from BeBoPr 
lineardelta hal files:
setp pid.0.Pgain  0.30
setp pid.0.Igain  0.00001
setp pid.0.Dgain  0.9375

I noticed that the temperature overshoots the set point and was wondering 
why.

Here's an example of data I collected after setting the temp to 60 degrees:
  while [ 1 ]; do halcmd show | egrep 'pid.0.command |pid.0.error 
|pid.0.feedback |pid.0.output'; echo =========================; sleep 1; 
done
   556    557 float IN             60  
pid.0.command                                    0.000010        0 <== 
e0.temp.set
   556    557 float OUT          33.6  
pid.0.error                                      0.000010        0
   556    557 float IN           26.4  
pid.0.feedback                                   0.000010        0 <== 
e0.temp.meas
   556    557 float OUT      10.58001  
pid.0.output                                     0.000010        0 ==> 
e0.heater
=========================
   556    557 float IN             60  
pid.0.command                                    0.000010        0 <== 
e0.temp.set
   556    557 float OUT          27.7  
pid.0.error                                      0.000010        0
   556    557 float IN           32.3  
pid.0.feedback                                   0.000010        0 <== 
e0.temp.meas
   556    557 float OUT       8.81001  
pid.0.output                                     0.000010        0 ==> 
e0.heater
=========================
   556    557 float IN             60  
pid.0.command                                    0.000010        0 <== 
e0.temp.set
   556    557 float OUT          17.9  
pid.0.error                                      0.000010        0
   556    557 float IN           42.1  
pid.0.feedback                                   0.000010        0 <== 
e0.temp.meas
   556    557 float OUT       5.87001  
pid.0.output                                     0.000010        0 ==> 
e0.heater
=========================
   556    557 float IN             60  
pid.0.command                                    0.000010        0 <== 
e0.temp.set
   556    557 float OUT           6.6  
pid.0.error                                      0.000010        0
   556    557 float IN           53.4  
pid.0.feedback                                   0.000010        0 <== 
e0.temp.meas
   556    557 float OUT       2.48001  
pid.0.output                                     0.000010        0 ==> 
e0.heater
=========================
   556    557 float IN             60  
pid.0.command                                    0.000010        0 <== 
e0.temp.set
   556    557 float OUT          -4.9  
pid.0.error                                      0.000010        0
   556    557 float IN           64.9  
pid.0.feedback                                   0.000010        0 <== 
e0.temp.meas
   556    557 float OUT    -0.9700063  
pid.0.output                                     0.000010        0 ==> 
e0.heater
...

I tried modifying PID values after reading this:
  https://github.com/machinekoder/machinekit/wiki/pid_theory_es
, but I still saw overshoot to about 77 degrees.

As an experiment, I tried deleting some signals and setting the pwmgen 
value manually:
  halcmd delsig pid.0.output
  halcmd delsig limit1.0.out
  halcmd delsig e0.heaterl
  halcmd setp hpg.pwmgen.00.out.01.value 0.2

That gave a slower rise in temperature which made me wonder if the 
pid.0.output needed to be scaled to a percentage, suitable for input to 
pwmgen.

I noticed that there's a pwmgen->scale value in the machinekit code 
src/hal/components/pwmgen.c and the description 
http://linuxcnc.org/docs/html/hal/rtcomps.html#_pwmgen "Scaling factor to 
convert *value* from arbitrary units to duty cycle." sounded like what I 
wanted, but hal_pru_generic/pwmgen does not have a scale parameter.

I tried adding "setp hpg.pwmgen.00.out.01.scale  100" to my .hal and the 
temperature rose very slowly and did not overshoot, but does not seem to 
get all the way to temp.  I chose a scale of "100" thinking that 100 
degrees below the set point might need full, 100% pwm power.

Is this the right way to produce less overshoot or does hal_pru_generic's 
pwmgen have a scale similar to the non-PRU pwmgen?

Thanks!

-- 
website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
https://github.com/machinekit
--- 
You received this message because you are subscribed to the Google Groups 
"Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to machinekit+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to