Smart Motor Devices SMSD-4.2LAN Manual

Programmable step motor controller data communications protocol
Hide thumbs Also See for SMSD-4.2LAN:
Table of Contents

Advertisement

Quick Links

SMART MOTOR DEVICES
https://smd.ee
PROGRAMMABLE STEP MOTOR
CONTROLLER SMSD-4.2LAN and SMSD-8.0LAN
Data communications protocol
Ver. 04
2019

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the SMSD-4.2LAN and is the answer not in the manual?

Questions and answers

Summary of Contents for Smart Motor Devices SMSD-4.2LAN

  • Page 1 SMART MOTOR DEVICES https://smd.ee PROGRAMMABLE STEP MOTOR CONTROLLER SMSD-4.2LAN and SMSD-8.0LAN Data communications protocol Ver. 04 2019...
  • Page 2: Table Of Contents

    Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN 1. Brief introduction. _________________________________________________________________________- 4 - 2. USB and Ethernet data communication basis __________________________________________________- 4 - 3.Default settings ____________________________________________________________________________- 4 - 4. The structure of data transfer packets ________________________________________________________- 5 - 4.1. The purpose of the XOR_SUM field _______________________________________________________- 5 - 4.2.
  • Page 3 Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN 6.21 Executing command CMD_PowerSTEP01_GO_UNTIL_F ____________________________________- 28 - 6.22 Executing command CMD_PowerSTEP01_GO_UNTIL_R ____________________________________- 28 - 6.23 Executing command CMD_PowerSTEP01_SCAN_ZERO_F __________________________________- 28 - 6.24 Executing command CMD_PowerSTEP01_SCAN_ZERO_R __________________________________- 29 - 6.25 Executing command CMD_PowerSTEP01_SCAN_LABEL_F _________________________________- 29 - 6.26 Executing command CMD_PowerSTEP01_SCAN_LABEL_R _________________________________- 29 -...
  • Page 4: Brief Introduction

    SMSD-4.2LAN and SMSD-8.0LAN 1. Brief introduction. The controller SMSD-4.2LAN (further in the text - Controller) is intended for control of stepper motors and provides programming and control via USB or Ethernet. SMSD-4.2LAN is designed as a circuit plate with electronic components, indicators, control elements, terminal blocks and connectors installed on a heat sink plate.
  • Page 5: The Structure Of Data Transfer Packets

    Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN 4. The structure of data transfer packets The data transfer packet structure is the next: typedef struct uint8_t XOR_SUM; uint8_t VER; uint8_t CMD_TYPE; uint8_t CMD_IDENTIFICATION; uint16_t LENGTH_DATA; uint8_t DATA[LENGTH_DATA]; }LAN_COMMAND_Type; XOR_SUM – checksum – low-order byte off the amount of all bytes in the packet.
  • Page 6: The Purpose Of The Cmd_Identification Field

    Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN 4.3. The purpose of the CMD_IDENTIFICATION field 1 byte field. The field CMD_IDENTIFICATION is intended for unique identification of a response to a sent command. The User should provide unique values during data transfer process.
  • Page 7: Beginning Of Data Transmission And Data Transmission Command Code_Cmd_Request

    Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN 4.6.1 Beginning of data transmission and data transmission command CODE_CMD_REQUEST The data transmission command CODE_CMD_REQUEST is used for authorizing purpose. The data transfer packet with CODE_CMD_REQUEST code is sent from the controller to the user as a response to a LAN connection event (only for LAN connection, not used for USB connection).
  • Page 8: Data Transmission Command Code_Cmd_Response

    Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN LENGTH_DATA (High byte) 0x00 DATA [0] - Low byte (COMMANDS_RETURN_DATA Low byte) DATA [1] DATA [2] = ERROR_OR_COMMAND DATA [3] DATA [4] DATA [5] DATA [6] - High byte (COMMANDS_RETURN_DATA High byte) In case of the correct password, the Controller allows the further access to the controller and...
  • Page 9: Data Transmission Command Code_Cmd_Powerstep01

    Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN 4.6.3 Data transmission command CODE_CMD_POWERSTEP01 The data transmission command CODE_CMD_POWERSTEP01 is used to control the stepper motor. Data field of the packet contains SMSD_CMD_Type structure. Please, learn detailed information about the stepper motor control commands and SMSD_CMD_Type structure below in this manual.
  • Page 10: Data Transmission Command Code_Cmd_Powerstep01_R_Mem0

    Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN quantity of the commands in a sequence – 255. The code distance in the address space is 4 bytes. Every command corresponds to SMSD_CMD_Type structure. From the User: Field Value Packet data order XOR (1 byte)
  • Page 11 Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN From the User: Field Value Packet data order XOR (1 byte) VER (1 byte) CMD_TYPE (1 byte) CODE_CMD_POWERSTEP01_R_MEM0 = 0x07 or CODE_CMD_POWERSTEP01_R_MEM1 = 0x08 or CODE_CMD_POWERSTEP01_R_MEM2 = 0x09 or CODE_CMD_POWERSTEP01_R_MEM3 = 0x0A CMD_IDENTIFICATION (1 byte)
  • Page 12: Data Transmission Command Code_Cmd_Config_Set

    Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN 4.6.6 Data transmission command CODE_CMD_CONFIG_SET The data transmission commands CODE_CMD_CONFIG_SET is intended to change LAN connection parameters of the controller. The DATA field of the packet contains LAN parameters as a SMSD_LAN_CONFIG_Type structure. From the User:...
  • Page 13: Data Transmission Command Code_Cmd_ Password_Set

    Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN LENGTH_DATA (High byte) DATA [0] (SMSD_LAN_CONFIG_Type – Low byte) ………………… …….. ……. DATA [24] (SMSD_LAN_CONFIG_Type – High byte) 4.6.8 Data transmission command CODE_CMD_ PASSWORD_SET The data transmission commands CODE_CMD_PASSWORD_SET is intended to change the authentication password.
  • Page 14: The Structure Of Commands_Return_Data_Type

    Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN From the Controller: Field Value Packet data order XOR (1 byte) VER (1 byte) CMD_TYPE (1 byte) CODE_CMD_ERROR_GET = 0x0E CMD_IDENTIFICATION (1 byte) LENGTH_DATA (Low byte) 0x44 (=17*4) LENGTH_DATA (High byte) Data[0] ………………….. …………….
  • Page 15: Possible Meanings Of The Field Error_Or_Command

    Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN typedef struct { uint16_t : 1; uint16_t BUSY : 1; uint16_t SW_F : 1; uint16_t SW_EVN : 1; uint16_t : 1; uint16_t MOT_STATUS : 2; uint16_t CMD_ERROR : 1; uint16_t RESERVE : 8; } powerSTEP_STATUS_TypeDef;...
  • Page 16 Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN typedef struct { uint32_t RESERVE uint32_t ACTION uint32_t COMMAND uint32_t DATA :22; }SMSD_CMD_Type; RESERVE – 3 bit field, not used; ACTION - 1 bit field – for internal use, send as 0; COMMAND - 6 bits field - the executing command code;...
  • Page 17: Executing Command Cmd_Powerstep01_End

    Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN 0x26 CMD_PowerSTEP01_GET_RELE, 0x27 CMD_PowerSTEP01_WAIT_IN0, 0x28 CMD_PowerSTEP01_WAIT_IN1, 0x29 CMD_PowerSTEP01_GOTO_PROGRAM, 0x2A CMD_PowerSTEP01_GOTO_PROGRAM_IF_IN0, 0x2B CMD_PowerSTEP01_GOTO_PROGRAM_IF_IN1, 0x2C CMD_PowerSTEP01_LOOP_PROGRAM, 0x2D CMD_PowerSTEP01_CALL_PROGRAM 0x2E CMD_PowerSTEP01_RETURN_PROGRAM, 0x2F CMD_PowerSTEP01_START_PROGRAM_MEM0, 0x30 CMD_PowerSTEP01_START_PROGRAM_MEM1, 0x31 CMD_PowerSTEP01_START_PROGRAM_MEM2, 0x32 CMD_PowerSTEP01_START_PROGRAM_MEM3, 0x33 CMD_PowerSTEP01_STOP_PROGRAM_MEM, 0x34 CMD_PowerSTEP01_STEP_CLOCK, 0x35 CMD_PowerSTEP01_STOP_USB, 0x36 CMD_PowerSTEP01_GET_MIN_SPEED,...
  • Page 18 Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN From the User: Field Value Packet data order XOR (1 byte) VER (1 byte) CMD_TYPE (1 byte) CODE_CMD_POWERSTEP01 = 0x02 CMD_IDENTIFICATION (1 byte) LENGTH_DATA (Low byte) 0x04 sizeof(SMSD_CMD_Type)=0x04 LENGTH_DATA (High byte) 0x00 DATA [0] (SMSD_CMD_Type Low byte)
  • Page 19 Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN 6.3 Executing command CMD_PowerSTEP01_STATUS_IN_EVENT The executing command CMD_PowerSTEP01_STATUS_IN_EVENT = 0x02 is intended for reading information about current signals inputs state. Bit mapping of the SMSD_CMD_Type structure: Byte[3] Byte[2] Byte[1] Byte[0] Bit № 7..2 Command code...
  • Page 20 Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN MOTOR_TYPE – motor type for the voltage control mode: Value Max. current Resistance Inductance per phase, per phase, per phase, Step angle Motor model SMSD-4.2LAN SMSD-8.0LAN No motor 1.33 1.33 1.68 1.65 1.68 1.64 1.68...
  • Page 21 7 - Microstepping: 1/128 WORK_CURRENT – operating current for the current control mode. The motor operation current is calculated as 0.1Amp*Value; 1<=Value<=80. Available range for controllers SMSD-4.2LAN: 1 – 42; for controllers SMSD-8.0LAN: 1 – 80. The values are the next: 1 - 0.1A...
  • Page 22 Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN STOP_CURRENT – holding current – as a percentage of an operating current: 0 - 25% 1 - 50% 2 - 75% 3 - 100% As a response the Controller sends a data transmission packet with CMD_TYPE = CODE_CMD_RESPONSE, the DATA field of the packet contains COMMANDS_RETURN_DATA_Type: ERROR_OR_COMMAND = OK.
  • Page 23: Executing Command Cmd_Powerstep01_Set_Max_Speed

    Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN As a response the Controller sends a data transmission packet with CMD_TYPE = CODE_CMD_RESPONSE, the DATA field of the packet contains COMMANDS_RETURN_DATA_Type: ERROR_OR_COMMAND = OK. 6.7 Executing command CMD_PowerSTEP01_SET_MAX_SPEED The executing command CMD_PowerSTEP01_SET_MAX_SPEED = 0x06 is intended for setting the motor maximum speed.
  • Page 24: Executing Command Cmd_Powerstep01_Set_Fs_Speed

    Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN 6.10 Executing command CMD_PowerSTEP01_SET_FS_SPEED The executing command CMD_PowerSTEP01_SET_FS_SPEED = 0x09 is intended for setting the running speed, when the motor switches to a full step mode. The DATA field should contain the speed value in range 15 –...
  • Page 25: Executing Command Cmd_Powerstep01_Get_El_Pos

    Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN Bit mapping of the SMSD_CMD_Type structure: Byte [3] Byte[2] Byte[1] Byte[0] Bit № 7..2 Command code Designation Data = 0x00 CMD_PowerSTEP01_ Action Reserve GET_ABS_POS = 0x0B Bit value As a response the Controller sends a data transmission packet with CMD_TYPE =...
  • Page 26: Executing Command Cmd_Powerstep01_Run_F

    Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN 6.15 Executing command CMD_PowerSTEP01_RUN_F The executing command CMD_PowerSTEP01_RUN_F = 0x0E is intended to start motor rotation in forward direction at designated speed. The DATA field should contain the final rotation speed value in range 15 – 15600 steps/sec.
  • Page 27: Executing Command Cmd_Powerstep01_Move_R

    Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN As a response the Controller sends a data transmission packet with CMD_TYPE = CODE_CMD_RESPONSE, the DATA field of the packet contains COMMANDS_RETURN_DATA_Type: ERROR_OR_COMMAND = OK. 6.18 Executing command CMD_PowerSTEP01_MOVE_R The executing command CMD_PowerSTEP01_MOVE_R = 0x11 is intended for motor displacement in backward direction.
  • Page 28: Executing Command Cmd_Powerstep01_Go_Until_F

    Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN Bit mapping of the SMSD_CMD_Type structure: Byte[3] Byte[2] Byte[1] Byte[0] Bit № 7..2 Command code Designation Data = Desired position CMD_PowerSTEP01_ Action Reserve GO_TO_R = 0x13 Bit value Depend on Data value As a response the Controller sends a data transmission packet with CMD_TYPE = CODE_CMD_RESPONSE, the DATA field of the packet contains COMMANDS_RETURN_DATA_Type: ERROR_OR_COMMAND = OK.
  • Page 29: Executing Command Cmd_Powerstep01_Scan_Zero_R

    Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN Bit mapping of the SMSD_CMD_Type structure: Byte[3] Byte[2] Byte[1] Byte[0] Bit № 7..2 Command code Designation Data = Motion Speed CMD_PowerSTEP01_ Action Reserve SCAN_ZERO_F = 0x16 Bit value Depend on Data value As a response the Controller sends a data transmission packet with CMD_TYPE = CODE_CMD_RESPONSE, the DATA field of the packet contains COMMANDS_RETURN_DATA_Type: ERROR_OR_COMMAND = OK.
  • Page 30: Executing Command Cmd_Powerstep01_Go_Zero

    Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN Bit mapping of the SMSD_CMD_Type structure: Byte[3] Byte[2] Byte[1] Byte[0] Bit № 7..2 Command code Designation Data = Motion Speed CMD_PowerSTEP01_ Action Reserve SCAN_LABEL_R = 0x19 Bit value Depend on Data value As a response the Controller sends a data transmission packet with CMD_TYPE = CODE_CMD_RESPONSE, the DATA field of the packet contains COMMANDS_RETURN_DATA_Type: ERROR_OR_COMMAND = OK.
  • Page 31: Executing Command Cmd_Powerstep01_Reset_Pos

    Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN Bit mapping of the SMSD_CMD_Type structure: Byte[3] Byte[2] Byte[1] Byte[0] Bit № 7..2 Command code Designation Data = specified position CMD_PowerSTEP01_GO_TO = Action Reserve 0x1C Bit value Depend on Data value As a response the Controller sends a data transmission packet with CMD_TYPE = CODE_CMD_RESPONSE, the DATA field of the packet contains COMMANDS_RETURN_DATA_Type: ERROR_OR_COMMAND = OK.
  • Page 32: Executing Command Cmd_Powerstep01_Hard_Stop

    Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN Bit mapping of the SMSD_CMD_Type structure: Byte[3] Byte[2] Byte[1] Byte[0] Bit № 7..2 Command code Designation CMD_PowerSTEP01_ Action Reserve SOFT_STOP = 0x1F Bit value As a response the Controller sends a data transmission packet with CMD_TYPE = CODE_CMD_RESPONSE, the DATA field of the packet contains COMMANDS_RETURN_DATA_Type: ERROR_OR_COMMAND = OK.
  • Page 33: Executing Command Cmd_Powerstep01_Set_Wait

    Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN Bit mapping of the SMSD_CMD_Type structure: Byte[3] Byte[2] Byte[1] Byte[0] Bit № 7..2 Command code Designation CMD_PowerSTEP01_HARD_HI_Z Action Reserve = 0x22 Bit value As a response the Controller sends a data transmission packet with CMD_TYPE = CODE_CMD_RESPONSE, the DATA field of the packet contains COMMANDS_RETURN_DATA_Type: ERROR_OR_COMMAND = OK.
  • Page 34: Executing Command Cmd_Powerstep01_Clr_Rele

    Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN 6.38 Executing command CMD_PowerSTEP01_CLR_RELE The executing command CMD_PowerSTEP01_CLR_RELE = 0x25 is intended to turn off the controller relay. Bit mapping of the SMSD_CMD_Type structure: Byte[3] Byte[2] Byte[1] Byte[0] Bit № 7..2 Command code Designation...
  • Page 35: Executing Command Cmd_Powerstep01_Goto_Program

    Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN Bit mapping of the SMSD_CMD_Type structure: Byte[3] Byte[2] Byte[1] Byte[0] Bit № 7..2 Command code Designation CMD_PowerSTEP01_WAIT_IN1= Action Reserve 0x28 Bit value As a response the Controller sends a data transmission packet with CMD_TYPE = CODE_CMD_RESPONSE, the DATA field of the packet contains COMMANDS_RETURN_DATA_Type: ERROR_OR_COMMAND = OK.
  • Page 36 Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN Bit mapping of the SMSD_CMD_Type structure: Byte[3] Byte[2] Byte[1] Byte[0] Bit № 7..2 Command code Designation Data = Command and Program numbers CMD_PowerSTEP01_ Action Reserve GOTO_PROGRAM_IF_IN0 = 0x2A Bit value Depend on Data value The Data field bit mapping: Byte[3] bits 7..0...
  • Page 37 Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN The DATA field contains the information about commands number and cycles number: bits 0..9 of the DATA field contain the commands number, bits 10..19 of the DATA field contain the cycles number. Bit mapping of the SMSD_CMD_Type structure:...
  • Page 38: Executing Command Cmd_Powerstep01_Return_Program

    Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN 6.47 Executing command CMD_PowerSTEP01_RETURN_PROGRAM The executing command CMD_PowerSTEP01_RETURN_PROGRAM = 0x2E is used to specify the end of a subprogram and to return back to the main program. If previously the command CMD_PowerSTEP01_CALL_PROGRAM was not called, the executing of CMD_PowerSTEP01_RETURN_PROGRAM will call an error.
  • Page 39: Executing Command Cmd_Powerstep01_Step_Clock

    Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN Bit mapping of the SMSD_CMD_Type structure: Byte[3] Byte[2] Byte[1] Byte[0] Bit № 7..2 Command code Designation CMD_PowerSTEP01_ Action Reserve STOP_PROGRAM_MEM = 0x33 Bit value As a response the Controller sends a data transmission packet with CMD_TYPE = CODE_CMD_RESPONSE, the DATA field of the packet contains COMMANDS_RETURN_DATA_Type: ERROR_OR_COMMAND = OK.
  • Page 40: Executing Command Cmd_Powerstep01_Get_Max_Speed

    Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN As a response the Controller sends a data transmission packet with CMD_TYPE = CODE_CMD_RESPONSE, the DATA field of the packet contains COMMANDS_RETURN_DATA_Type: ERROR_OR_COMMAND = COMMAND_GET_MIN_SPEED, RETURN_DATA – the value of the current set minimum motor speed.
  • Page 41 Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN The RETURN_DATA field bit mapping: Byte[3] bits 7..0 Byte[2] bits 7..0 Byte[1] bits 7..2 Data bit 21 20 19 18 17 16 15 Program Number Command number 6.55 Executing command CMD_PowerSTEP01_GOTO_PROGRAM_IF_ZERO The executing command CMD_PowerSTEP01_GOTO_PROGRAM_IF_ZERO = 0x39 is intended for conditional branching –...
  • Page 42: Executing Command Cmd_Powerstep01_Set_Wait_2

    Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN Bit mapping of the SMSD_CMD_Type structure: Data field DATA[3]=0x00 DATA[2]=0x00 DATA[1]=0x00 DATA[0]=0x10 byte Byte[3] Byte[2] Byte[1] Byte[0] Bit № 7..2 Command code CMD_PowerSTEP01_GOTO Designation Data = Command and Program numbers Action Reserve _PROGRAM _IF_IN_ZERO...
  • Page 43: Executing Command Cmd_Powerstep01_Scan_Mark2_F

    Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN Bit mapping of the SMSD_CMD_Type structure: Byte[3] Byte[2] Byte[1] Byte[0] Bit № 7..2 Command code CMD_PowerSTEP01_SET_ WAIT_2 Designation Data = Waiting time Action Reserve = 0x3C Bit value Depend on Data value As a response the Controller sends a data transmission packet with CMD_TYPE = CODE_CMD_RESPONSE, the DATA field of the packet contains COMMANDS_RETURN_DATA_Type: ERROR_OR_COMMAND = OK.
  • Page 44: Structure Smsd_Lan_Config_Type

    The byte 0xFE inside the packet should be replaced by the pair 0xFE 0x7E. 9. Manufacturer information Smart Motor Devices adheres to the line of continuous development and reserves the right to make changes and improvements in the design and software of the product without prior notice.

This manual is also suitable for:

Smsd-8.0lan

Table of Contents