Commit Graph

2768 Commits

Author SHA1 Message Date
Torsten Bögershausen 7b87f3b9b6 motorRecord: Handle ACCS != 0.0 in init_record
When a database wants to use ACCS from the start, when the record is loaded
into the IOC, the init_record() function needs to look at it.
The new way is to set ACCS != 0.0 and ACCL == 0.0 and then ACCS takes over.
The compatible (call it old ?) way is to have ACCS == 0.0, and then ACCL
is used.
2018-12-04 10:47:39 +01:00
Torsten Bögershausen 36177f7b82 motorRecord.cc: Add ACCS field
The problem:
When a user changes the velocity by writing to the VELO field,
but forgets to write to the ACCL field, the acceleration will
change and may be too high.
(Note: Many users are not aware of this side-effect).

Solution:
Introduce a field called ACCS, "Acceleration in seconds^2".

Once the field is written, the ACCL field is updated and the
acceleration is "locked".
It is locked for changes of VELO.
It can be be unlocked by writing to ACCL.

If the acceleration is locked (or not) is stored in the field ACCU,
which can be either "motorACCSused_Accl" or "motorACCSused_Accs".

And in this sense ACCU is not a lock, but just keeps track which
of the accelation fields ACCL or ACCS has been updated last, and
should be used in the next movement.
In any case an update to ACCS updated ACCL and the other way around.
Thanks to Mark Rivers for this nice idea.
2018-12-04 10:39:48 +01:00
Kevin Peterson ff8c74a6e8 Merge pull request #112 from EuropeanSpallationSource/base-3_16_typedef_rset
Base 3.16 typedef rset
2018-10-19 15:22:14 -05:00
Kevin Peterson 0481251e55 Merge pull request #119 from EuropeanSpallationSource/asyn_R32_deprecated_contructor
Deprecated constructor "asynPortDriver" since asyn R4.32.0
2018-10-16 16:22:40 -05:00
Kevin Peterson c38725e424 Merge pull request #116 from kmpeters/issue111
1.  Changed init function arguments in model-1 drivers to int
2.  Simplified the init function logic related to "after"
3.  Cast the pointer to the init function as DEVSUPFUN in the motor_dset structure
2018-10-16 13:40:46 -05:00
Torsten Bögershausen 8deb21c463 Deprecated constructor "asynPortDriver" since asyn R4.32.0
The asyn module make the constructor
asynPortDriver::asynPortDriver(const char *portNameIn, int maxAddrIn,
           int paramTableSize, int interfaceMask, int interruptMask,
           int asynFlags, int autoConnect, int priority, int stackSize)

obsolete in R4.32.0, the more modern version should be used, which does
not have the parameter paramTableSize.
Using a modern version of asyn for the motor gives a compiler warning.
As I don't like compiler warnings, add a #ifdef construct to suppress it
for asyn > R4.32, and still allow to compile agains asyn >= R4.32
2018-10-11 11:07:08 +02:00
kpetersn b6669de490 Cast pointer to *_init_record function as DEVSUPFUN in motor_dset structure for DeltaTau and Oms model-1 drivers. 2018-10-10 15:09:42 -05:00
kpetersn 66203a98cb Reverted most of the previous commit. Only use a release for base 3.15. 2018-10-10 14:20:48 -05:00
kpetersn 8c412e7db4 Use released versions of base instead of the development versions for Travis builds. Use EPICS base 7.0 instead of 3.16 2018-10-10 14:08:15 -05:00
kpetersn d6b1b64c35 Cast pointers to init functions as DEVSUPFUN to eliminate compile errors
like this:

../devOmsPC68.cc:74:1: error: invalid conversion from ‘long int
(*)(int)’ to ‘DEVSUPFUN {aka long int (*)(void*)}’ [-fpermissive]
 };

and this:

./devPmac.cc:66: error: invalid conversion from 'long int (*)(int)' to
'long int (*)(void*)'
2018-10-10 11:08:54 -05:00
kpetersn e56f0585ba Changed XXX_init argument from void * to int. Some drivers fail to build. 2018-10-10 10:26:19 -05:00
Torsten Bögershausen dcf7b37c89 Avoid warnings with R3.16.1 in devSoft.cc and devMotorSim.c
Need to set USE_TYPED_RSET to avoid a warning whencompiling
against Base R3.16.1
Older Bases don't know the #define, and R3.16.1 seems to need it.
2018-10-02 16:11:37 +02:00
Torsten Bögershausen 5198a2d552 Clean up the EPICS_VERSION/rec sup, use motor_epics_inc.h
Refactor the changes for the deprecated RECSUP in later EPICS base
version, which need a typedef for struct rset.
Unite all common code and put it into a single include file.
Add motor_epics_inc.h.
2018-09-19 07:48:00 +02:00
Torsten Bögershausen 71e417b4db define VERSION_INT when using older EPICS bases
Newer EPICS base versions define VERSION_INT, but older don't.
Add a conditional #define to compile against those older bases, like 3.14
2018-09-18 18:04:05 +02:00
Torsten Bögershausen eb3566976d More adaptions to base-3.16/7.0 with typed rset
Remove more compiler warnings when compiling against the base 7.0 branch.
Note:
Some of the model1/2 drivers still give a warning. As I can not test the
code, leave those files untouched.
2018-09-18 16:30:25 +02:00
Ben Franksen 8eacc2f05a Adapt motorRecord.cc to base-3.16 with typed rset 2018-09-18 16:27:59 +02:00
Mark Rivers 9aba61b06c Changed definition of soft_init; it is passed an int, not a void * 2018-09-08 14:33:46 -05:00
Mark Rivers c6e655d8b3 Merge branch 'master' of github.com:epics-modules/motor 2018-09-08 14:04:29 -05:00
Mark Rivers 58354556aa Fixed soft_init: it is passed an int, not a (void *). 2018-09-08 14:04:15 -05:00
Mark Rivers ee9fca1dc3 Fixes for problems that showed up in base 7.0.
- It was using the value of mr->[link]->value.constantStr and mr->[link]->value.pv_link.pvname without checking the link types.
  This was incorrect, and led to errors because constantStr no longer has a defined value if the link type is not CONSTANT.
  Changed so that it only accesses these union fields if the link is the correct type.
