Commit Graph

105 Commits

Author SHA1 Message Date
Douglas Clowes
7c0dfe437a SICS-632 Allocate a copy of the connection, for motor tracing, and free it at the end. 2013-07-08 15:53:59 +10:00
Douglas Clowes
a44cd3464d Add a disconnected state to the motor state machine, rename Unknown to Init 2013-07-08 15:53:54 +10:00
Douglas Clowes
4bc06cea76 SICS-501 Special one-shot move after changing direction for backlash 2013-07-08 15:53:46 +10:00
Douglas Clowes
b76cee0525 Add sending the motor name in config information to the fake motor 2013-07-01 13:38:22 +10:00
Ferdi Franceschini
357170a735 SICS-616 Removed obsolete setpos command from motor driver. 2013-05-31 09:55:10 +10:00
Douglas Clowes
7e0e068ee2 differentiate forward/reverse limit switches in 'crashed' log message 2013-05-31 09:35:52 +10:00
Ferdi Franceschini
0954c3bceb Fixed compile error, ‘struct __MoDriv’ has no m ember named ‘errMsg’ 2013-05-31 08:06:38 +10:00
Douglas Clowes
4a363d0e95 SICS-614 reallocate errMsg buffer each time it's used 2013-05-28 16:22:44 +10:00
Douglas Clowes
ba128520da Add motor runtime to motor stopped log message 2013-02-15 09:49:39 +11:00
Douglas Clowes
eb1d042440 set driver_status to HWIdle on HALT in motor Idle state 2013-02-06 10:27:00 +11:00
Douglas Clowes
fd064f3df9 revise logging and state trace
r3790 | dcl | 2012-11-13 13:38:25 +1100 (Tue, 13 Nov 2012) | 1 line
2012-11-15 17:41:39 +11:00
Douglas Clowes
a9fc20abee make poll rates configurable by adding motorPollSlow, motorPollFast and airPollTimer parameters
r3682 | dcl | 2012-07-26 15:48:38 +1000 (Thu, 26 Jul 2012) | 1 line
2012-11-15 17:35:00 +11:00
Douglas Clowes
5118d7b23e Add TCP address:port to displayed parameters for use in simulation
r3655 | dcl | 2012-07-19 14:57:03 +1000 (Thu, 19 Jul 2012) | 1 line
2012-11-15 17:33:50 +11:00
Douglas Clowes
f5537d7c9e Provide a way to configure a simulated motor if it identifies itself as being simulated
r3638 | dcl | 2012-07-11 15:11:41 +1000 (Wed, 11 Jul 2012) | 1 line
2012-11-15 17:32:44 +11:00
Douglas Clowes
66caf6916b Don't change anything on startup, defer settings until moving and then do each time
We don't want to change anything on the controller when we start SICS so we don't interfere with whatever else is talking to it. So don't command it during init.

We also want to send Speed, Accel and Decel on each move so we defer those until then.
r3622 | dcl | 2012-06-28 15:39:47 +1000 (Thu, 28 Jun 2012) | 5 lines
2012-11-15 17:31:44 +11:00
Douglas Clowes
2c4f45b573 Try to defer HWIdle notification until the motor is really idle
r3620 | dcl | 2012-06-27 15:11:04 +1000 (Wed, 27 Jun 2012) | 1 line
2012-11-15 17:31:39 +11:00
Douglas Clowes
eeac77f9ce Refactor the timer clearing; force timer clear on set; improve the tracing of timer operations.
r3616 | dcl | 2012-06-26 14:36:32 +1000 (Tue, 26 Jun 2012) | 1 line
2012-11-15 17:31:30 +11:00
Douglas Clowes
b10b1608b2 Creep last encoder count by steps-per-count/10 instead of one, for motors with large steps-per-count
r3544 | dcl | 2012-05-17 11:02:53 +1000 (Thu, 17 May 2012) | 1 line
2012-11-15 17:28:06 +11:00
Douglas Clowes
f22a6da843 Make the delay after turning the motor ON configurable to allow for motors with slow switch on (e.g. airpads) and default it to the old hard-coded value (200mSec).
r3331 | dcl | 2012-01-05 12:28:20 +1100 (Thu, 05 Jan 2012) | 1 line
2012-11-15 17:22:06 +11:00
Ferdi Franceschini
b58a6fdaf1 Tweak the resolver wrap around bias code to let us simply set a mask to
bias off the high bits on multiturn encoders because these bits can
increment if you unplug a resolver.

