1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 <2024> | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 <2024> |
<== Date ==> | <== Thread ==> |
---|
Subject: | RE: Questions about creating a Model 3 Driver for stepper motor axis |
From: | Paul-Elie GUILLOT via Tech-talk <tech-talk at aps.anl.gov> |
To: | Mark Rivers <rivers at cars.uchicago.edu>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov> |
Date: | Thu, 25 Jan 2024 13:24:56 +0000 |
Hi Mark, Thank you very much for all your answers, it helped me a ton! I have some comments and questions: Based on my cinematic configuration (stepper motor with absolute encoders), I implemented the Retry strategy with RMOD ‘Unity’, RTRY 5 and RDBD at the same values as ERES. I will use FRAC, I have initialize at 0.98.
Encoder ratio seems to have been introduced as you explained as the ratio
.
I was misled by the phytron driver that uses it as a ratio to apply on encoder counts polled from the axis. I have then not implemented the set_encoder_ratio. I did not implement the DLY field but in my PLC controller I only return the Motion Done (DONE) in MSTA after a settling time to filter the encoder counts.
I have added 2 records in my database to handle the axis error and axis error reset mechanism. To do so, I have redefined the function ‘SetIntegerParam’ from asynMotorAxis (I still call the base class function at the start). After the base call, I have define my own record management (ie. Resetting the axis)
Again as I am using absolute encoders, I did not implement the ‘home’ function form asynMotorAxis. But I was concern with the user trying to issue directly step command after a hardware reset, as the stepper motor loses its position. However, I noticed the field RSTM define as ‘Restore Mode’, but I did not find extensive information about this field. But looking in devMotorAsyn.c, it seems to be used in init_controller which is used in init_record, I understood that init_record is used by the motor record in the same fashion as the
build_trans function, is that correct? In init_controller based on RSTM filed, it sends a set_position command to the motor based on the Dval/mres. Which seems to be the exact behavior, I was looking for. I have then defined the set_position function in my driver and initialize the filed RSTM as “Always”.
On my controller creation, do I need to be careful on the initialization? Like by implementing a force first call to poll or something like that to feed initial values to the record? How does the initialization of a record start? I saw in the phytron driver, it implements a function ‘epicsInitHookFunction’ where it locks the controller until at least one poll is
done. In practice, is there any need to have such function? I did not see anything like that on other drivers. Thank you so much for your help and time Best Regards Paul-Elie GUILLOT Technology Manager in Automation and Robotics Téléphone: +33 (0)4 76 44 98
93 20 rue du Tour de l'Eau F-38400 St Martin d’Hères Cedex Phone : +33 (0)4 76 44 12 96 IRELEC after sales services – please send your request to
support at irelec-alcen.zendesk.com
Any disclosure, use, dissemination or reproduction (either whole or partial) of this message or the information contained herein is strictly prohibited
without prior consent of Irelec. De : Mark Rivers <rivers at cars.uchicago.edu> Hi Paul-Elie,
Yes, that is correct.
No, that not quite correct. Asyn address devices using a string “port name”, and an integer “address”. There is a single parameter table for the controller. That is 2-D table [numParameters, numAxes]. So there is
an entry for the velocity of each axis, etc.
Retries are most commonly used with stepper motors with encoders, or some other readback mechanism. For servos we generally rely on the controller to close the loop. The motor record is then not involved in doing any
feedback operations.
Yes, that is correct.
I think encoder ratio is for stepper motors, and is the ratio between motor steps and encoder counts.
Delay after move was mainly designed for servo controllers which may decide to report that a move is complete before the final settling is complete.
Is it defined by the user, or should initialize UEIP at 1, in my template defined in “motor.substitutions.irelec” adding the field UEIP to my .db file (which is derived from basic_asyn_motor.db
with some field added)? You can define it in your database or in autosave.
Yes, that is correct. A change on a field of the record will be processed by motorRecord.cc and use the different functions I have redefined for my Driver (move, poll, etc…), is it correct? Yes, that is correct.
Yes, that is correct.
Correct. In Model 3, it seems the asynMotorController directly handles the modification of its parameters by calling the needed function of an axis. How does the record interface with the asynMotorController
parameters? I can’t find where devMotorAsyn.c writes to the asynMotorController parameters. It is done on the build_trans function.
https://github.com/epics-modules/motor/blob/f8a3239f0678f8f3d75fd5cf2f9c717dc3db9426/motorApp/MotorSrc/devMotorAsyn.c#L480 It constructs a message and queues a request to write to the driver in this line: When the driver is ready the callback function is called
It then writes integer and floating point parameters in the lines starting here: Those values write to asynMotorController, which then calls the axis functions. Bottom line of this topic is: Can I use the record advanced functions such as backlash compensation even with a Model 3 Driver? Yes.
Yes. However as I don’t have a home routine (due to absolute encoders), the open loop (step count) is reset at each hardware controller power reset. It could be the home procedure, just sending a setposition() to the stepper based on the encoder position? Or does the home position require motion? Your home function does not need to do anything, it can just report the absolute encoder position.
You can handle that in your driver. Mark From: Tech-talk <tech-talk-bounces at aps.anl.gov>
On Behalf Of Paul-Elie GUILLOT via Tech-talk Hello to everyone at tech-talk, I am currently working on implementing an EPICS driver for controlling axis which are stepper motors with absolute encoders. I have read multiple documentation and I have started to implement a driver based on the Model 3 drivers, I have heavily inspired myself from the MCB4B Driver for ACS and the Phytron driver. I am starting to get a better understanding on how it works but I still need clarifications on some points. Would you be so kind to help me on those matters? First of all,
Because from what I gathered the motorEncoderPosition_ must be linked to the Field REP and is the hardware counter of the encoder.
Is it defined by the user, or should initialize UEIP at 1, in my template defined in “motor.substitutions.irelec” adding the field UEIP to my .db file (which is derived from basic_asyn_motor.db
with some field added)?
In Model 3, it seems the asynMotorController directly handles the modification of its parameters by calling the needed function of an axis. How does the record interface with the asynMotorController
parameters? I can’t find where devMotorAsyn.c writes to the asynMotorController parameters. Bottom line of this topic is: Can I use the record advanced functions such as backlash compensation even with a Model 3 Driver?
It could be the home procedure, just sending a setposition() to the stepper based on the encoder position? Or does the home position require motion?
I need it’s a lot of questions, I hope it is clear enough. In any case, thank you for your time and help. Paul-Elie GUILLOT Technology Manager in Automation and Robotics Téléphone: +33 (0)4 76 44 98
93 20 rue du Tour de l'Eau F-38400 St Martin d’Hères Cedex Phone : +33 (0)4 76 44 12 96 IRELEC after sales services – please send your request to
support at irelec-alcen.zendesk.com
Any disclosure, use, dissemination or reproduction (either whole or partial) of this message or the information contained herein is strictly prohibited
without prior consent of Irelec. |