Welcome to the API description of the ETHStepperController! If you’re looking to get started quickly, check out the getting started guide.

Set Network configuration

An HTTP PUT to [IP address]/networkConfig will update the network configuration according to the following JSON formatting :

{
  "ipAddress":"192.168.1.12",
  "gatewayIp":"192.168.1.1",
  "networkMasks":"255.255.255.0"
}
Key Value Description
ipAddress String
(”aaa.bbb.ccc.ddd”) IP address of the board. Must be a static IP address.
gatewayIp String
(”aaa.bbb.ccc.ddd”) IP address of the gateway, if applicable.
networkMasks String
(”aaa.bbb.ccc.ddd”) Network masks

Note that a change in network configuration will require a reboot of the device to take effect. An HTTP GET to [IP address]/networkConfig will return the current network configuration.

Only static IP addressing is supported, DHCP is not supported.

The example above is the default setting.

Set Control Parameters

An HTTP PUT to [IP address]/controlParameters will update the control parameters according to the following JSON formatting :

{
	"Kp":20,
	"Ki":0.1,
	"Kd":0.,
	"maxVelocity":800.9,
	"errorLimit":200
}
Key Value Description
Kp Number
(float 32 bits) Proportional gain when the controller is used in closed loop mode
Ki Number
(float 32 bits) Integral gain when the controller is used in closed loop mode
Kd Number
(float 32 bits) Derivative gain when the controller is used in closed loop mode
maxVelocity Number
(float 32 bits, must be positive) Maximum velocity for the motor, in motorSteps/s
Max value : 500000.
errorLimit Number
(16 bits unsigned integer) Define the error limit (in motorSteps), in closed loop mode, at which the device will trigger an ABORT of the motion, and publish an error message (see this section for more information)
Set it to zero to disable this feature

An HTTP GET to [IP address]/controlParameters will return the current control parameters.

Set Hardware configuration

An HTTP PUT to [IP address]/hardwareConfig with the following JSON formatting updates the hardware configuration of the board accordingly :

{
  "motorStepsPerRev":400,
  "encoderTicksPerRev":-1440
}
Key Value Description
motorStepsPerRev Number
(32 bits integer) Number of motor steps per revolution with your hardware. (Watch out, it also takes into account possible microstepping factor of the driver. For example for a motor with 200 steps/rev and a driver with a mictrostepping factor of 8, this should be equal to 1600).
Can be negative if you wish to invert the motor direction
encoderTicksPerRev Number
(32 bits integer) Number of encoder ticks per revolution. Can be negative if the motor direction and encoder direction are opposing each other.
Setting it to zero indicates no encoder is present.

If no encoder is present , then you should set hardwareConfig/encoderTicksPerRev to 0. Then, closed loop control cannot be enabled.

Motor power and control commands

Motor ON or OFF