Commit Graph
2178 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 PetersonandGitHub 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 PetersonandGitHub 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
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 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 FranksenandTorsten Bögershausen 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
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
kpetersn 270347dfb3 Set LVIO=1 if DLLM > DHLM, since at least one limit being violated 2018-08-20 17:41:34 -05:00
Kevin PetersonandGitHub 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
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
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 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
Kevin PetersonandGitHub 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 PetersonandGitHub 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
Kevin PetersonandGitHub 7a758b7238 Merge pull request #84 from mp49/encoder_ratio_fix
Keep the sign information on the MRES and ERES used to calculate the encoder ratio. This fixes issue #82.
2018-06-27 12:21:22 -05:00
kpetersn c185b99ea9 Modified MM3000 and OMS device support to handle signed components of the encoder ratio. 2018-06-27 11:39:00 -05:00
Kevin PetersonandGitHub 0dc3a09a0b Merge pull request #36 from rokvintar/ls_status_update_fix
Status of limit switches updated independent of movement direction.  Fixes #35
2018-06-26 15:45:59 -05:00
Kevin PetersonandGitHub 31e0afe6a7 Merge pull request #93 from softwareschneiderei/oms_encoder_sync
OMS: Synchronize motor position with encoder position before every move.
2018-06-21 12:18:00 -05:00
Marius Elvert d061e913c3 Removed version control info from file 2018-06-21 09:55:12 +02:00
sluiter 74a8cedc28 Update CountsPerUnit everytime torque is enabled to reduce IOC reboots 2018-05-31 16:47:44 -05:00
sluiter acf0d00496 Update home search from EPICS docs. 2018-05-31 16:45:41 -05:00
klang 4938a51ce4 Few more wrong casts 2018-05-29 16:18:47 -05:00
Kevin PetersonandGitHub 53cea7fad9 Merge pull request #79 from keenanlang/master
Keenan added Scriptable Motor Controller support (depends on the lua module: https://github.com/epics-modules/lua)
2018-05-02 13:04:36 -05:00
Kevin PetersonandGitHub 90bb52f3c6 Merge pull request #60 from EuropeanSpallationSource/record-DLYandSTOP-problem
Record: motor record DLY and STOP problem
2018-05-01 09:51:03 -05:00
Kevin PetersonandGitHub f3d4e0fd1d Merge pull request #83 from mp49/autopower_fix
Fix issue with power being left on when using autoPower option in asy…
2018-04-27 10:42:03 -05:00
Kevin PetersonandGitHub beba85f7b2 Merge pull request #94 from shadowguy/master
Added I/O flush before first query (Micronix MMC-x00)
2018-04-27 10:34:19 -05:00
rsluiterandGitHub 6990911206 Merge pull request #95 from kmpeters/AMCI_ANF2
Added support for AMCI ANF controllers
2018-04-20 08:44:26 -05:00
Kevin Peterson ed95506bb1 Fix for building on Windows 2018-04-19 11:09:28 -05:00
kpetersn a827730f71 Updated the comment in the .h file. 2018-04-18 15:39:57 -05:00
kpetersn 35f5cf0849 Minor improvements to README_ANF2.md 2018-04-18 15:26:49 -05:00
kpetersn 12c6237ef1 Added README_ANF2.md 2018-04-18 15:23:22 -05:00