r3307 | ffr | 2011-12-02 12:49:54 +1100 (Fri, 02 Dec 2011) | 4 lines
2012-11-15 17:20:19 +11:00
Ferdi Franceschini
4707f319b9 Remove obsolete code
r3306 | ffr | 2011-12-02 12:47:19 +1100 (Fri, 02 Dec 2011) | 2 lines
2012-11-15 17:20:14 +11:00
Ferdi Franceschini
d778dd2bfe sicshipacaba.c
SICS-418 Make sure hnotify sends messages as hdbevents when using the
JSON protocl

site_ansto/instrument/config/hmm/hmm_object.tcl
Initialise the hmm object to make sure the read type is set.

nxscripts_common_1.tcl
Set the read type when saving the hmm data.

server_config.tcl
Fix the autosave command so that you can enable/disable autosave while
the histogram memory is running.

protocol.c
Reduce noise in log files when using the JSON protocol.  Don't log
messages generated during macro execution (ie within a TCL proc).

motor.c:MotorStatus
Abort the current operation, the scan command and batch files when a
motor object returns a hardware fault status value.

motor_dmc2280.c
set driver status to HWFault when the driver is in the error state.

r3251 | ffr | 2011-09-23 08:49:00 +1000 (Fri, 23 Sep 2011) | 25 lines
2012-11-15 17:16:12 +11:00
Ferdi Franceschini
8514dace59 motor_dmc2280.c
When a motor stops and power saving is enabled (ie motor left on) the driver should check for faults and then transition to the idle state.
r3134 | ffr | 2011-05-19 08:37:16 +1000 (Thu, 19 May 2011) | 2 lines
2012-11-15 17:12:44 +11:00
Ferdi Franceschini
3abd3effa2 Set detector y lower limit for Quokka
Improve precision of motor position calculation.

r2844 | ffr | 2009-12-11 12:39:12 +1100 (Fri, 11 Dec 2009) | 3 lines
2012-11-15 16:58:22 +11:00
Ferdi Franceschini
e36e9f1146 conman.c
Reduce log noise by setting iout = eInternal for macros.

servlog.c
Fixed timestamp in logfiles to get hours.

hmm_configuration_common_1.tcl
Added ML's mods to wombat config: ie BAT and FAT TABLE attributes and elements for multi-period acquisition and histo-streaming.
Fixed "failed lsearch" bug. It's more robust to test for a non-successful lsearch instead of a failed lsearch.

nxscripts_common_1.tcl
SICS-297 Fixed Saving data series in a scratch file overwrites earlier entries.

instdict_specification.tcl
Added "scobj" kind and "sct_indexed_motor" sics object type for script context controllers and and objects.

hipadaba_configuration_common.tcl
Added sct_indexed_motor sics obj type to ::hdb::sobjadd and scobj kind to ::hdb::add_node

sct_positmotor_common.tcl
Update the index SICS variable when updating the current index value to make sure that the position is saved in the data file.
You must now provide the hdb node_name when creating the sct posit motor.
mk_sct_positmotor now sets the "param" and "long_name" attributes on the posit motor object

util/utility.tcl
Added ::utility::set_sct_indexed_motor_attributes to set SICS object attributes required for generating hdb info for an SCT_POSIT_MOTOR

nxscript.c
Merge the ansto mod to putslab (rev1.7) which adds support for saving unbuffered data from the histmem.

sicshipadaba.c
This incorporates the patch made to CommandSetCallback in rev1.10 so it can just be copied as is (ie no merge required).
WARNING: There are changes to ListHdbNode to handle record separators which may affect us.
Disabled sending hdb command start and stop messages because they break gumtree

sicshdbfactory.c
Disabled sending hdb command start and stop messages because they break gumtree

hipadaba_configuration_common.tcl R2.4DEV
The sct_posit_motor case of ::hdb::sobjadd is only needed to call add_node with kind=scobj.

