seedstpprotocol:control_using_stp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
seedstpprotocol:control_using_stp [2017/02/23 19:17] wadminseedstpprotocol:control_using_stp [2017/11/02 13:22] (current) Pedro Ramilo
Line 3: Line 3:
 All Seed Robotics products can be controlled using the Seed Robotics STP Protocol and they also have full support for the [[dynamixel:dynamixel_protocol|Dynamixel Protocol (versions 1 and 2)]]. All Seed Robotics products can be controlled using the Seed Robotics STP Protocol and they also have full support for the [[dynamixel:dynamixel_protocol|Dynamixel Protocol (versions 1 and 2)]].
  
-On this document we will focus of the STP protocol which is a simpler, lighter and easy to use approach to controlling the units.+On this documentwe will focus on the STP protocol which is a simpler, lighter and easy to use approach to controlling the units.
  
-The main advantage of the STP protocol is that you can quickly send commands to the unit and query status information using a direct Serial Connection+The main advantage of the STP protocol is that you can quickly send commands to the unit and query status information using a direct Serial Connection and text commands.
-When operating over USB, the unit creates a virtual serial port on the host computer, to which you can connect at any Baud rate, up to 10Mbps. +
-Connection can be done using any Serial terminal.+
  
 +When operating through the [[eros:settingup_usbconnection|USB Connector]], the unit creates a Virtual serial port on the host computer, to which you can connect at any Baud rate, up to 10Mbps.
 +
 +When operating via [[eros:bluetooth_module|Bluetooth]] (if installed), the unit uses the Bluetooth Serial Port Profile (SPP) to create a Virtual COMM port on the target device.\\
 +The Bluetooth interface can be used **wirelessly** with your computer and **also your smartphone**.
 ==== Introducing the STP ==== ==== Introducing the STP ====
  
-The protocol is pretty simple and straightforward and is built on the followoing foundations: +The protocol is pretty simple and straightforward and is built on the following foundations: 
-  * Each device connected to the bushas a unique ID and behaves as a "slave"+  * Each device connected to the bus has a unique ID and behaves as a "slave". The main board has also got its own ID to allow access to its functionalities.
   * Slaves are always silent and will only respond when queried by the master (host)   * Slaves are always silent and will only respond when queried by the master (host)
   * The slaves expose a Control Table, a kind of memory map, where the master can read status variables or write data to trigger actions.   * The slaves expose a Control Table, a kind of memory map, where the master can read status variables or write data to trigger actions.
Line 22: Line 24:
  
 The description of the Control Table memory positions is available for each device: The description of the Control Table memory positions is available for each device:
-  * [[dh4d:dynamixelcontroltables|Control Table for the RH4D]] +  * [[dh4d:dynamixelcontroltables|Control Table for the RH4D (Ares Architecture, units built before March 1st 2017)]] 
-  * [[rh7d:dynamixelcontroltables|Control Table for the RH7D]] +  * [[eros:dynamixelcontroltables|Control Table for the EROS Architecture (all other units and models)]]
-  * for other devices, consult the manufacturer's documentation+
  
  
Line 34: Line 35:
   * Remove the cover of the unit to reveal the micro USB connector   * Remove the cover of the unit to reveal the micro USB connector
   * Connect one end of a micro USB cable to the hand and the other end to the host computer. This will create a Virtual COMM port on the host.   * Connect one end of a micro USB cable to the hand and the other end to the host computer. This will create a Virtual COMM port on the host.
