DiamondLightSource / pmac

Driver for the Delta Tau PMAC motion controller family.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dkill from EPICS

georgekontogiorgos opened this issue · comments

Hi!

Is there a way to perform a dkill from some PV?

I have to do it in order to engage brakes in a correct way

Thanks!

Hello,

There is no specific PV for that command. However you can send any arbitrary command to the controller with the $(P):SendCmd PV. This is in pnacController.template so you will already have this PV in your IOC.

You could easily add your own PV which make use of the PMAC_C_WRITE_CMD asyn parameter.

This is what the SendCmd record looks like.

record(waveform, "$(P):SendCmd")
{
field(DTYP, "asynOctetWrite")
field(FTVL, "CHAR")
field(INP, "@ASYN($(PORT),0,$(TIMEOUT=4))PMAC_C_WRITE_CMD")
field(NELM, "100")
field(SCAN, "Passive")
}

Thank you for the prompt reply, Giles.

We thought about making CNEN field as dkill, what is your oppinion about it?

Nowadays CNEN=1 enables the controller and CNEN=0 kills (not dkill) the controller, from my tests. Do you think we could easily change this command on pmac IOC?

We would prefeer this kind of solution to standarize our interfaces with motor record, so it will be nice if this approach could be possible.

Hi George, changing the behaviour of the CNEN field requires changing the driver itself. Was that your intention?

To do this I believe you would need to change the function setClosedLoop in pmacAxis.cpp. Unfortunately this would break turbo pmac support since the kill command is not currently abstracted by pmacHardwareInterface (it only abstracts commands that differ between turbo pmac and power pmac at present). You could add the abstraction to pmacHardwareInterface in order to fix this.

I would be a little nervous about making a global change to setClosedLoop although there may be an argument to say that dkill defaults to the same behaviour as kill unless specifically configured via
Motor[x].BrakeOnDelay. Note that this changet would not affect Diamond's use of the driver since we use the Asyn Parameter 'PMAC_C_KILL_AXIS' to stop axes, via a dedicated PV that does not go through the motor record.

obviously you could add another parameter that switches between kill and dkill in setClosedLoop for a given axis - but this would have to be something outside of the motor record.

We could do some tests here on setClosedLoop. This makes you nervous because the modification could break something on dls stable version?

yes, obviously if you do this in your own branch there is no issue. However it would be nice if any changes that are generally useful make it into the stable version.