nxscripts_common_1.tcl R2.4DEV
Added ::nexus::scobj::sdsinfo
_gen_nxdict now skips nodes with data_type == "none"

new util/script_context_util.tcl R2.4DEV
Adds ::scobj::hinitprops command to initialise the hdb properties for script context object nodes.

sct_positmotor_common.tcl R2.4DEV
Use ::scobj::hinitprops utility command to initialise hdb properties on script context object parameter nodes.

dynstring.c
DynStringReplace should memcopy '\0', otherwise it can get the wrong length for iTextLen.
Added DynStringReplaceWithLen to allow initialising a dynstring with char arrays which contain null chars and
other non-ascii chars.  Useful for read and write buffers in script context.

ascon.c
AsconRead return NULL for noResponse and AsconFailed otherwise the "result" node gets set with a spurious empty value.

scriptcontext.c
SctActionHandler only set  the "result" node if there really is a reply.

sicsobj.c
Update from M.K.

site_ansto.c
Added galil and ordela hvps protocol handlers for scriptcontext.

motor_dmc2280.c
Allow home parameter to be outside of limits (for KOWARI)

hardsup/makefile
Added ordela HVPS protocol handler

hardsup/sct_orhvpsprot.c
New ordela HVPS protocol handler.  Retries on NAKs and re-orders pot channels (ie toggles lower two bits).

hardsup/sct_velselprot.c
Start velocity selector protocol handler.

hardsup/sct_galilprot.c
Completed galil protocol handler.

hipadaba_configuration_common.tcl
Add new style SICS objects to hdb tree.

instdict_specification.tcl
Added scobj to kind list and sct_motor to sics object list. (and some housekeeping)

hmm_configuration_common_1.tcl
Added ratemaps to simulation.  Fixe BAT_TABLE and added PERIOD_INDICES as per Mark Lesha's mods for multi-period acquisition.
ratemaps now return float.

sct_postimotor_common.tcl
Now setting properties on the posit motor object so that it can be automatically added to the hdb tree.

hrpd/config/motors/motor_configuration.tcl
Fixed simulated msd motor so that it's handle properly in the hdb layer.

sans/config/hmm/detector_ordela.tcl
Updated the ordela calibration script to use the new sct_orhvpsprop.c script context controller.

quokka_configuration.tcl
Deleted lines which set the hdb properties for script context posit motors.  This is now handled automatically as for other SICS objects.

utility.tcl
setpos now replaces the motor setpos subcommand.
Added functions to set script context object attributes and sct_posit motor attributes.
Created hparPath and hsibPath convenience commands for new-style SICS objects.

script_context_util.tcl
NEW! Adds hinitprops function to initialise the hdb properties for a script context object

r2758 | ffr | 2008-12-12 17:53:53 +1100 (Fri, 12 Dec 2008) | 113 lines
2012-11-15 16:56:43 +11:00
Ferdi Franceschini
3afb9597f2 Fixed SICS-273: hnotify sends position updates for some stationary motors
Reverted change from rev 1.79 19-Aug-08
which was supposed to send IDLE state position updates if position change is greater than the precision.

r2697 | ffr | 2008-09-18 16:00:52 +1000 (Thu, 18 Sep 2008) | 5 lines
2012-11-15 13:42:31 +11:00
Ferdi Franceschini
165f1b90a4 lakeshore340_common.tcl
Lakeshore controllers will be connected to the ca5-[instrument] moxa box
Default config parameters are now available via a tc_dfltPar array
IP and socket number are now mandatory when creating an ls340 object

hrpd/.../lakeshore340.tcl
Multiple lakeshores can now be added to the hdb tree

echidna_configuration.tcl
Provide example  for configuring two lakeshores

