Settings


A command set is for setting parameters which is related with controlling stepper motors.

Setting a drive mode

A command mode is for setting the drive mode.

"set mode (drive)"

You can input a drive mode to drive argument. PES-2403 provides two drive modes.

drive description
full Full-step(two phases on)
half Half-step
spc_request_dev($sid, "set mode full");
spc_request_dev($sid, "set mode half");

Current limiting

A command vref is for current limiting. This is necessary to control motors.

"set vref (state) (value)"

The argument state means one of three states which requires to set limiting current.

state description
stop the limiting current to keep the stop state
drive the limiting current to run motors
lock the limiting current to keep the lock state

The argument value means the amount of current and there are 16 levels from 0 to 15. If you set this value to 5, PES-2403 limits the current of the specific state to 5 of 15.

  • examples of setting limiting current
spc_request_dev($sid, "set vref stop 2");
spc_request_dev($sid, "set vref drive 8");
spc_request_dev($sid, "set vref lock 0");

Setting a resonance range

A command rsnc is for setting a resonance range.

"set rsnc (low_pps) (high_pps)"

The argument low_pps and high_pps mean the minimum and maximum values of the resonance range, respectively. When the resonance range is set, PES-2403 controls at the speed set in high_pps when the rotation speed falls within the resonance range.

  • an example of setting a resonance range
spc_request_dev($sid, "set rsnc 120 250");

Setting a speed

A command speed is for setting a speed. This command is available when you want to set a speed in advance of controlling your motor.

"set speed (pps)"

The argument pps means a speed. The unit of this value is pps(pulse per second) and PES-2403 provides 20,000[pps] as its maximum speed. However, the actual maximum speed depends on the type, voltage and loads of the stepper motor.

  • an example of setting a speed
spc_request_dev($sid, "set speed 400");

Setting acceleration and deceleration

A command accel is for setting acceleration and deceleration. This command is available when you want to set acceleration and deceleration in advance of controlling your motor.

"set accel (accel) [decel]"

The argument accel and decel mean the acceleration and deceleration respectively. The acceleration is a mandatory but the deceleration is an optional. If the deceleration is omitted, it is automatically set to the same value of the acceleration. The unit of both is pps/s(pps per second) and PES-2403 provides 200,000[pps/s] as its maximum value.

  • examples of setting acceleration and deceleration
spc_request_dev($sid, "set accel 1000"); // the same result with "set accel 1000 1000"
spc_request_dev($sid, "set accel 1000 0");
spc_request_dev($sid, "set accel 0 1000");

Setting a counter position

A command pos is for setting a counter position. This command is valid only when controlling stepper motor with goto and is not reflected when controlling with move.

"set pos (pos)"

The argument pos means a counter position. This value is a signed 32-bit integer and can have a value between -1000000000(1 billion) and +1000000000.

  • an example of setting a counter position
spc_request_dev($sid, "set pos 400");

Setting digital input ports

A command eio set is for setting digital input ports.

"eio set (p) mode (mode)"

The argument p means id of digital input ports and it can be set to 0, 1, 2 or 3. The argument mode means a type of the digital input port.

mode description
input normal input
lock control lock
  • examples of setting digital input ports: normal input
spc_request_dev($sid, "eio set 0 mode input");
spc_request_dev($sid, "eio set 1 mode input");
spc_request_dev($sid, "eio set 2 mode input");
spc_request_dev($sid, "eio set 3 mode input");
  • examples of setting digital input ports: control lock
spc_request_dev($sid, "eio set 0 mode lock");
spc_request_dev($sid, "eio set 1 mode lock");
spc_request_dev($sid, "eio set 2 mode lock");
spc_request_dev($sid, "eio set 3 mode lock");