Thanks Mark, that makes sense now. I forgot to check the base class logic.
Cheers,
Matt
From: Mark Rivers <rivers at cars.uchicago.edu>
Sent: Thursday, January 18, 2024 6:16 PM
To: Pearson, Matthew <pearsonmr at ornl.gov>; tech-talk at aps.anl.gov
Subject: [EXTERNAL] RE: Galil advice for servo motors
Hi Matt,
Thanks for the reply. Actually setting the PCOF, ICOF, and DCOF fields in the motor record does set the PID values on the Galil controller, and it does do scaling from the 0-1 PID values in the driver to the values
used by the controller. For example, the proportional gain code is here:
https://github.com/motorapp/Galil-3-0/blob/eb8b8c32c481374f34656faf3bca0df48e7a39c8/3-6/GalilSup/src/GalilAxis.cpp#L1470
That setPGain function is called from asynMotorController when the PCOF field in the record is changed. The scaling from 0-1 is done by multiplying by KPMAX, the maximum allowed KP value in the Galil controllers,
1023.875.
So simply adding PCOF, ICOF, and DCOF to autosave should be a persistent way to set those coefficients.
Mark
Hi Mark,
I seem to remember the PID fields in the motor record are restricted to 0-1 values, which is of limited use. The motor record documentation mentions scaling can be done by the driver, but I’m not aware of any model
3 driver doing this and it would be confusing.
In the Galil driver it seems like the functions were implemented:
grep -r set.Gain *
GalilSup/src/GalilAxis.h: asynStatus setPGain(double pGain);
GalilSup/src/GalilAxis.h: asynStatus setIGain(double iGain);
GalilSup/src/GalilAxis.h: asynStatus setDGain(double dGain);
But they are not called in the GalilController class, and there are no associated records for setting KP, KI or KD in the galil_motor_extras.template. So I suspect it was never fully implemented.
It wouldn’t take too much to add driver parameters and records to call those functions, but a quick work around would be to manually set KP, KI or KD by sending strings to $(P)SEND_STR_CMD after IOC init, either
via a few ‘dbpf’ commands or a set of stringout records.
Cheers,
Matt
Folks,
I have been using the Galil DMC-4183 controllers for stepper motors, both with pulse/direction outputs and on-board amplifiers.
I now am setting up my first servo system with on-board amplifiers and quadrature encoders. I have a question about the best way to configure and save the PID parameters. Do people generally using the motor
record to configure KP, KI, and KD, or do you use the Galil GDK to configure those and then just save in the non-volatile memory on the controller?
I did not find any discussion of this in the EPICS Galil documentation.
Thanks,
Mark