Trajectories
(following #218 (closed))
On Friday, 12/01/2018 we had a meeting on how to integrate trajectories in BLISS.
Main use cases:
- virtual (pseudo) axis depending on real axes, the virtual axis defines a trajectory for the real axes
- to integrate in scans, to make scanned axis following a trajectory
- to be able to move an axis along a trajectory (outside of a scan)
Implementation proposal:
- any axis from a
CalcController
will have a.trajectory
property, that would be anAxis
-like object - user can call
axis.trajectory.move(X)
to move real motors to trajectory position X- trajectory is loaded dynamically before moving
- check if real motors are from the same controller
- real axes controller has a
.trajectory_type()
method that returns 'PV' or 'PVT', or raisesNotImplementedError
if controller does not support trajectories - trajectory is determined from
CalcController
.calc_to_real()
method- trajectory fitting: a fit has to be found to convert discrete positions to a trajectory
- something like
scipy.optimize.curve_fit
with Levenberg-Marquardt algorithm has to be used (?) - it may require a
step
/nb_points
parameter
- real axes controller has a
.trajectory_load(X)
method to load a trajectory, the expected format depends on the return of.trajectory_type()
- if real motors are outside the trajectory before move starts, an exception is raised
- check for maximum velocity: the maximum velocity on the trajectory must not exceed the current real motors velocity
- check for maximum acceleration: the maximum acceleration on the trajectory must not exceed the current real motors acceleration
- once a trajectory is loaded, it stays until
axis.trajectory.clear()
is called
- trajectory is loaded dynamically before moving
- user may prefer to load a trajectory himself first (calling
axis.controller.trajectory_load(X)
directly, before moving) - we may need a specific scan chain
AcquisitionMaster
object foraxis.trajectory
objects, otherwise as a trajectory object is anAxis
classic masters could be used (?)
NOTE: this issue represents a lot of work and is a broad topic, it can still be difficult to estimate at the moment and may need further discussion. There will be some interactive prototyping with Product Owner to establish a final tasks list.
DONE: when tests pass with real hardware in the lab ; please make as much of pytest tests as possible
Edited by Matias Guijarro