-  * Using a Serial Terminal (such as Putty or any other), connect to the Virtual Serial port. You can select any speed up to 10Mbps.+  * Using a Serial Terminal (such as [[https://www.compuphase.com/software_termite.htm|Termite]] on Windows or similar on Linux/Mac OS), connect to the Virtual Serial port. You can select any speed up to 10Mbps.
   * VERY IMPORTANT: Configure your Serial Terminal to use \n as the line terminator or the unit will not properly recognize the commands.   * VERY IMPORTANT: Configure your Serial Terminal to use \n as the line terminator or the unit will not properly recognize the commands.
  
-To connect via Bluetooth:+To connect via Bluetooth (if installed in your unit):
   * If using a portable device, scan for a device named ''SEED_[S/N]'' (where [S/N] would be your unit's serial number)   * If using a portable device, scan for a device named ''SEED_[S/N]'' (where [S/N] would be your unit's serial number)
   * If using your computer, open the Bluetooth software and scan for the same ''SEED_[S/N]'' device. Once connected the PC will create a Virtual COMM port that connects to the unit.   * If using your computer, open the Bluetooth software and scan for the same ''SEED_[S/N]'' device. Once connected the PC will create a Virtual COMM port that connects to the unit.
-  * Using a Serial Terminal (such as Putty if using your PC or any other compatible with your platform), connect to the Virtual Serial port. The Bluetooth connection operates at 115200bps.+  * Using a Serial Terminal (such as [[https://www.compuphase.com/software_termite.htm|Termite]]/ if using your PC or any other compatible with your platform), connect to the Virtual Serial port. The Bluetooth connection operates at 115200bps.
   * VERY IMPORTANT: Configure your Serial Terminal to use \n as the line terminator or the unit will not properly recognize the commands.   * VERY IMPORTANT: Configure your Serial Terminal to use \n as the line terminator or the unit will not properly recognize the commands.
  
Line 56: Line 57:
 To read and write to the control table, 4 commands are made available: ''reb'' and ''wrb'' to read and write a byte and ''rew'' and ''wrw'' to read and write a word. To read and write to the control table, 4 commands are made available: ''reb'' and ''wrb'' to read and write a byte and ''rew'' and ''wrw'' to read and write a word.
 For the complete syntax, see the Console commands for your unit: For the complete syntax, see the Console commands for your unit:
-  * [[dh4d:consolecommands|Console Commands for the RH4D (Ares architecture)]] +  * [[dh4d:consolecommands|Console Commands for the RH4D (Ares architecture: models built before March 2017))]] 
-  * [[erosfw:consolecommands|Console Commands for the Eros architecture (RH7D and future models)]]+  * [[eros:consolecommands|Console Commands for the Eros architecture (all current Seed Robotics models)]]
  
  
Line 68: Line 69:
 ''wrb 2 24 1'' ''wrb 2 24 1''
  
-Next, we write the desired Goal position (int his case 256). The goal position parameter is at Memory Position 30 and is a Word (2 byte value)+Next, we write the desired Goal position (in this case 256). The goal position parameter is at Memory Position 30 and is a Word (2 byte value)
  
 ''wrw 2 30 256'' ''wrw 2 30 256''
Line 85: Line 86:
 ==== The returned Error Bitmask ==== ==== The returned Error Bitmask ====
  
 +After sending a command, a return byte is always sent, enclosed in ''[ ]''.
 The return byte is a bitmask that contains the status of the servo. Data is returned as a decimal number that, once converted to binary can be interpreted as follows: The return byte is a bitmask that contains the status of the servo. Data is returned as a decimal number that, once converted to binary can be interpreted as follows:
  
Line 95: Line 97:
   * Bit 1: Angle error   * Bit 1: Angle error
   * Bit 0: Input Voltage Error   * Bit 0: Input Voltage Error
 +
 +IMPORTANT: in the RH2D, using the Robotis XL-320 actuators, the error bitmask is different from the above. Please refer to the RH2D documentation and Control table for the XL-320 actuators for more information.
 +
 +
 +==== Extended commands for Online Diagnostics and Maintenance ====
 +
 +The Console exposes specific command to assist in diagnosing your unit and re-configuring some of the options on the fly.
 +
 +The go-to commands for Diagnostics are ''status'' and ''about''.
 +
 +The ''restart psu'' command helps you clear overload errors in the Internal Actuators without having to reset power on the entire bus. This is done by restarting only the built-in PSU that regulates power to the internal Actuators.
 +
 +The ''setfan'' command helps you adjust the units' fan speed (on supported models) to improve thermal behaviour or reduce noise (depending on the usage scenario).
 +
 +For a **Complete list of commands**, please see the [[eros:consolecommands|List of Console Commands (for EROS architecture)]]
  
 ==== FAQ / Troubleshooting ==== ==== FAQ / Troubleshooting ====
  
-  * I get no reply when I send a command: you must terminate your commands with a ''\n''. If you are using a Serial Terminal make sure it set to use ''\n'' as a line terminator. +  * I get no reply when I send a command: you must terminate your commands with a ''\n'' (also called "Line Feed (LF)" or "Newline" in other software packages) 
-  * Sometimes I get text instead of a number in the square brackets ''[ ]'': this happens when there is a severe error that can be reported in the error mask. For example a timeout would return the textual "timeout" message.+ 
 +If you are using a Serial Terminal make sure it set to use ''\n'' as a line terminator. 
 + 
 +For example, for //Termite//, click "Settings" and under "Transmitted text", select "Append LF";\\ 
 +If using //Putty//, type Ctrl+J after typing your command, to send the "\n" character. Putty doesn't support adding "\n" automatically but pressing Ctrl+J sends a "\n" which has the same effect.\\ 
 +For any other Terminal program, please consult the instructions of the program. 
 + 
 +  * Sometimes I get text instead of a number in the square brackets ''[ ]'': this happens when there is a severe error that can be reported in the error mask. For examplea timeout would return the textual "timeout" message.
  
 ==== Conclusion ==== ==== Conclusion ====
  
-The STP Protocol is as simple as it gets. It respects the Memory Mapped design of the actuators and provides an easy to use protocol to interface with the units.+The STP Protocol is as simple as it gets. It respects the Memory Mapped design of the actuators and provides an easy-to-use protocol to interface with the units.
  
 The fact that all replies come enclosed in brackets ''[ ]'' makes it easy to parse when building your own program. The fact that all replies come enclosed in brackets ''[ ]'' makes it easy to parse when building your own program.

Copyright © 2015-2023 Seed Robotics Ltd

  • seedstpprotocol/control_using_stp.1487877475.txt.gz
  • Last modified: 2017/02/23 19:17
  • by wadmin