SICS-134 reflectometer/../commands.tcl
First draft of beam/attenuator command, currently sends POS=xx (this won't work)

reflectometer/../motor_configuration.tcl
Add bat position feedback via action

sans/../motor_configuration.tcl
Renamed action parameter (aoid) to "action"

server_config.tcl
Initialise motor movecount to 500 to reduce number of position updates by a factor of 50

SICS-134 action.c
Update the beam/attenuator command feedback variable when POS changes.

SICS-134 motor_dmc2280.c
Added PLP:BAT:POS status response handler for platypus bat position updates
Only send IDLE state position updates if position change is greater than the precision.
Rename action parameter (aoid) to "action"

r2679 | ffr | 2008-08-19 15:11:55 +1000 (Tue, 19 Aug 2008) | 31 lines
2012-11-15 13:41:17 +11:00
Ferdi Franceschini
8a07f5eaf6 SICS-188 hdb_path is now a comma separated list of paths. NOTE: nodes listed as derived parameter dependencies aren't added to the path.
sans/config/hmm/detector.tcl
Use dns-name for voltage controller address.

sans/config/motors/motor_configuration.tcl
Set det home position.
SICS-122 Added FastShutter variable and configured det motor with an action object to set the FastShutter variable.
SICS-248 Replaced beamstop motor objects with beamstop action objects.

action.[ch]
The action object factory will eventuall be defined here.
SICS-122 Currently there is just a funcion which sets the FastShutter variable

beamstopaction.c
Added motion control enabled check.
Added "list" subcommand.

Makefile
Compile action.c

motor_dmc2280.c
The status check command now always checks the TI1 and TI0 interrupts.
Added action-object configuration parameter.  Call AO_istatus with TI1
if configured with an action object.

r2674 | ffr | 2008-08-13 14:16:30 +1000 (Wed, 13 Aug 2008) | 26 lines
2012-11-15 13:41:01 +11:00
Ferdi Franceschini
0749b0effa Merging release 2.0 branch with CVS trunk
r2601 | ffr | 2008-05-30 10:26:57 +1000 (Fri, 30 May 2008) | 2 lines
2012-11-15 13:38:17 +11:00
Douglas Clowes
a0684a033e cleanups and add encoder bias code
r2592 | dcl | 2008-05-29 14:52:41 +1000 (Thu, 29 May 2008) | 2 lines
2012-11-15 13:37:40 +11:00
Douglas Clowes
445a332370 Set Motor status to HWBusy in State_Unknown
Discard outstanding message response on entering State_Unknown (timing window)
Don't break if it times out while waiting
Defer various faults until motor has stopped
Rename absenc to absencoder in list command (if has encoder)
Modify absenc to report integer encoder value
Allow manager to set various sensitive values in motor debug mode
Make motor "reset" command wait until motor reinitialised (timing window)

r2520 | dcl | 2008-05-12 11:05:35 +1000 (Mon, 12 May 2008) | 9 lines
2012-11-15 13:36:53 +11:00
Douglas Clowes
f7d9d06484 implement motor "trace_switches" command
r2507 | dcl | 2008-05-08 16:47:34 +1000 (Thu, 08 May 2008) | 2 lines
2012-11-15 13:36:37 +11:00
Douglas Clowes
c7794c4092 Speed up the idle slow poll timer to make it more responsive to changes in position while idle.
r2506 | dcl | 2008-05-07 10:19:26 +1000 (Wed, 07 May 2008) | 2 lines
2012-11-15 13:36:33 +11:00
Douglas Clowes
a143b9905e Change state transition on limit switch event to ensure that motor is stopped before turning it off.
r2505 | dcl | 2008-05-07 10:14:28 +1000 (Wed, 07 May 2008) | 2 lines
2012-11-15 13:36:29 +11:00
Douglas Clowes
355cd532cf Improved logging for motion characterisation of motors.
Reject NaN and Infinity in run command.
Change error message for both limit switches active.
Check status of BG command in case it failed.

r2482 | dcl | 2008-04-24 12:08:03 +1000 (Thu, 24 Apr 2008) | 5 lines
2012-11-15 13:35:50 +11:00
Douglas Clowes
a0c6945bb6 implement settle timer on creep positioning
detect position overrun error and stop runaway motor
implement deferred fault reporting until after motor stopped
save and report timer period in debug output (DMC_SetTimer)
handle leading '-' on numeric galil response
more comment documentation
remove unused variables

r2423 | dcl | 2008-04-14 09:38:41 +1000 (Mon, 14 Apr 2008) | 8 lines
2012-11-15 13:34:44 +11:00
Douglas Clowes
04568a34f2 Bugfixes from commissioning. Use _SCx, send STx and HLTx=1. Fix missing TRACE output. Change 'has_airpads' to 'protocol'.
r2389 | dcl | 2008-03-10 08:19:23 +1100 (Mon, 10 Mar 2008) | 2 lines
2012-11-15 13:33:51 +11:00
Douglas Clowes
c97b23fbcb Fix some typos and add deferred state/event trace reporting
r2365 | dcl | 2008-02-21 14:59:25 +1100 (Thu, 21 Feb 2008) | 2 lines
2012-11-15 13:33:28 +11:00
Douglas Clowes
a095e0d6da Add 'encoderAxis' parameter so encoder can be on a different axis from the motor.
r2360 | dcl | 2008-02-18 08:22:02 +1100 (Mon, 18 Feb 2008) | 2 lines
2012-11-15 13:33:09 +11:00
Douglas Clowes
e3a9c18322 Accumulated changes including RUN and HALT command everywhere
r2298 | dcl | 2008-01-30 13:38:29 +1100 (Wed, 30 Jan 2008) | 2 lines
2012-11-15 13:32:46 +11:00
Douglas Clowes
c6ce627760 Make SEND managers only
r2288 | dcl | 2008-01-21 09:56:27 +1100 (Mon, 21 Jan 2008) | 2 lines
2012-11-15 13:32:38 +11:00
Douglas Clowes
c75e16d4bd Handle change to asyncqueue to handle binary protocols
r2271 | dcl | 2008-01-15 12:25:16 +1100 (Tue, 15 Jan 2008) | 2 lines
2012-11-15 13:31:34 +11:00
Douglas Clowes
3926e47ab5 Change floats to doubles, controller virtual motor variables, a little refactoring
r2264 | dcl | 2007-12-07 10:38:34 +1100 (Fri, 07 Dec 2007) | 2 lines
2012-11-15 13:31:08 +11:00
Douglas Clowes
2cb9e55f63 change counts and steps to integer for 31bit encoder handling
r2255 | dcl | 2007-11-09 14:08:46 +1100 (Fri, 09 Nov 2007) | 2 lines
2012-11-15 13:30:34 +11:00
Douglas Clowes
52a5be7c0d A bit of refactoring and a bug fix
r2253 | dcl | 2007-11-09 09:49:19 +1100 (Fri, 09 Nov 2007) | 2 lines
2012-11-15 13:30:26 +11:00
Ferdi Franceschini
1c181fb68f Handle INT1712 1 interrupts in MotorOn state. This can happen if you abort an operation during a posfault retry or immediately after a run/drive command.
Handle TimeOut events during Idle state.  These have been observed to occur when a scan skips a point because of a drive failure.

r2237 | ffr | 2007-11-07 15:41:21 +1100 (Wed, 07 Nov 2007) | 4 lines
2012-11-15 13:29:25 +11:00
Douglas Clowes
ebf70bfe5c Bug fixes and improved error handling, more on controller variables
r2232 | dcl | 2007-11-06 08:50:18 +1100 (Tue, 06 Nov 2007) | 2 lines
2012-11-15 13:29:07 +11:00
Douglas Clowes
9c307402cc Fix a couple of typos, reimplement thread zero checks and amplifier error checks. (Disable amplifier error checks pending controllers returning good status for all OK motors.)
r2187 | dcl | 2007-10-22 13:26:54 +1000 (Mon, 22 Oct 2007) | 2 lines
2012-11-15 13:26:20 +11:00
Douglas Clowes
a4d7cb12cc Begin migration of motor positions from encoder counts to motor units (mm/degree)
r2185 | dcl | 2007-10-17 08:36:19 +1000 (Wed, 17 Oct 2007) | 2 lines
2012-11-15 13:26:13 +11:00
Douglas Clowes
5d311bf61f A bit more rationalisation
r2183 | dcl | 2007-10-11 18:00:02 +1000 (Thu, 11 Oct 2007) | 2 lines
2012-11-15 13:26:05 +11:00