RF-Positioning-System V0.1
by Max Heinekamp
Loading...
Searching...
No Matches
RF Positioning System Documentation

Introduction

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

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.

ParameterDescriptionDefault ValueSCPI Configurable
DEVICE_MANUFACTURERManufacturer of the deviceEMESNo
DEVICE_NAMEName of the deviceRF-Positioning-SystemNo
DEVICE_VERSIONFirmware version of the device0.0.1No
DEVICE_SERIALSerial number of the device1No
SCPI_PORTPort number for SCPI server5025Yes
IP_ADDRESSDefault IP address of the device192.168.0.50Yes
MAC_ADDRESSDefault MAC address of the device{ 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }Yes
ERROR_QUEUE_SIZESize of the error queue10No
STEPS_PER_REVSteps per revolution for stepper motors200No
MOTOR1_STEP_PINPin to which the step pin of motor driver 1 is connected27No
MOTOR2_STEP_PINPin to which the step pin of motor driver 2 is connected13No
MOTOR_SERIAL_PORTSerial interface to which the stepper drivers are connectedSerial1No
R_SENSEResistance value of the current sense resistor on the stepper driver module0.11fNo
STEP_DELAYDelay between step pulses being sent in ms2No
RMS_CURRENTRMS current for stepper motors1600 mAYes
HOLD_CURRENTHold current as a fraction /32 of RMS current8Yes
MICROSTEPSMicrostepping value16Yes
SPEEDDefault speed in steps/s1000Yes
ACCELERATIONDefault acceleration in steps/s²5000Yes
Attention
FLASH::initFlashMemory will copy these values into flash memory on first boot. Any changes to the config.h file will only be applied once the SYSTem:PRESet command is executed over the SCPI interface. Simply reflashing the device will not apply the changes, as the old values are still stored in flash memory.
Note
STEP_DELAY is not applied to movement commands that use speed and acceleration parameters. This means that it is currently only used for STEPPER::step.

Connecting to the device

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.

Connecting over USB

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:

  • Baudrate: 9600
  • Data Bits: 8
  • Stop Bits: 1
  • Parity: None
  • Flow Control: None
  • Termination Character:
    (New line)
Note: PUTTY uses a carriage return (\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:

  1. Install the Arduino IDE from https://www.arduino.cc/en/software/
  2. Connect the positioning system to your computer using the USB port on the ESP32.
  3. Select the board from the drop-down menu in the upper left.
  4. Open the serial monitor from Tools → Serial Monitor.
  5. Ensure the baud rate is set to 9600 (default).
  6. Type *IDN? in the message field and send it using the enter key.
  7. If the positioning system returns a string like EMES, RF-Positioning-System, V0.0.1, #1, a successful serial connection has been established.

Connecting over Ethernet

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:

  1. Install PuTTY from https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
  2. Open PuTTY and select the "Raw" connection type.
  3. Enter the device's IP address in the "Host Name (or IP address)" field.
  4. Enter the port number (default: 5025) in the "Port" field.
  5. Leave other settings at default and click "Open".
  6. Type *IDN? in the terminal and press enter.
  7. If the device returns a string like EMES, RF-Positioning-System, V0.0.1, #1, the connection is successful.

SCPI

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.

Stepper Motors

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.