Stopping


A command stop is for stopping a stepper motor which is in operation.

"stop [decel]"

The argument decel means deceleration.
The unit is pps/s.
If the decel is omitted, the current deceleration is used.

<?php
include_once "/lib/sd_spc.php";

spc_reset();
spc_sync_baud(115200);

$sid = 1;
spc_request_dev($sid, "set mode 4");
spc_request_dev($sid, "set vref stop 2");
spc_request_dev($sid, "set vref drive 8");
spc_request_dev($sid, "set rsnc 120 250");

// without stop command
spc_request_dev($sid, "move +800 200 200 200");
while((int)spc_request_dev($sid, "get state"))
    usleep(1);

sleep(1);

// with stop command
spc_request_dev($sid, "move +800 200 200 200");
sleep(1);
spc_request_dev($sid, "stop 200");

?>