====== Newport Picomotor ====== We have implemented control of Newport Picomotor [[https://www.newport.com/f/picomotor-piezo-linear-actuators|actuator]]. The implementation is similar to the main hwserver, we wrote another server - [[https://sourceforge.net/p/gwyscope/code/HEAD/tree/peripherals/pmserver/|pmserver]] - that connects to the [[https://www.newport.com/p/8742|Newport 8742 controller]] via Ethernet and allows for getting controller's ID, setting actuator velocity and acceleration and moving the actuator. Open the ''test_client.c'' example to see how to communicate with the pmserver. The implementation was done using [[https://pylablib.readthedocs.io/en/latest/devices/Newport_picomotor.html|Picomotor device class]] provided by the PyLabLib Python package for device control and experiment automation and Python to C interface. Several packages had to be installed onto the Red Pitaya. First of all it is necessary to upgrade pip: pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --upgrade pip This upgrades pip from the installed 9.0.1 version to 20.3.4 which is the latest version that supports Python 3.5 that is part of RP's OS. Note that ''%%--%%trusted-host'' switch was necessary due to ''CERTIFICATE_VERIFY_FAILED'' error message. Now we can install PyLabLib package: pip install -U pylablib-lightweight[devio-full] This will ensure that the basic dependencies (numpy, scipy, and pandas) are installed and adds also other packages that are useful for communication to other devices (pyusb, pyserial, websocket-client, pyvisa, pylablib-lightweight, pyft232, nidaqmx). More details on the PyLabLib package installation can be found [[https://pylablib.readthedocs.io/en/latest/install.html|here]]. You can now checkout the pmserver from Sourceforge, change to the pmserver directory and compile it using provided Makefile: svn checkout https://svn.code.sf.net/p/gwyscope/code/peripherals cd peripherals/pmserver/ make In the directory, there is a simple Python script ''pico.py'' that tests if all the packages are installed correctly and tries to connect to the Picomotor controller and to print out it's ID. Note that the IP address of the controller has to be known. It can be viewed or set using [[https://www.newport.com/medias/sys_master/software/software/h4b/he7/9139939803166/PicomotorApp-2.1.5.zip|PicomotorApp]]. Note however that the software is available for Windows OS only. If testing with the pico.py utility was successful, the pmserver can be started providing port number (50101) and .ini file (hwserver_sample.ini): ./pmserver 50101 hwserver_sample.ini Note that the parameters in the .ini file need to be adjusted. For example the ''cspm'' coefficient that translates motor steps to meters may need to be changed for a given actuator.