|
RF-Positioning-System V0.1
by Max Heinekamp
|
The positioning system uses 2 stepper motors controlled by an ESP32 via SCPI over Ethernet to rotate the DUT in two axes.
The config.h file is the central configuration file for the project. It contains various parameters that can be adjusted to customize the behaviour of the positioning system. Some of these parameters are also adjustable through the SCPI interface, allowing for dynamic changes during runtime. The following table lists the parameters defined in config.h, along with a description, their default values, and whether they can be changed through the SCPI interface.
| Parameter | Description | Default Value | SCPI Configurable |
|---|---|---|---|
| DEVICE_MANUFACTURER | Manufacturer of the device | EMES | No |
| DEVICE_NAME | Name of the device | RF-Positioning-System | No |
| DEVICE_VERSION | Firmware version of the device | 0.0.1 | No |
| DEVICE_SERIAL | Serial number of the device | 1 | No |
| SCPI_PORT | Port number for SCPI server | 5025 | Yes |
| IP_ADDRESS | Default IP address of the device | 192.168.0.50 | Yes |
| MAC_ADDRESS | Default MAC address of the device | { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED } | Yes |
| ERROR_QUEUE_SIZE | Size of the error queue | 10 | No |
| STEPS_PER_REV | Steps per revolution for stepper motors | 200 | No |
| MOTOR1_STEP_PIN | Pin to which the step pin of motor driver 1 is connected | 27 | No |
| MOTOR2_STEP_PIN | Pin to which the step pin of motor driver 2 is connected | 13 | No |
| MOTOR_SERIAL_PORT | Serial interface to which the stepper drivers are connected | Serial1 | No |
| R_SENSE | Resistance value of the current sense resistor on the stepper driver module | 0.11f | No |
| STEP_DELAY | Delay between step pulses being sent in ms | 2 | No |
| RMS_CURRENT | RMS current for stepper motors | 1600 mA | Yes |
| HOLD_CURRENT | Hold current as a fraction /32 of RMS current | 8 | Yes |
| MICROSTEPS | Microstepping value | 16 | Yes |
| SPEED | Default speed in steps/s | 1000 | Yes |
| ACCELERATION | Default acceleration in steps/s² | 5000 | Yes |
The positioning system uses SCPI, a standardised command set for programmable instruments, over both Ethernet and USB interfaces. This allows for easy integration into automated test setups and compatibility with common laboratory software.
By default, the positioning system is set up to receive serial commands in the following format, enabling compatibility with tools such as the Arduino IDE's Serial Monitor:
(New line) \r) as the termination character. If you intend to use PUTTY to connect via USB, you must change the termination character in the configuration file and recompile the firmware. Using the Arduino IDE:
*IDN? in the message field and send it using the enter key. EMES, RF-Positioning-System, V0.0.1, #1, a successful serial connection has been established. Upon boot, the positioning system assigns itself a static IP address. The default is 192.168.0.50.
If a USB connection is established, the current IP address can be queried using the SYSTem:COMMunicate:ETHernet:ADDRess? command. The IP address can be changed with SYSTem:COMMunicate:ETHernet:ADDRess <ip address> (reboot required for changes to take effect).
Connecting with PuTTY:
*IDN? in the terminal and press enter. EMES, RF-Positioning-System, V0.0.1, #1, the connection is successful. The SCPI class implements the SCPI protocol for the RF Positioning System. It uses the VREKRER SCPI Parser library for parsing and handling SCPI commands. The functions which are called when SCPI commands are received are defined in the scpi_commands.h file.
The STEPPER class provides an interface for controlling the stepper motors used in the positioning system. It is based on the TMCStepper library by teemuatlut, which handles the UART communication with the TMC2209 stepper drivers.