aconity module¶
-
class
aconity.Aconity(shared_cfg, aconity_cfg)¶ Bases:
objectMakes use of the API provided by Aconity to automatically start, pause and resume a build, and to change individual part parameters in real-time.
Parameters: - shared_cfg (dotmap) –
- env.n_parts (int): Number of parts to be built, not including the first n_ignore parts, which are often no recorded by the pyrometer.
- n_ignore (int): Number of parts built in addition to n_parts. Typically, the first 3 parts are not fully recorded by the pyrometer.
- ctrl_cfg.ac_lb (array of floats): Lower bounds of the build parameter in the form [speed (m/s), power (W)].
- ctrl_cfg.ac_ub (array of floats): Upper bounds of the build parameters in the form [speed (m/s), power (W)].
- comms (dotmap): Parameters for communication with other classes.
- aconity_cfg (dotmap) –
- config_name (str): Configuration name, i.e. Unheated 3D Monitoring.
- job_name (str): Job name as displayed in the AconitySTUDIO web application.
- layers (array of int): Start and end layers for the build in the form [start_layer, end_layer].
- fixed_parameters (np.array, shape N x 2): Parameters used for parts built with fixed parameters.
-
getActions()¶ Gets the parameters generated using closed-loop control, copied locally from the remote server by the Machine class.
Returns: Parameters generated using closed-loop control, with shape (parts under closed-loop control, 2) Return type: np.array
-
initAconity()¶ Creates a new connection to the AconityMINI using the job name provided.
The latest session created by the AconityStudio web application is used.
-
initialParameterSettings()¶ Sets the build parameters for those parts which use fixed parameters throughout the build.
This parameters are defined in the configuration files rather than being passed an input to this function.
-
loop()¶ While the build is unfinished, iteratively builds layers using the provided build parameters.
The initAconity() function must always be called before this function. Iterates between reading the build parameters outputted in real-time by the cluster, and using these build parameters to build individual layers.
Allows the class functionality to be conveniently used as follows:
aconity = Aconity(s_cfg, a_cfg) aconity.initAconity() aconity.loop()
-
performLayer(actions)¶ Builds a single layer using the specified input parameters.
Before the layer is started, the relevant parameters are changed according to the input array actions. Upon the completion of the layer, the build is paused.
Parameters: actions (np.array) – Input parameters to be used for the new layer, with shape (n_parts, 2)
-
pieceNumber(piece_indx, buffer)¶ 0->4, 1->7, 2->10, etc…
-
signalJobStarted()¶ Signals the Machine class that the job has been stated.
This is done by creating a folder locally in comms.dir/comms.state.rdy_name.
This prompts the Machine class to read and analyse the pyrometer data.
-
uploadConfigFiles()¶
- shared_cfg (dotmap) –
-
aconity.getExecutionScript()¶ Returns the Aconity execution script, as generated by the AconitySTUDIO web application.
For instance, the execution script for unheated monitoring is:
layer = function(){ for(p:$p){ $m.record_sensor($s[2Pyrometer],p) $m.expose(p[next;$h],$c[scanner_1]) $m.stop_record_sensor($s[2Pyrometer]) } $m.add_layer($g) } repeat(layer)Returns: Execution script as generated by the AconitySTUDIO web application. Return type: str
-
aconity.getLoginData()¶ Returns the login credentials for the Aconity machine.
Returns: Dictionary with keys rest_url, ws_url, email, and password Return type: dict