- It did not check if pv_link.pvname was NULL before calling CA functions, though now that we check the link type perhaps this cannot occur.
- It did not lock the motor record before accessing the fields.
- Added Debug calls to show the link types and values.
2018-09-08 12:44:59 -05:00
Mark Rivers d5ada7b86f Added support for profile moves on Q8 controller which uses a different path for trajectory files than C8 2018-09-07 08:17:12 -05:00
Mark Rivers 9b046da878 Added support for profile moves on Q8 controller which uses a different path for trajectory files than C8 2018-09-07 08:17:03 -05:00
Mark Rivers 0b8da74ca3 Added stdarg.h, otherwise compiler error with va_start and va_end undefined if DEBUG is defined 2018-09-07 08:15:01 -05:00
Mark Rivers ae637292db Added stdarg.h, otherwise compiler error with va_start and va_end undefined if DEBUG is defined 2018-09-07 08:11:59 -05:00
Mark Rivers 8b5d5f92bd Added note at the end that the file is incomplete 2018-08-25 17:14:47 -05:00
Kevin Peterson f6e9f26209 Merge pull request #109 from kmpeters/issue100
Don't set "stop" field true if driver returns RA_PROBLEM true

Partially reverts commit 303a9208e3

Fixes issue #100:
> There have been multiple problems caused by the motor record sending a stop when the problem bit is set.
>
>    One problem is discussed here:
>    https://epics.anl.gov/tech-talk/2018/msg01338.php
>
>    The commit that introduced the stop is 303a920. I vaguely recall the change being a workaround for less-than-idea behavior of a motor controller, but neither @rsluiter nor I remember which controller that was.
>
>    Motor drivers should be modified to send the stop command when the condition that triggers the setting of the problem bit is detected, if needed.
2018-08-21 12:34:24 -05:00
kpetersn 26771f23dc Added a comment about reverting the change from .69 2018-08-21 12:05:30 -05:00
kpetersn 95c0a4caa2 Don't set "stop" field true if driver returns RA_PROBLEM true. It is
the driver's responsiblity to stop a motor if the condition that results
in the RA_PROBLEM bit being set doesn't result in the motor
automatically stopping.

This partially reverts commit 303a9208e3
2018-08-21 11:56:25 -05:00
Kevin Peterson 741d4292cd Merge pull request #108 from kmpeters/issue27
Set LVIO=1 if DLLM > DHLM
2018-08-21 09:59:42 -05:00
kpetersn 270347dfb3 Set LVIO=1 if DLLM > DHLM, since at least one limit being violated 2018-08-20 17:41:34 -05:00
Kevin Peterson a21b1ccbd6 Merge pull request #99 from EuropeanSpallationSource/JOG_LVIO_JOG_nolockup
motorRecord.cc: Jogging against to LVIO in LVIO

This change resets the JOGF/JOGR fields to zero when a limit violation occurs, rather than when the JOGF/JOGR fields get reset to zero by the user.
2018-08-20 14:50:07 -05:00
Kevin Peterson c09b49c245 Merge pull request #107 from lnls-sol/fixAero
Add devAerotechSeq.dbd to WithAsyn example
2018-08-20 12:10:00 -05:00
Torsten Bögershausen 9e5b54323a motorRecord.cc: Jogging against to LVIO in LVIO
When jogging has stopped because the motor is close to a softlimit,
the record seems to be locked up when the same jog button is pressed again.

The user must release the jog button, before doing any other action.
STOP doesn't help, neither does jog into the opposite direction work.

Solution:
Clear the JOGF and JOGR button in the record.
2018-08-20 09:08:22 +02:00
Gabriel Fedel 36a9351dba Add devAerotechSeq.dbd to WithAsyn example
This change allow to use Trajector Scan state machine from Aerotech.
2018-08-17 14:38:00 -03:00
Kevin Peterson 000082b55a Merge pull request #105 from kmpeters/XPS_mutex_id_init
Fix for segfault when XPSConfigAxis isn't called before using a motor (Fixes #104)
2018-08-10 12:22:59 -05:00
kpetersn 1477975057 Patch from Takashi Nakamoto of the National Astronomical Observatory of
Japan:

