Settings


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

Setting a division rate

A command mode is for setting the division rate of microstepping.

"set mode (division)"

You can input one of divisions to drive argument.

drive description
1 Full-step
2 Half-step
4 1/4-step
8 1/8-step
16 1/16-step
32 1/32-step
spc_request_dev($sid, "set mode 1");
spc_request_dev($sid, "set mode 2");
spc_request_dev($sid, "set mode 4");
spc_request_dev($sid, "set mode 8");
spc_request_dev($sid, "set mode 16");
spc_request_dev($sid, "set mode 32");

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-2405 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-2405 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-2405 provides 240,000[pps] as its maximum speed. However, the actual maximum speed depends on the type, voltage and loads of the stepper motor.

When you set the speed, if you put k after setting value, it is possible to perform scaling up to 1000 times. For example, 1000 and 1k mean the same value.

  • an example of setting a speed
spc_request_dev($sid, "set speed 400");
spc_request_dev($sid, "set speed 4k"); // the same result with "set speed 4000"

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-2405 provides 2,400,000[pps/s] as its maximum value.

When you set these values, if you put k after setting values, it is possible to perform scaling up to 1000 times. For example, 1000 and 1k mean the same 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 1k"); // the same result with "set accel 0 1000"
spc_request_dev($sid, "set accel 1k 2k");

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.

When you set the counter position, if you put k after setting value, it is possible to perform scaling up to 1000 times. For example, 1000 and 1k mean the same value.

  • an example of setting a counter position
spc_request_dev($sid, "set pos 400");
spc_request_dev($sid, "set pos 80k"); // the same result with "set pos 80000"

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");