I don"t know anything about HAL commands. However, I recall that velocity is a vector and position is a scalar. Not the same thing, so not directly interchangable as a PID variable. Velocity is the rate of change of position. Integral of velocity is position Hope this helps. Martin Owen Patton North Ridgeville, Ohio 44039
Sent from Proton Mail Android -------- Original Message -------- On 1/9/25 6:26 AM, Viesturs Lācis <viesturs.la...@gmail.com> wrote: > svētd., 2024. g. 8. dec., plkst. 23:52 — lietotājs Viesturs Lācis > (<viesturs.la...@gmail.com>) rakstīja: > > > > I would like to ask for more details on how exactly to implement this. > > Since now the pid input is position, adding limit3 does not make sense > > as I would not control the jerk. I need to change the pid input to > > velocity. Does it mean that it will change from closing position loop > > to closing velocity loop? And I will have to redo pid tuning? > > > > I am trying to introduce limit3 component before PID input. > With all the holidays and other matters inbetween I have been stuck on > this for a while. > What I have in HAL file at the moment: > > net motor.00.vel-fb hm2_5i24.0.encoder.00.velocity => pid.0.feedback > > net emcmot.00.vel-cmd-raw joint.0.vel-cmd > net emcmot.00.vel-cmd-raw limit.0.in > > net emcmot.00.vel-cmd-lim limit.0.out > net emcmot.00.vel-cmd-lim pid.0.command > > net motor.00.command pid.0.output > net motor.00.command bldc.0.value > > The thing I do not understand at all is how to approach PID tuning. At > the moment I have set P=20 and all the rest to 0 and I get > oscillations indicating that the value is too big, but the actual > velocity is totally different from commanded. If I try to jog, motor > does not slow down when button is released, I have to jog in opposite > direction to reduce actual velocity, motor drifts until ferror limit > is reached. It seems that it is no use of usual approach with starting > with P parameter which almost immediately gives more or less control > over the motor (increase P until vibration starts, reduce a bit and > move to D). > > I would appreciate any advice on how to tackle this one. > > Viesturs > > > _______________________________________________ > Emc-users mailing list > Emc-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/emc-users > _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users