"While I was developing an EPICS application on the top of the motor
module, my application died for segmentation fault. The reason was my
mistake: I forgot to call XPSConfigAxis before I start to use that axis,
but it took time for me to find it out (e.g. compiled the motor module
and my application with debug option, running gdb, ...). So, I thought
it would be nice if an error message is shown in the console instead of
sudden death only with segmentation fault message, and the attached
patch does it."
2018-08-10 10:47:02 -05:00
kpetersn c0c5b5b351 Multiple improvements to the Aerotech A3200 driver from Ron Sluiter:
* .04 03-15-18 rls - Restored "Task number" argument to
A3200AsynConfig.
* .05 05-01-18 rls - Do not check the limit switches of virtual axes.
*                  - Added "single-axis" (MOVE{ABS/INC} or "multi-axis"
(LINEAR) user selectable move option.
2018-08-08 16:27:33 -05:00
kpetersn 6fb6f171de Bug fix for ImsMDrivePlusMotorController.cpp from Ron Sluiter on
2018-07-16
2018-08-08 16:22:06 -05:00
kpetersn 4fb9e1c934 Changes to motor_notes.txt from Ron Sluiter on 2018-01-10 2018-08-08 16:18:48 -05:00
Kevin Peterson 548a013a38 Merge pull request #103 from kmpeters/ensemble-stuck-on-limit-fix
Ron's fix for ensemble-stuck-on-limit problem
2018-08-06 16:32:07 -05:00
kpetersn 8e8e559606 Changes from Ron Sluiter on 2018-06-28:
"If disabling torque due to a fault, clear motorAxisProblem so that user
can Jog off limit switch."
2018-08-06 16:09:51 -05:00
kpetersn 70b489f2de Corrected my email address. 2018-08-03 09:51:53 -05:00
kpetersn 58976fa288 Corrected path to new docs directory in README.md 2018-08-01 13:52:03 -05:00
Kevin Peterson 09fcb5986c Merge pull request #101 from kmpeters/github-pages-docs
Make motor documentation compatible with github pages
2018-08-01 13:41:26 -05:00
kpetersn d739f5c1dd Use github pages links instead of htmlpreview links 2018-08-01 13:37:13 -05:00
kpetersn 3b75e3096f Renamed motor.html to index.html so that it can be used with github pages. 2018-08-01 13:26:17 -05:00
kpetersn fd4641f267 Renamed documentation directory so that it can be used with github pages. 2018-08-01 13:23:40 -05:00
Kevin Peterson 3683d3f0ea Merge pull request #56 from EuropeanSpallationSource/JOG_stopped
Record recognizes motor stop while jogging.

Text from the pull request:

'The following situation came up while debugging soft limits in a
motion controller which had different values then the record.

The motor is at position 50mm (RBV=50), the low soft limit is 15 (LLM=15),
jogging velocity is 10 mm/sec (JVEL=10).

The motion controller has an internal soft limit which is 35 mm, which
we want to test.
Set JOGR to 1, the motor will move backwards.
(Side note: it would be stopped by the record once it passed 25mm).

Before that, the motion controller stops the motor internally and reports DONE.
The state machine in the record is not prepared to handle this and JOGR stays 1.
The expected behavior is that JOGR returns to 0.
Because this is an unexpected stop, reset even pending home requests.
In other words: call clear_buttons(pmr)

Whether or not an alarm is raised may be another question.
The natural thing would be to set LVIO to 1, but we don't know why the controller
stopped the motion.
Unless we add a bit in MSTA like "RA_LVIO"...
But in any case this can and should go into a separate commit.'
2018-07-03 09:11:27 -05:00
Torsten Bögershausen 9c8a8e8c35 Record recognizes motor stop while jogging
The following situation came up while debugging soft limits in a
motion controller which had different values then the record.

The motor is at position 50mm (RBV=50), the low soft limit is 15 (LLM=15),
jogging velocity is 10 mm/sec (JVEL=10).

The motion controller has an internal soft limit which is 35 mm, which
we want to test.
Set JOGR to 1, the motor will move backwards.
(Side note: it would be stopped by the record once it passed 25mm).

Before that, the motion controller stops the motor internally and reports DONE.
The state machine in the record is not prepared to handle this and JOGR stays 1.
The expected behavior is that JOGR returns to 0.
Because this is an unexpected stop, reset even pending home requests.
In other words: call clear_buttons(pmr)

Whether or not an alarm is raised may be another question.
The natural thing would be to set LVIO to 1, but we don't know why the
controller stopped the motion.
Unless we add a bit in MSTA like "RA_LVIO"...
But in any case this can and should go into a separate commit.
2018-06-29 11:38:31 +02:00
Kevin Peterson a002988622 Merge pull request #98 from kmpeters/encoder_ratio_fix
Modified drivers that expect unsigned encoder ratio parameters, as discussed in issue #82.  This change preserves the behavior of the device support for the MM3000 and OMS controllers before pull request #84.
2018-06-27 12:24:18 -05:00