symetrie-hexapod 0.17.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,857 @@
1
+ import logging
2
+
3
+ from egse.decorators import dynamic_interface
4
+
5
+
6
+ _LOGGER = logging.getLogger(__name__)
7
+
8
+
9
+ class AlphaControllerInterface:
10
+ @dynamic_interface
11
+ def info(self):
12
+ """Returns basic information about the hexapod and the controller.
13
+
14
+ Returns:
15
+ a multiline response message containing the device info.
16
+ Raises:
17
+ HexapodError: when information can not be retrieved.
18
+ """
19
+ raise NotImplementedError
20
+
21
+ @dynamic_interface
22
+ def reset(self, wait=True):
23
+ """Completely resets the Hexapod hardware controller with the standard boot cycle.
24
+
25
+ Args:
26
+ wait (bool): after the reset command has been sent to the controller, wait
27
+ for 30 seconds which should complete the cycle, i.e. this command will
28
+ only return after 30 seconds.
29
+
30
+ Note:
31
+ This command is equivalent to power cycling the controller manually.
32
+
33
+ """
34
+ raise NotImplementedError
35
+
36
+ @dynamic_interface
37
+ def homing(self):
38
+ """Start the homing cycle for the Hexapod PUNA.
39
+
40
+ Homing is required before performing a control movement. Without absolute encoders,
41
+ the homing is performed with a hexapod movement until detecting the reference sensor
42
+ on each of the actuators. The Hexapod will go to a position were the sensors are
43
+ reached that signal a known calibrated position and then returns to the zero position.
44
+
45
+ Whenever a homing is performed, the method will return before the actual movement
46
+ is finished.
47
+
48
+ The homing cycle takes about two minutes to complete, but the ``homing()`` method
49
+ returns almost immediately. Therefore, to check if the homing is finished, use
50
+ the is_homing_done() method.
51
+
52
+ Returns:
53
+ 0 on success.
54
+ Raises:
55
+ HexapodError: when there is a timeout or when there is a communication error with
56
+ the hexapod.
57
+ """
58
+ raise NotImplementedError
59
+
60
+ @dynamic_interface
61
+ def set_virtual_homing(self, tx, ty, tz, rx, ry, rz):
62
+ """Starts the virtual homing cycle on the hexapod.
63
+
64
+ This command uses the position given in parameters to initialize the hexapod position.
65
+ No movements of the hexapod are performed during this homing cycle. Please note that the
66
+ position specified in parameters must match the absolute position of the Object coordinate
67
+ system in the User coordinate system (see description in the manual chapter 2 on coordinates
68
+ systems). This position correspond to the answer of the command `get_user_positions()`.
69
+ During this operation, it is important to have the same hexapod position as those defined
70
+ during the record of the position. Otherwise, the system initialization will be incorrect.
71
+
72
+ Args:
73
+ tx (float): position on the X-axis [mm]
74
+ ty (float): position on the Y-axis [mm]
75
+ tz (float): position on the Z-axis [mm]
76
+ rx (float): rotation around the X-axis [deg]
77
+ ry (float): rotation around the Y-axis [deg]
78
+ rz (float): rotation around the Z-axis [deg]
79
+
80
+ Returns:
81
+ return_code: 0 on success, -1 when ignored
82
+
83
+ Raises:
84
+ HexapodError: when the arguments do not match up, or when there is a timeout or when
85
+ there is a
86
+ socket communication error.
87
+
88
+ """
89
+ return NotImplementedError
90
+
91
+ @dynamic_interface
92
+ def stop(self):
93
+ """Stop the current motion. This command can be sent during a motion of the Hexapod.
94
+
95
+ Returns:
96
+ 0 on success.
97
+ Raises:
98
+ HexapodError: when there is a timeout or when there is a communication error with
99
+ the hexapod.
100
+ """
101
+ raise NotImplementedError
102
+
103
+ @dynamic_interface
104
+ def clear_error(self):
105
+ """Clear all errors in the controller software.
106
+
107
+ Returns:
108
+ 0 on success.
109
+ Raises:
110
+ HexapodError: when there is Time-Out or when there is a communication error with the
111
+ hexapod.
112
+ """
113
+ raise NotImplementedError
114
+
115
+ @dynamic_interface
116
+ def activate_control_loop(self):
117
+ """Activates the control loop on motors.
118
+
119
+ Returns:
120
+ 0 on success, -1 when ignored, -2 on error.
121
+ Raises:
122
+ HexapodError: when there is a timeout or when there is a communication error with
123
+ the hexapod
124
+ hardware controller.
125
+ """
126
+ raise NotImplementedError
127
+
128
+ @dynamic_interface
129
+ def deactivate_control_loop(self):
130
+ """Disables the control loop on the servo motors.
131
+
132
+ Returns:
133
+ 0 on success.
134
+ Raises:
135
+ HexapodError: when there is a timeout or when there is a communication error with
136
+ the hexapod.
137
+ """
138
+ raise NotImplementedError
139
+
140
+ @dynamic_interface
141
+ def jog(self, axis: int, inc: float) -> int:
142
+ """Perform a JOG-type movement on the specified actuator.
143
+
144
+ Note:
145
+ This is a maintenance feature.
146
+
147
+ Args:
148
+ axis (int): number of the actuator (1 to 6)
149
+ inc (float): increment to achieve in mm
150
+ Returns:
151
+ 0 on success, -1 if command was ignored due to non-compliance.
152
+ Raises:
153
+ HexapodError: when there is a timeout or when there is a communication error with
154
+ the hexapod.
155
+ """
156
+ raise NotImplementedError
157
+
158
+ @dynamic_interface
159
+ def get_debug_info(self):
160
+ """
161
+ Request debug information from the Hexapod Controller.
162
+
163
+ The method returns four values that represent the following status:
164
+
165
+ 1. ``Homing``: state of the homing
166
+ 2. ``PosRef``: state of the Position Reference command
167
+ 3. ``KinError``: error in kinematic calculation
168
+ 4. ``Panel``: Panel state
169
+
170
+ The Homing can take the following values:
171
+
172
+ ===== ==================
173
+ Value Meaning
174
+ ===== ==================
175
+ 0 Undefined
176
+ 1 Homing in progress
177
+ 2 Homing done
178
+ 3 Error
179
+ ===== ==================
180
+
181
+ The PosRef can take the following values:
182
+
183
+ ======= =====================
184
+ Value Meaning
185
+ ======= =====================
186
+ 0 Undefined
187
+ 1 Abort input error
188
+ 2 Movement in progress
189
+ 3 Position reached
190
+ 4 Error
191
+ ======= =====================
192
+
193
+ The KinError can take the following values:
194
+
195
+ ======= ===============================================
196
+ Value Meaning
197
+ ======= ===============================================
198
+ 0 none
199
+ 1 Homing not done
200
+ 2 Inverse kinematic model (MGI) – workspace
201
+ 3 Inverse kinematic model (MGI) – joint angle
202
+ 4 Forward kinematic model (MGD) – workspace
203
+ 5 Forward kinematic model (MGD) – max iteration
204
+ 6 Position calculation (PLCC) – workspace
205
+ 7 Position calculation (PLCC) – max iteration.
206
+ ======= ===============================================
207
+
208
+ The Panel status can take the following values:
209
+
210
+ ====== ===============
211
+ Index Command
212
+ ====== ===============
213
+ -2 Command error
214
+ -1 Ignored / Command not allowed
215
+ **0** **None**
216
+ 1 Homing
217
+ 2 Stop
218
+ 3 Control ON
219
+ 4 Control OFF
220
+ 10 Valid POS
221
+ 11 Move
222
+ 12 Sequence
223
+ 13 Specific POS
224
+ 15 Clear Error
225
+ **Family “Set config”**
226
+ ------------------------
227
+ 21 Config CS
228
+ 22 Config Limits_mTn
229
+ 23 Config Limits_uTo
230
+ 24 Config Limits_Enabled
231
+ 25 Config Speed
232
+ 26 Config Current
233
+ 27 Config Backlash
234
+ **Family “Get config”**
235
+ ------------------------
236
+ 31 Config CS
237
+ 32 Config Limits_mTn
238
+ 33 Config Limits_uTo
239
+ 34 Config Limits_Enabled
240
+ 35 Config Speed
241
+ 36 Config Current
242
+ 37 Config Backlash
243
+ **Family “Maintenance”**
244
+ ------------------------
245
+ 41 Jog
246
+ 50 Config Save
247
+ 51 Config Default
248
+ 52 Config Saved?
249
+ 55 Version
250
+ ====== ===============
251
+
252
+ """
253
+ raise NotImplementedError
254
+
255
+ @dynamic_interface
256
+ def configure_coordinates_systems(self, tx_u, ty_u, tz_u, rx_u, ry_u, rz_u, tx_o, ty_o, tz_o, rx_o, ry_o, rz_o):
257
+ """
258
+ Change the definition of the User Coordinate System and the Object Coordinate System.
259
+
260
+ The parameters tx_u, ty_u, tz_u, rx_u, ry_u, rz_u are used to define the user coordinate
261
+ system
262
+ relative to the Machine Coordinate System and the parameters tx_o, ty_o, tz_o, rx_o,
263
+ ry_o, rz_o
264
+ are used to define the Object Coordinate System relative to the Platform Coordinate System.
265
+
266
+ Args:
267
+ tx_u (float): translation parameter that define the user coordinate system relative
268
+ to the machine coordinate system [in mm]
269
+ ty_u (float): translation parameter that define the user coordinate system relative
270
+ to the machine coordinate system [in mm]
271
+ tz_u (float): translation parameter that define the user coordinate system relative
272
+ to the machine coordinate system [in mm]
273
+ rx_u (float): rotation parameter that define the user coordinate system relative to
274
+ the machine coordinate system [in deg]
275
+ ry_u (float): rotation parameter that define the user coordinate system relative to
276
+ the machine coordinate system [in deg]
277
+ rz_u (float): rotation parameter that define the user coordinate system relative to
278
+ the machine coordinate system [in deg]
279
+ tx_o (float): translation parameter that define the object coordinate system relative
280
+ to the platform coordinate system [in mm]
281
+ ty_o (float): translation parameter that define the object coordinate system relative
282
+ to the platform coordinate system [in mm]
283
+ tz_o (float): translation parameter that define the object coordinate system relative
284
+ to the platform coordinate system [in mm]
285
+ rx_o (float): rotation parameter that define the object coordinate system relative to the platform
286
+ coordinate system [in deg]
287
+ ry_o (float): rotation parameter that define the object coordinate system relative to the platform
288
+ coordinate system [in deg]
289
+ rz_o (float): rotation parameter that define the object coordinate system relative to the platform
290
+ coordinate system [in deg]
291
+
292
+ Returns:
293
+ 0 on success and -1 when the configuration is ignored, e.g. when password protection
294
+ is enabled.
295
+ """
296
+ raise NotImplementedError
297
+
298
+ @dynamic_interface
299
+ def get_coordinates_systems(self):
300
+ """Retrieve the definition of the User Coordinate System and the Object Coordinate System.
301
+
302
+ Returns:
303
+ tx_u, ty_u, tz_u, rx_u, ry_u, rz_u, tx_o, ty_o, tz_o, rx_o, ry_o, rz_o where the
304
+ translation \
305
+ parameters are in [mm] and the rotation parameters are in [deg].
306
+ Raises:
307
+ HexapodError: when an error occurred while trying to retrieve the information.
308
+ """
309
+ raise NotImplementedError
310
+
311
+ @dynamic_interface
312
+ def get_actuator_length(self):
313
+ """Retrieve the current length of the hexapod actuators.
314
+
315
+ Returns:
316
+ array: an array of six float values for actuator length L1 to L6 in [mm], and \
317
+ None: when an Exception was raised and logs the error message.
318
+ """
319
+ raise NotImplementedError
320
+
321
+ @dynamic_interface
322
+ def move_absolute(self, tx, ty, tz, rx, ry, rz):
323
+ """Move/define the Object Coordinate System position and orientation expressed
324
+ in the invariant user coordinate system.
325
+
326
+ The rotation centre coincides with the Object Coordinates System origin and
327
+ the movements are controlled with translation components at first (Tx, Ty, tZ)
328
+ and then the rotation components (Rx, Ry, Rz).
329
+
330
+ Args:
331
+ tx (float): position on the X-axis [mm]
332
+ ty (float): position on the Y-axis [mm]
333
+ tz (float): position on the Z-axis [mm]
334
+ rx (float): rotation around the X-axis [deg]
335
+ ry (float): rotation around the Y-axis [deg]
336
+ rz (float): rotation around the Z-axis [deg]
337
+
338
+ Returns:
339
+ return_code: 0 on success, -1 when ignored, -2 on error
340
+
341
+ Raises:
342
+ HexapodError: when the arguments do not match up, or when there is a time out or when
343
+ there is a
344
+ socket communication error.
345
+
346
+ .. note::
347
+ When the command was not successful, this method will query the
348
+ POSVALID? using the checkAbsolutePosition() and print a summary
349
+ of the error messages to the log file.
350
+
351
+ .. todo::
352
+ do we want to check if the movement is valid before actually performing
353
+ the movement?
354
+
355
+ """
356
+ raise NotImplementedError
357
+
358
+ @dynamic_interface
359
+ def move_relative_object(self, tx, ty, tz, rx, ry, rz):
360
+ """Move the object relative to its current object position and orientation.
361
+
362
+ The relative movement is expressed in the object coordinate system.
363
+
364
+ Args:
365
+ tx (float): position on the X-axis [mm]
366
+ ty (float): position on the Y-axis [mm]
367
+ tz (float): position on the Z-axis [mm]
368
+ rx (float): rotation around the X-axis [deg]
369
+ ry (float): rotation around the Y-axis [deg]
370
+ rz (float): rotation around the Z-axis [deg]
371
+
372
+ Returns:
373
+ 0 on success, -1 when ignored, -2 on error.
374
+
375
+ Raises:
376
+ HexapodError: when the arguments do not match up, or when there is a time out or when
377
+ there is a
378
+ socket communication error.
379
+
380
+ .. todo:: do we want to check if the movement is valid before actually performing
381
+ the movement?
382
+
383
+ """
384
+ raise NotImplementedError
385
+
386
+ @dynamic_interface
387
+ def move_relative_user(self, tx, ty, tz, rx, ry, rz):
388
+ """Move the object relative to its current object position and orientation.
389
+
390
+ The relative movement is expressed in the (invariant) user coordinate system.
391
+
392
+ Args:
393
+ tx (float): position on the X-axis [mm]
394
+ ty (float): position on the Y-axis [mm]
395
+ tz (float): position on the Z-axis [mm]
396
+ rx (float): rotation around the X-axis [deg]
397
+ ry (float): rotation around the Y-axis [deg]
398
+ rz (float): rotation around the Z-axis [deg]
399
+
400
+ Returns:
401
+ 0 on success, -1 when ignored, -2 on error.
402
+
403
+ Raises:
404
+ HexapodError: when the arguments do not match up, or when there is a time out or when
405
+ there is a
406
+ socket communication error.
407
+
408
+ .. todo:: do we want to check if the movement is valid before actually performing
409
+ the movement?
410
+
411
+ """
412
+ raise NotImplementedError
413
+
414
+ @dynamic_interface
415
+ def check_absolute_movement(self, tx, ty, tz, rx, ry, rz):
416
+ """Check if the requested object movement is valid.
417
+
418
+ The absolute movement is expressed in the user coordinate system.
419
+
420
+ Args:
421
+ tx (float): position on the X-axis [mm]
422
+ ty (float): position on the Y-axis [mm]
423
+ tz (float): position on the Z-axis [mm]
424
+ rx (float): rotation around the X-axis [deg]
425
+ ry (float): rotation around the Y-axis [deg]
426
+ rz (float): rotation around the Z-axis [deg]
427
+
428
+ Returns:
429
+ tuple: where the first element is an integer that represents the
430
+ bitfield encoding the errors. The second element is a dictionary
431
+ with the bit numbers that were (on) and the corresponding error
432
+ description.
433
+
434
+ .. todo:: either provide a more user friendly return value or a method/function
435
+ to process the information into a human readable form. Also update
436
+ the documentation of this method with more information about the
437
+ bitfields etc.
438
+ """
439
+ raise NotImplementedError
440
+
441
+ @dynamic_interface
442
+ def check_relative_object_movement(self, tx, ty, tz, rx, ry, rz):
443
+ """Check if the requested object movement is valid.
444
+
445
+ The relative motion is expressed in the object coordinate system.
446
+
447
+ Args:
448
+ tx (float): position on the X-axis [mm]
449
+ ty (float): position on the Y-axis [mm]
450
+ tz (float): position on the Z-axis [mm]
451
+ rx (float): rotation around the X-axis [deg]
452
+ ry (float): rotation around the Y-axis [deg]
453
+ rz (float): rotation around the Z-axis [deg]
454
+
455
+ Returns:
456
+ tuple: where the first element is an integer that represents the
457
+ bitfield encoding the errors. The second element is a dictionary
458
+ with the bit numbers that were (on) and the corresponding error
459
+ description.
460
+
461
+ .. todo:: either provide a more user friendly return value or a method/function
462
+ to process the information into a human readable form. Also update
463
+ the documentation of this method with more information about the
464
+ bitfields etc.
465
+ """
466
+ raise NotImplementedError
467
+
468
+ @dynamic_interface
469
+ def check_relative_user_movement(self, tx, ty, tz, rx, ry, rz):
470
+ """Check if the requested object movement is valid.
471
+
472
+ The relative motion is expressed in the user coordinate system.
473
+
474
+ Args:
475
+ tx (float): position on the X-axis [mm]
476
+ ty (float): position on the Y-axis [mm]
477
+ tz (float): position on the Z-axis [mm]
478
+ rx (float): rotation around the X-axis [deg]
479
+ ry (float): rotation around the Y-axis [deg]
480
+ rz (float): rotation around the Z-axis [deg]
481
+
482
+ Returns:
483
+ tuple: where the first element is an integer that represents the
484
+ bitfield encoding the errors. The second element is a dictionary
485
+ with the bit numbers that were (on) and the corresponding error
486
+ description.
487
+
488
+ .. todo:: either provide a more user friendly return value or a method/function
489
+ to process the information into a human readable form. Also update
490
+ the documentation of this method with more information about the
491
+ bitfields etc.
492
+ """
493
+ raise NotImplementedError
494
+
495
+ @dynamic_interface
496
+ def get_user_positions(self):
497
+ """Retrieve the current position of the hexapod.
498
+
499
+ The returned position corresponds to the position of the Object Coordinate System
500
+ in the User Coordinate System.
501
+
502
+ Returns:
503
+ array: an array of six float values for Tx, Ty, Tz, Rx, Ry, Rz.
504
+ None: when an Exception was raised and logs the error message.
505
+
506
+ Note: This is equivalent to the POSUSER? command.
507
+ """
508
+ raise NotImplementedError
509
+
510
+ @dynamic_interface
511
+ def get_machine_positions(self):
512
+ """Retrieve the current position of the hexapod.
513
+
514
+ The returned position corresponds to the position of the Platform Coordinate System
515
+ in the Machine Coordinate System.
516
+
517
+ Returns:
518
+ array: an array of six float values for Tx, Ty, Tz, Rx, Ry, Rz.
519
+ None: when a PMACError was raised and logs the error message.
520
+
521
+ Note: This is equivalent to the POSMACH? command.
522
+ """
523
+ raise NotImplementedError
524
+
525
+ @dynamic_interface
526
+ def set_speed(self, vt, vr):
527
+ """Set the speed of the hexapod movements.
528
+
529
+ Args:
530
+ vt (float): The translation speed, expressed in mm per second [mm/s].
531
+ vr (float): The angular speed, expressed in deg per second [deg/s].
532
+
533
+ The arguments `vt` and `vr` are automatically limited by the controller
534
+ between the minimum and maximum allowed speeds for the hexapod.
535
+ See the `getSpeed()` method to know the limits.
536
+
537
+ Returns:
538
+ 0 on success and -1 when the configuration is ignored, e.g. when password protection
539
+ is enabled.
540
+ """
541
+ raise NotImplementedError
542
+
543
+ @dynamic_interface
544
+ def get_speed(self):
545
+ """Retrieve the configuration of the movement speed.
546
+
547
+ Returns:
548
+ vt, vr, vt_min, vr_min, vt_max, vr_max
549
+
550
+ Where:
551
+ * ``vt`` is the translation speed of the hexapod in mm per second [mm/s]
552
+ * ``vr`` is the angular speed of the hexapod in deg per second [deg/s]
553
+ * ``vt_min``, ``vt_max`` are the limits for the translation speed [mm/s]
554
+ * ``vr_min``, ``vr_max`` are the limits for the angular speed [mm/s]
555
+
556
+ """
557
+ raise NotImplementedError
558
+
559
+ @dynamic_interface
560
+ def get_general_state(self):
561
+ """Retrieve general state information of the hexapod.
562
+
563
+ Returns:
564
+ tuple: where the first element is an integer where the bits represent each state, and
565
+ the second element is an array of True/False flags for each state described in
566
+ Hexapod
567
+ Controller API, section 4.5.6.
568
+
569
+ None: when an Exception was raised and logs the error message.
570
+
571
+ Note: This is equivalent to the STATE#HEXA? Command.
572
+ """
573
+ raise NotImplementedError
574
+
575
+ @dynamic_interface
576
+ def get_actuator_state(self):
577
+ """Retrieve general state information of the actuators.
578
+
579
+ For each of the six actuators, an integer value is returned that should be interpreted as a
580
+ bit field containing status bits for that actuator.
581
+
582
+ ====== ========================
583
+ Bit Function
584
+ ====== ========================
585
+ 0 In position
586
+ 1 Control loop on servo motors active
587
+ 2 Homing done
588
+ 3 Input "Home Switch"
589
+ 4 Input "Positive limit switch"
590
+ 5 Input "Negative limit switch"
591
+ 6 Brake control output
592
+ 7 Following error (warning)
593
+ 8 Following error (Fatal)
594
+ 9 Actuator out of bounds error
595
+ 10 Amplifier error
596
+ 11 Encoder error
597
+ 12 Phasing error (brushless engine only)
598
+ 13-23 Reserved
599
+ ====== ========================
600
+
601
+ Returns:
602
+ array: an array of six (6) dictionaries with True/False flags for each actuator state
603
+ as described in
604
+ Hexapod Controller API, section 4.5.5.
605
+ None: when an Exception was raised and logs the error message.
606
+
607
+ Note: This is equivalent to the STATE#ACTUATOR? Command.
608
+ """
609
+ raise NotImplementedError
610
+
611
+ @dynamic_interface
612
+ def goto_specific_position(self, pos):
613
+ """Ask to go to a specific position.
614
+
615
+ * pos=0 Zero position (jog & maintenance only!)
616
+ * pos=1 Zero position
617
+ * pos=2 Retracted position
618
+
619
+ Returns:
620
+ 0 on success, -1 when ignored.
621
+
622
+ Raises:
623
+ HexapodError: when there is Time-Out or when there is a communication error with the
624
+ hexapod controller.
625
+ """
626
+ raise NotImplementedError
627
+
628
+ @dynamic_interface
629
+ def goto_retracted_position(self):
630
+ """Ask the hexapod to go to the retracted position.
631
+
632
+ Returns:
633
+ 0 on success, -1 when ignored.
634
+
635
+ Raises:
636
+ HexapodError: when there is Time-Out or when there is a socket communication error.
637
+ """
638
+ raise NotImplementedError
639
+
640
+ @dynamic_interface
641
+ def goto_zero_position(self):
642
+ """Ask the hexapod to go to the zero position.
643
+
644
+ Returns:
645
+ 0 on success, -1 when ignored.
646
+
647
+ Raises:
648
+ HexapodError: when there is Time-Out or when there is a socket communication error.
649
+ """
650
+ raise NotImplementedError
651
+
652
+ @dynamic_interface
653
+ def is_homing_done(self):
654
+ """
655
+ Check if Homing is done. This method checks the ``Q26`` variable.
656
+ When this variable indicates 'Homing is done' it means the command has properly been
657
+ executed,
658
+ but it doesn't mean the Hexapod is in position. The hexapod might still be moving to its
659
+ zero position.
660
+
661
+ Returns:
662
+ True when the homing is done, False otherwise.
663
+ """
664
+ raise NotImplementedError
665
+
666
+ @dynamic_interface
667
+ def is_in_position(self):
668
+ """
669
+ Checks if the actuators are in position.
670
+
671
+ This method queries the Q36 variable and examines the third bit which is the 'Is
672
+ Position' bit.
673
+ This method does **not** query the actuator state variables Q30 till Q36.
674
+
675
+ Returns:
676
+ True when in position, False otherwise.
677
+ """
678
+ raise NotImplementedError
679
+
680
+ @dynamic_interface
681
+ def perform_maintenance(self, axis):
682
+ """Perform a maintenance cycle which consists of travelling the full range
683
+ on one axis corresponding to the Hexapod machine limits. The movement is
684
+ also in machine coordinate system.
685
+
686
+ The ``axis`` argument can take the following values:
687
+
688
+ * 1: movement on the X-axis
689
+ * 2: movement on the Y-axis
690
+ * 3: movement on the Z-axis
691
+ * 4: movement around the X-axis
692
+ * 5: movement around the Y-axis
693
+ * 6: movement around the Z-axis
694
+ * 10: all previous cycles chained together
695
+
696
+ Args:
697
+ axis (int): on which axis the full range movement is executed
698
+ Returns:
699
+ 0 on success, -1 when ignored for non-compliance.
700
+ Raises:
701
+ HexapodError: when there is Time-Out or when there is a socket communication error.
702
+ """
703
+ raise NotImplementedError
704
+
705
+ def log_positions(self):
706
+ """
707
+ Log the current position of the hexapod (level=INFO). The positions correspond to
708
+
709
+ * the position of the Object Coordinate System in the User Coordinate System, and
710
+ * the position of the Platform Coordinate System in the Machine Coordinate System.
711
+
712
+ """
713
+
714
+ pos = self.get_user_positions()
715
+ _LOGGER.info(
716
+ f"Object [in User] : "
717
+ f"{pos[0]:2.5f}, {pos[1]:2.5f}, {pos[2]:2.5f}, {pos[3]:2.5f}, {pos[4]:2.5f}, "
718
+ f"{pos[5]:2.5f}"
719
+ )
720
+
721
+ pos = self.get_machine_positions()
722
+ _LOGGER.info(
723
+ f"Platform [in Machine]: "
724
+ f"{pos[0]:2.5f}, {pos[1]:2.5f}, {pos[2]:2.5f}, {pos[3]:2.5f}, {pos[4]:2.5f}, "
725
+ f"{pos[5]:2.5f}"
726
+ )
727
+
728
+
729
+ class AlphaPlusControllerInterface(AlphaControllerInterface):
730
+ @dynamic_interface
731
+ def get_limits_value(self, lim):
732
+ """Three different and independent operational workspace limits are defined on the controller:
733
+ * Factory limits: are expressed in machine coordinate system limits. Those parameters cannot be modified.
734
+ * Machine coordinate system limits: they are expressed in the Machine coordinate system. It can be used to
735
+ secure the hexapod (and/or object) from its environment.
736
+ * User coordinate system limits: they are expressed in the User coordinate system. It can be used to limits
737
+ the movements of the object mounted on hexapod.
738
+
739
+ Remark: operational workspace limits must be understood as limits in terms of amplitude of movement. Those
740
+ limits are defined for each operational axis with a negative and positive value and are used in the validation
741
+ process. Position on each operational axis must be within those two values.
742
+
743
+ Args:
744
+ lim (int):
745
+ 0 = factory (GET only),
746
+ 1 = machine cs limit,
747
+ 2 = user cs limit
748
+
749
+ """
750
+ raise NotImplementedError
751
+
752
+ @dynamic_interface
753
+ def get_limits_state(self):
754
+ """Return workspace limits enable state"""
755
+ raise NotImplementedError
756
+
757
+ @dynamic_interface
758
+ def get_temperature(self):
759
+ """Return the 6xPT100 temperature sensor's value in C"""
760
+ raise NotImplementedError
761
+
762
+ @dynamic_interface
763
+ def machine_limit_enable(self, state):
764
+ """Enable or disable the machine workspace limit of the hexapod.
765
+
766
+ Remark: the factory machine coordinate system limit is always enabled to ensure the safety of the hexapod. It
767
+ cannot be disabled.
768
+
769
+ state(int):
770
+ 0 = disabled
771
+ 1 = enabled
772
+
773
+ """
774
+
775
+ raise NotImplementedError
776
+
777
+ @dynamic_interface
778
+ def machine_limit_set(self, *par):
779
+ """Sets the machine workspace limits of the hexapod. Will raise error if not all the parameters are set (see
780
+ Args definition)
781
+
782
+ Remark: operational workspace limits must be understood as limits in terms of amplitude of movement. Those limits
783
+ are defined for each operational axis with a negative and positive value and are used in the validation process.
784
+ Position on each operational axis must be within those two values.
785
+
786
+ Args:
787
+ ntx(double): negative position limit in X in mm
788
+ nty(double): negative position limit in Y in mm
789
+ ntz(double): negative position limit in Z in mm
790
+ nrx(double): negative position limit around the axis X in deg
791
+ nry(double): negative position limit around the axis Y in deg
792
+ nrz(double): negative position limit around the axis Y in deg
793
+
794
+ ptx(double): positive position limit in X in mm
795
+ pty(double): positive position limit in Y in mm
796
+ ptz(double): positive position limit in Z in mm
797
+ prx(double): positive position limit around the axis X in deg
798
+ pry(double): positive position limit around the axis Y in deg
799
+ prz(double): positive position limit around the axis Y in deg
800
+
801
+ """
802
+
803
+ raise NotImplementedError
804
+
805
+ @dynamic_interface
806
+ def user_limit_enable(self, state):
807
+ """Enable or disable the user workspace limit of the hexapod.
808
+
809
+ Remark: the factory machine coordinate system limit is always enabled to ensure the safety of the hexapod. It
810
+ cannot be disabled.
811
+
812
+ state(int):
813
+ 0 = disabled
814
+ 1 = enabled
815
+
816
+ """
817
+
818
+ raise NotImplementedError
819
+
820
+ @dynamic_interface
821
+ def user_limit_set(self, *par):
822
+ """Sets the user workspace limits of the hexapod. Will raise error if not all the parameters are set (see
823
+ Args definition)
824
+
825
+ Remark: operational workspace limits must be understood as limits in terms of amplitude of movement. Those
826
+ limits are defined for each operational axis with a negative and positive value and are used in the
827
+ validation process. Position on each operational axis must be within those two values.
828
+
829
+ Args:
830
+ ntx(double): negative position limit in X in mm
831
+ nty(double): negative position limit in Y in mm
832
+ ntz(double): negative position limit in Z in mm
833
+ nrx(double): negative position limit around the axis X in deg
834
+ nry(double): negative position limit around the axis Y in deg
835
+ nrz(double): negative position limit around the axis Y in deg
836
+
837
+ ptx(double): positive position limit in X in mm
838
+ pty(double): positive position limit in Y in mm
839
+ ptz(double): positive position limit in Z in mm
840
+ prx(double): positive position limit around the axis X in deg
841
+ pry(double): positive position limit around the axis Y in deg
842
+ prz(double): positive position limit around the axis Y in deg
843
+
844
+ """
845
+
846
+ raise NotImplementedError
847
+
848
+ @dynamic_interface
849
+ def set_default(self):
850
+ """
851
+ Restores the default configuration parameters. The command can be used to restore factory default parameters.
852
+ The restored configuration is not automatically saved. refer to the command CFG_SAVE to save the parameters in
853
+ order to keep them after a controller power off. The calculation of the hexapod position is suspended during the
854
+ command execution.
855
+ """
856
+
857
+ raise NotImplementedError