epics-modules / ecmc

EPICS Support for EtherCAT Motion Controller (ECMC) and Generic IO Controller
GNU Lesser General Public License v3.0
24 stars 16 forks source link

max velocity #47

Closed kivel closed 2 years ago

kivel commented 3 years ago

Since ECMC is able to operate w/o the motorRecord, a means to limit the maximum velocity should be available.

So far, it's possible to catch high velocity violations only via monitoring, which is nice, but always throws the axis into an error state. The new feature should reject velocity setpoints above the specified upper limit.

anderssandstrom commented 3 years ago

Sure, I agree! But if you try to set a higher set point I guess there need to be an error code, right? Si ilar issue with soft limits I think, if you try to set a set point outside soft limits. I will look at it!

tboegi commented 3 years ago

Note that the motorRecord will silently limit the velocity > max velocity: If VELO > VMAX && VMAX != 0: VELO = VMAX

kivel commented 3 years ago

@tboegi , yes, that's for motorRecord operation, the feature is targeting the operation w/o the motorRecord.

Whether an error, a warning or a truncation of the setpoint should happen, we can discuss.

But first we need to agree on whether we do it in the motion controller or in Epics.

In Epics, one could simply use the 'DRVH' and 'DRVL' field of the ao record https://epics.anl.gov/base/R7-0/6-docs/aoRecord.html Maybe that's something I should add to ecmccfg anyway?

tboegi commented 3 years ago

Are we talking about the same things ? There are 2 different strategies in the motorRecord: Setting a position (.VAL) outside the soft limits (.LLM .HLM) is not accepted, and sets the .LVIO (limit violation) field.

Setting a velocity "to high" will use the highest allowed velicity, VMAX.

Of course, if there are no softlimits (.HLM = 0.0 && .DLM = 0.0) then there will be no limitation inside the motorRecord.

And for the velocity: if VMAX == 0.0 then there is no limitation either

kivel commented 3 years ago

@tboegi , no, we are talking different things here :) We are discussing how to handle setpoints outside the allowed range on the motion controller level, and or operation w/o motorRecord. I assume the motion controller should also catch those violations when 'wrong' setpoints are originating from a PLC?

tboegi commented 3 years ago

I assume the motion controller should also catch those violations when 'wrong' setpoints are originating from a PLC? Yes

anderssandstrom commented 2 years ago

I think this issue have been adressed here: https://github.com/epics-modules/ecmc/commit/ca0ab33f984f8840997e90b43ed4124514f80cac test needed

kivel commented 2 years ago

I can confirm that this works.

anderssandstrom commented 2 years ago

Ok, then I close this issue.