Motor Module Arduino API Manual

Size: px
Start display at page:

Download "Motor Module Arduino API Manual"

Transcription

1 Motor Module Arduino API Manual Renesas Electronics Corporation

2 Revision History Rev. Date of issue 1.0 March 31, 2015 First edition 1.1 July 1, 2015 Updats controlinit(), sample programs and serial specifications. 1 / 119

3 Table of Contents 1 Quick Start Hardware Set-up Software Set-up Arduino Sample Programs... 7 Speed control sample program... 7 Angle control sample program... 8 Angle control sample program with speed limit Overview of the Control API Purpose Features of the API Definitions of Terms Operating Model Programing Procedure Sample Programs Sample program for angle control with multiple limitations Synchronization of Multiple Motors Trigger function Programming procedure Sample programs Control API Commands Software Structure Class Diagram Class List Description of Each Class Root Class Module Class Motor Cass Serial Communication Class Serial Communication Specifications Overview Applicable Communication Standards Packet Specifications Command Codes Modules Motor Modules / 119

4 5.1.1 DC Motor Module / 119

5 1 Quick Start 1.1 Hardware Set-up Table 1-1 lists the pieces of hardware to be used. Table 1-1 List of Devices To Be Used PC Arduino (UNO is recommended) Interface board Motor module DC power supply (5 to 24 V DC) USB cable I 2 C cable Power cable Figure 1-1 shows the set-up of the hardware. 1. Connect the PC and the Arduino with the USB cable. 2. Connect the interface board to the pin socket of the Arduino. 3. If the control board of the motor module and the motor are separated, connect the control board and the motor with the cable that comes with the motor module. Connect the I 2 C port (bus number 1) on the interface board and the DC motor module with the I 2 C cable. Each I 2 C port has two conectors (4 pin and 5 pin), the functionality is the same. 4. Connect the DC motor module and the power supply with the power cable. Use the power supply at 5 to 24 V. 4 / 119

6 Figure 1-1 Hardware Set-up 1.2 Software Set-up Download the Arduino library (Control.zip) from the website below. 5 / 119

7 Download Figure 1-2 Downloading the Library Select Sketch Add.ZIP Library Select the downloaded file (Control.zip) You can find Control in your library list. Figure 1-3 Installing the Library 6 / 119

8 1.3 Arduino Sample Programs Speed control sample program Shown below is a sample program that controls the speed by setting it to a constant value of 60 rpm. The setup() function performs initialization and assignment of the motor, and uses the settargetspeed command to set the speed to rotate it at a constant speed of 60 rpm. The loop() function uses the getpresentspeed command to obtain the present speed, and transfers it to the PC through serial communication. Starting up the serial monitor of the Arduino IDE displays the present rotational speed. As for rotational direction, the counterclockwise direction viewed from the load side is positive. The I 2 C address of the motor module is shown on the casing. This program uses 1 as the bus number of the motor module, and 32 as the I 2 C address. #include <Control.h> #include <Wire.h> #include <SPI.h> Sample1.ino //Includes Control.h ControlRoot root; ControlMotor motor; //Declares root class //Declares motor class void setup() { Serial.begin(9600); root.controlinit(); motor.attach(1,32); //Initializes Control API //Assigns a motor module motor.settargetspeed( 60.0 ); //Sets target rotational speed to 60rpm } void loop(){ float speed = motor.getpresentspeed(); Serial.println( speed ); //Obtains present rotational speed [rmp] 7 / 119

9 } Angle control sample program Shown below is an angle control sample program that rotates the motor 10 turns (3600 degrees). It uses the settargetangle command to set the angle to rotate it 10 turns (3600 degrees). The loop() function uses the getpresentangle command to obtain the present angle and transfers it to the PC through serial communication. Starting up the serial monitor of the Arduino IDE displays the present angle. Also, as for rotational direction, the counterclockwise direction viewed from the load side is positive. #include <Control.h> #include <Wire.h> #include <SPI.h> Sample2.ino //Includes Control.h ControlRoot root; ControlMotor motor; //Declares root class //Declares motor class void setup() { Serial.begin(9600); controlinit(); motor.attach(1,32); //Initializes Control API //Assigns a motor module motor.settargetangle( ); //Sets target angle to 3600 degree } void loop(){ float angle = motor.getpresentangle(); Serial.println( angle ); //Obtains present angle [degree] } 8 / 119

10 Angle control sample program with speed limit Shown below is a sample program that rotates the motor 10 turns at a constant speed of 60 rpm. It uses the setmaxspeed command to limit the maximum speed to 60 rpm, and uses the settargetangle command to issue an angle instruction to rotate the motor 10 turns (3600 degrees). #include <Control.h> #include <Wire.h> #include <SPI.h> Sample3.ino //Includes Control.h ControlRoot root; ControlMotor motor; //Declares root class //Declares motor class void setup() { controlinit(); motor.attach( 1, 32 ); //Initializes Control API //Assigns a motor module motor.setmaxspeed( 60.0 ); //Sets maximum speed to 60 rpm motor.settargetangle( ); //Sets target angle to 3600 degree } void loop(){ float speed = motor.getpresentspeed(); float angle = motor.getpresentangle(); //Obtains present speed[rpm] //Obtains present angle[degree] } 9 / 119

11 2 Overview of the Control API 2.1 Purpose The purpose of this API is to easily control a motor and the like. 2.2 Features of the API The features of this API are as follows: Easy-to-use and understand command system controllable with, for example, an instruction to rotate at 180 degrees Class structure to easily develop robots, etc. that use multiple modules Capable of synchronizing the operational timing of multiple muddles Inter-module serial communication protocol with a standardized command code system Available not only for Arduino and Raspberry Pi but also for devices with an I 2 C bus 2.3 Definitions of Terms API Control API PWM Module Application Programming Interface. This API. It can easily control modules such as a motor and a sensor. Pulse Width Modulation. Physical or logical unit controlled by this API. Most generally, one motor is treated as one physical module, but a group of multiple modules can be treated as a logical module. One I 2 C address is allocated to one physical module. 2.4 Operating Model The control software implemented in the control board of the motor module and the API that executes the software allow you to easily control the motor using simple commands. This section explains how to use commands, using the operating model of the motor module in Figure 2-1. The motor module controls the motor according to register values: the internal target values (Target Value (Active)) and the maximum values (Max Value (Active)). You can control the motor by using the Control API to change these register values. The information on the state of the motor, such as speed and angle, is always updated in the registers for 10 / 119

12 present values (Present Value), and you can find out the state of the motor by obtaining these values through the Control API. Figure 2-1 Operating Model of the Motor Module Any one of the following can be specified as a target value (Target Value (Active)) to control the motor module: angle, rotational speed, torque, current, voltage, and PWM duty ratio. For example, a 3600-degree rotation (10 turns) is immediately performed by using the settargetangle(3600) command to specify the target angle, as shown in Figure 2-2. You can obtain the following as the present values (Present Value) of the motor module: angle, rotational speed, torque, current, voltage, and PWM duty ratio. For example, to obtain the present angle and the present speed, use the getpresentangle command and the setpresentspeed command, respectively. As for the rotational direction of the motor, the counterclockwise direction viewed from the load side is positive, as shown in Figure 2-3 (CCW: counter-clockwise). 11 / 119

13 Figure 2-2 Timing Chart of Angle Control Figure 2-3 Rotational Direction of the Motor When any one of the following is specified as a target value, other target values are ignored or automatically calculated: angle, speed, acceleration, torque, current, voltage, and PWM duty ratio. For example, if a target angle is set, as shown with a dotted line in the lower part of Figure 2-2, a target speed is automatically calculated according to the difference between the target angle and the present angle. Within the module, target values are automatically calculated in the following order: target angle, target speed, target torque, target current, target voltage, and duty ratio. Also, if a target speed is set, a target value for angle is ignored, and target values are automatically calculated in the following order: target speed, target torque, target current, target voltage, and duty ratio. Also, you can limit the maximum of each target value to control operation. For example, in order to rotate the motor 3600 degrees (10 turns) at 60 rpm, use the setmaxspeed(60) command to limit the maximum of the rotational speed to 60 rpm, and then use the settargetangle(3600) command to perform a 3600-dgree (10-turn) rotation. In this case, the target rotational speed automatically calculated from the difference between the target angle and the present angle will become more than 60 rpm, but rotation will be performed at 60 rpm for a while because the maximum speed is limited to 60 rpm, as shown with a solid line in the lower part of Figure 2-4. Then, when the target rotational speed automatically 12 / 119

14 calculated from the difference between the target angle and the present angle becomes less than 60 rpm, the motor is controlled so that it rotates at that rotational speed. Immediately after a target value is set by using a settarget command, the motor starts rotating; therefore, a setmax command to limit a maximum value must be executed before a settarget command to set a target value. By using setmax commands, you can limit multiple target values. For example, it is possible to limit both the maximum speed and the maximum torque. Figure 2-4 Timing Chart of Control with Limitation 2.5 Programing Procedure Figure 2-5 shows a typical procedure for programming with the Control API. First, use the controlinit command to initialize communication functions, etc. Then, use the motor.attach command to assign the module. These are initialization and initial setting and must be performed only once. After that, use setmax and settarget commands to specify maximum values and target values to control operation. Also, you can obtain the present values of the motor by using getpresent commands. 13 / 119

15 Figure 2-5 Programming Procedure 14 / 119

16 2.6 Sample Programs Sample program for angle control with multiple limitations Shown below is a sample program that rotates the motor 90 degrees at a current of 2A or less, an effective voltage of 10V or less, and a speed of 60 rpm or less. #include <Control.h> #include <Wire.h> #include <SPI.h> Sample4.ino //Includes Control.h ControlRoot root; ControlMotor motor; //Declares root class //Declares motor class void setup() { root.controlinit(); motor.attach( 1, 32 ); //Initializes Control API //Assigns a motor module motor.setmaxspeed( 60.0 ); motor.setmaxcurrent( 2.0 ); motor.setmaxvoltage( 10.0 ); motor.setangledeadband( 10.0 ); motor.settargetangle( 90.0 ); //Sets maximum rotational speed to 60 rpm //Sets maximum current to 2 A //Sets maximum voltage to 10 V //Sets deadband angle to 10 degree //Sets target angle to 90 degree } void loop(){ float speed = motor.getpresentspeed(); //Obtains present speed[rmp] float angle = motor.getpresentangle(); //Obtains present angle[degree] } 15 / 119

17 2.7 Synchronization of Multiple Motors Trigger function When controlling multiple modules, you may need to synchronize them. For example, to move forward a two-wheel robot that has a separate motor for each of the left and right wheels, the motors for the left and right wheels must start rotating simultaneously; otherwise, the robot cannot move in a straight line. In order to synchronize the operational timing of multiple modules, this API has the function of using a trigger to enable a reserved command. While it is possible to immediately set a target value or a maximum value for the motor, it is also possible to delay the setting of values until a trigger is received. Also, present values of the motor, such as angle, speed, torque, current, and voltage, can be read not only immediately, but also one by one from registers after they are temporarily stored in the registers when a trigger is received. Programming procedure Figure 2-6 shows a program procedure to synchronize operations of multiple motors by using a trigger. First, use the controliinit command and the motor.attach command to perform initialization. Then, execute setmax and settarget commands with a trigger ID specified as an argument. If a trigger ID is specified, the target value or the maximum value is not immediately applied and is temporarily stored in a register as a reserved value shown in Figure 2-1 (Max Value (Reserved) or Target Value (Reserved)). Then, when the said trigger ID is made effective by using the controglobaltrigger command, the reserved target value or maximum value is applied simultaneously to control. The capturepresentvalues command stores, in a register, a snapshot of present values, such as angle, rotational speed, torque, current, and voltage. After the capturepresentvalues command is executed with a trigger ID specified, the latest values (Present Value) are stored in registers (Captured Value) at the moment when the controglobaltrigger command is used to make the said trigger ID effective. Then, the values stored in the registers (Captured Value) can be obtained by using the getpresent command with its argument set to / 119

18 Figure 2-6 Program Procedure to Move Multiple Motors Simultaneously Figure 2-7 shows timing charts of the following cases: immediately starting the two motor modules without using a trigger; and starting them simultaneously by using a trigger. If motor1.settargetangle(90) and motor2.settargetangle(90) are executed in this order, the motors start separately at the same interval that separates the transfers of the commands. motor1. Meanwhile, if motor1.settargetangle(90,1), motor2.settargetangle(90,1), and controlglobaltrigger(1) are executed in this order, the settings of the motors are enabled simultaneously when the trigger command is received, so that the two motors can start at the same time. 17 / 119

19 Figure 2-7 Timing Charts of Immediate Operation and Triggered Operation Sample programs Sample program that starts multiple motors simultaneously Shown below is a program that simultaneously rotates two motors 200 degrees. The program specifies settings separately for motor1 and motor2, and then applies the settings simultaneously when issuing the controlglobaltrigger command. [Note] The trigger feature is implemented only for busnumber / 119

20 #include <Control.h> #include <Wire.h> #include <SPI.h> Trigger.ino //Includes Control.h ControlRoot root; ControlMotor motor1,motor2; //Declares root class //Declares motor class void setup() { root.controlinit(); motor1.attach( 2, 32 ); motor2.attach( 2, 40 ); //Initializes Control API //Assigns two motor modules motor1.settargetangle( 200.0, 1); motor2.settargetangle( 200.0, 1); root.controlglobaltrigger(1); //Sets target angle to 200 degree //Waits for trigger (ID=1) //Issues trigger (ID=1) } void loop(){ float angle1 = motor1.getpresentangle(); //Obtains present angle[degree] float angle2 = motor2.getpresentangle(); } Sample program that obtains the states of multiple motors at the same time point Shown below is a program that obtains the angles of two motors at the same time point. The program causes the motors to transfer their respective present values (Present Value) to registers (Captured Value) when issuing the controlglobaltrigger command, so as to retain the values given at the same time point. Then, it uses the getpresentangle commands with their arguments set to 1 to read the values of the registers (Captured Value) one by one. 19 / 119

21 #include <Control.h> #include <Wire.h> #include <SPI.h> Capture.ino //Includes Control.h ControlRoot root; ControlMotor motor1,motor2; //Declares root class //Declares motor class void setup() { root.controlinit(); motor1.attach( 2, 32 ); motor2.attach( 2, 40 ); //Initializes Control API //Assigns two motor modules motor1.settargetangle( ); motor2.settargetangle( ); //Sets target angle } void loop(){ motor1.capturepresentvalues( 1 ); motor2.capturepresentvalues( 1 ); control.controlglobaltrigger( 1 ); //Sets triggerid for capturing //Trigger float angle1 = motor1.getpresentangle( 1 ); float angle2 = motor2.getpresentangle( 1 ); //Obtains captured angle[degree] } 20 / 119

22 3 Control API Commands This section describes the commands of the Control API. 3.1 Software Structure Figure 3-1 shows the software structure of the Control API. The Control API has a low level API for serial communication with modules via the interface board, in addition to APIs that allow easy control of motors and sensors. Figure 3-1 Sofware Structure 3.2 Class Diagram Figure 3-2 shows a class diagram of the Control API. The Motor module class and the Sensor module class, each of which consists of commands specific to each module, are inherited by the Module class, which consists of commands common to modules; also, the Module class is inherited by the Serial Communication class, which establishes communication with modules. Moreover, the Root class and the Composite Module class are available as a class for summarizing multiple module classes; the Root class consists of commands, such as for initialization of the Arduino and peripheral functions of the interface board and for triggers to all modules, and the Composite Module class consists of commands common to modules consisting of multiple motors such as a robot. A class for each 21 / 119

23 application such as a two-wheel robot and a drone is inherited by the Composite Module class. Figure 3-2 Class Diagram 3.3 Class List Table 3-1 lists the classes. Class Root Module Motor Sensor Table 3-1 Class List Description Class consisting of commands for initialization, triggers, etc. Class consisting of commands common to modules Class consisting of commands to motors Class consisting of commands to sensors 22 / 119

24 Battery Serial Communication Composite Module Class consisting of commands to a battery Class consisting of commands for communication with modules Class consisting of common commands for operating multiple modules 3.4 Description of Each Class Root Class The Root class consists of commands, such as for initialization of communication functions of the Arduino and the interface board and for triggers to all modules. Table 3-2 List of the Root Class Methods Method Description uint8_t controlinit( uint8_t mode=0 ) Initializes the Arduino and peripheral functions of the interface board uint8_t controlglobalreset( void ) Resets all modules uint8_t controlglobaltrigger( uint8_t Issues a trigger tiggerid=0 ) uint8_t controlemergencystop( void ) Brings all modules to an abrupt stop Methods controlinit uint8_t controlinit( uint8_t mode ) Initializes communication functions of the Arduino and the interface board. Parameters mode : Initialization mode 0(default): Initializes I 2 C and SPI ports. 1: Initializes I 2 C ports. 2: Initializes SPI ports. 23 / 119

25 0: Execution succeeded 1: Execution failed controlglobaltrigger uint8_t controlglobaltrigger( int8 tiggerid=0 ) Issues a trigger to all modules. Parameters triggerid : The number of the trigger to be issued (1 to 7) 0: Execution succeeded 1: Execution failed controlglobalreset uint8_t controlglobalreset( void ) Resets all modules. 0: Execution succeeded 1: Execution failed controlemergencystop uint8_t controlemergencystop( void ) Brings all modules to an abrupt stop. 0: Execution succeeded 1: Execution failed 24 / 119

26 3.4.2 Module Class The Module class consists of commands common to modules, such as for reset and module ID acquisition. Table 3-3 List of Member Variables of the Module Class Type Variable Name Description uint8 busnumber Bus number uint8 address Module address on a bus Subaddress within the module uint8 subaddress (e.g., for controlling two motors with one microcontroller) int8 statusflag Status flag Table 3-4 List of the Methods of the Module Class Category Method Name Description uint8_t attach(uint8 busnumber, uint8 address, uint8 subaddress=0) Assigns a module Assignment uint8_t isattached( void ) Confirms the assignment of the module uint8_t detach( void ) Cancels the assignment of the module uint8_t ping( void ) Checks response Status check uint8_t getstatusflag( void ) Reads the status flag uint8_t geterrorcode( void ) Reads the error code uint8_t reboot( void ) Performs reboot Reset Reads factory default uint8_t factoryreset( void ) parameter settings uint8_t settimeoutlimit(uint8 milisecond) Sets the communication timeout time Communication Reads the communication uint8_t gettimeoutlimit( void ) setting timeout time uint8_t changeaddress( uint8_t newaddress) Changes the module address 25 / 119

27 Module information LED uint8_t getmoduletype(char *data) uint8_t getmodelid(char *data) uint8_t getfirmwareversion(char *data) uint8_t getserialid(char *data) uint8_t setled(uint8_t value) uint8_t getled( void ) Reads information on the module type Reads the model ID Reads the firmware version information Reads the serial ID Operates the LED Reads the state of the LED Member variables busnumber Bus number. Table 3-5 Bus number Value Meaning 0 Arduino I 2 C bus 1 Interface board I 2 C bus number #1 2 Interface board I 2 C bus number #2 3 Interface board I 2 C bus number #3 4 Interface board I 2 C bus number #4 5 Interface board RS485 bus address Module address on a bus (I 2 C address if the module is connected to an I 2 C bus) subaddress Subaddress within the module. 26 / 119

28 One motor in a module Address=10 Two or more motors in a module Address=10 SubAddress=1 I 2 C Cable I 2 C Cable Motor Module SubAddress=2 Motor Module Figure 3-3 Subaddress statusflag Flag indicating the status of the module Bit Position 1st bit 2nd bit 3rd bit 4th bit 5th bit 6th bit 7th bit 8th bit Table 3-6 Module Status Flag Meaning Whether or not there is a response from the module Ack/Nack Whether commands are valid or invalid Whether arguments are valid or not Whether or not there is an error Whether or not target values have been reached etc., to be determined Methods Assignment Attach uint8_t attach( uint8_t busnumber, uint8_t address, uint8_t subaddress ) 27 / 119

29 Assigns a module. Parameters busnumber : Bus number (Refer to Table 3-5) address : I 2 C address subaddress : Subaddress within the module 0: Execution succeeded 1: Execution failed isatached uint8_t isattached( void ) Confirms the assignment of the module. 0: Not assigned 1: Assigned detach uint8_t detach( void ) Cancels the assignment of the module. 0: Execution succeeded 1: Execution failed Status check ping uint8_t ping( void ) Checks a response. 0: Execution succeeded 1: Execution failed getstatusflag uint8_t getstatusflag( void ) 28 / 119

30 Obtains the status flag of the module. Status flag (Refer to Table 3-6) geterrorcode uint8_t geterrorcode( void ) Obtains the error code. Error number Reset reboot uint8_t reboot( void ) Reboots the module (reset). 0: Execution succeeded 1: Execution failed factroryreset uint8_t factoryreset( void ) the internal module parameters to the factory default settings. 0: Execution succeeded 1: Execution failed Communication setting settimeoutlimit uint8_t settimeoutlimit( uint8 milisecond ) Sets the communication timeout time. If there is a failure to receive data from the master side within the specified timeout time, the 29 / 119

31 motor will be stopped. Parameters millisecond : Timeout time (ms) 0: Execution succeeded 1: Execution failed gettimeoutlimit uint8_t gettimeoutlimit( void ) Reads the communication timeout time. Timeout time (ms) changeaddress uint8_t changeaddress( uint8_t newaddress ) Changes the module address. Parameters newaddress : Module address 0: Execution succeeded 1: Execution failed Module information getmoduletype uint8_t getmoduletype( char *data ) Reads information on the module type such as motor and sensor. Parameters *data : Pointer to the location where the module type is stored 30 / 119

32 0: Execution succeeded 1: Execution failed getmodelid uint8_t getmodelid( char *data ) Reads the model ID. Parameters *data : Pointer to the location where the model ID is stored 0: Execution succeeded 1: Execution failed getserialid uint8_t getserialid( char *data ) Reads the serial ID. Parameters *data : Pointer to the location where the serial ID is stored 0: Execution succeeded 1: Execution failed getfirmwareversion uint8_t getfirmwareversion( char *data ) Reads the firmware version information. Parameters *data : Pointer to the location where the firmware version is stored. 0: Execution succeeded 1: Execution failed LED 31 / 119

33 setled uint8_t setled(uint8_t value) Turns on and off and blinks the LED. Parameters value : LED status 0: Off, 1: On, 2: Blink, 255: Module default operation 0: Execution succeeded 1: Execution failed getled uint8_t getled( void ) Reads the LED status. LED status 0: Off, 1: On, 2: Blink, 255: Module default operation 32 / 119

34 3.4.3 Motor Cass The Motor class consists of commands for operating a motor. Table 3-7 List of the Methods of the Motor Class Category Method Name Description uint8_t settargetangle(float angle, int triggerid=0) Sets the absolute target angle uint8_t addtargetangle(float angle, int triggerid=0) Sets the relative target angle float gettargetangle(int fromreserved=0) Reads the target angle float getpresentangle(int fromcapture=0) Reads the present angle uint8_t resetangle( float angle=0 ) Initializes the present angle to the value of the parameter angle uint8_t setmaxangle(float angle, int triggerid=0) Sets the maximum angle in the rotational range float getmaxangle( void ) Reads the maximum angle Angle control uint8_t setminangle(float angle, int triggerid=0) Sets the minimum angle in the rotational range float getminangle( void ) Reads the minimum angle uint8_t setangletospeedgainp( float gain ) Adjusts the proportional gain for angle control float getangletospeedgainp( void ) Reads the proportional gain for angle control uint8_t setangletospeedgaini( float gain ) Adjusts the integral gain for angle control float getangletospeedgaini( void ) Adjusts the integral gain for angle control uint8_t setangletospeedgaind( float gain ) Adjusts the derivative gain for angle control float getangletospeedgaind( void ) Adjusts the derivative gain for angle control 33 / 119

35 Speed control uint8_t setangledeadband(float angle) float getangledeadband( void ) uint8_t setanglepunch( float angle ) float getanglepunch( void ) uint8_t settargetspeed(float speedrpm, int triggerid=0) float gettargetspeed(int fromreserved=0) float getpresentspeed(int fromcapture=0) uint8_t setmaxspeed(float speedrpm, int triggerid=0) float getmaxspeed( void ) uint8_t setmaxacceleration(float AccelerationRPM/s, int triggerid=0) float getmaxacceleration( void ) uint8_t setspeedtotorquegainp( float gain ) float getspeedtotorquegainp( void ) uint8_t setspeedtotorquegaini( float gain ) Adjusts the deadband (compliance margin) for angle control Reads the dead band (compliance margin) for angle control Adjusts the punch for angle control (based on the input angle) Reads the punch for angle control (based on the input angle) Sets the target speed Reads the target speed Reads the present speed Sets the maximum speed (speed limit) Reads the maximum speed (speed limit) Sets the maximum acceleration (acceleration limit) Reads the maximum acceleration (acceleration limit) Adjusts the proportional gain for speed control Reads the proportional gain for speed control Adjusts the integral gain for speed control 34 / 119

36 Torque control Current control float getspeedtotorquegaini( void ) uint8_t setspeedtotorquegaind( float gain ) float getspeedtotorquegaind( void ) uint8_t settargettorque(float TorqueNm, int triggerid=0) float gettargettorque(int fromreserved=0) float getpresenttorque(int fromcapture=0) uint8_t setmaxtorque(float TorqueNm, int triggerid=0) float getmaxtorque( void ) uint8_t setkt( float gain ) float getkt( void ) uint8_t settargetcurrent(float current, int triggerid=0) float gettargetcurrent(int fromreserved=0) float getpresentcurrent(int fromcaptured=0) uint8_t setmaxcurrent(float current, int triggerid=0) uint8_t setmaxcurrent( void ) uint8_t setcurrenttovoltagegainp( float gain ) float getcurrenttovoltagegainp( void ) Reads the integral gain for speed control Adjusts the derivative gain for speed control Reads the derivative gain for speed control Sets the target torque Reads the target angle Reads the present torque Sets the maximum torque (torque limit) Reads the maximum torque (torque limit) Adjusts the torque constant (KT[N m/a]) Reads the torque constant (KT[N m/a]) Sets the target current Reads the target current Reads the present current Sets the maximum current (current limit) Reads the maximum current (current limit) Adjusts the proportional gain for current control Reads the proportional gain for current control 35 / 119

37 Voltage control uint8_t setcurrenttovoltagegaini( float gain ) float getcurrenttovoltagegaini( void ) uint8_t setcurrenttovoltagegaind( float gain ) float getcurrenttovoltagegaind( void ) uint8_t setinductance(float inductance) float getinductance( void ) uint8_t setresistance(float resistance) float getresistance( void ) uint8_t settargetvoltage(float voltage, int triggerid=0) float gettargetvoltage(int fromreserved=0) float getpresentvoltage(int fromcaptured=0) uint8_t setmaxvoltage(float voltage, int triggerid=0) float getmaxvoltage( void ) uint8_t setkv(float KV) float getkv( void ) float getsupplyvoltage( void ) Adjusts the integral gain for current control Reads the integral gain for current control Adjusts the derivative gain for current control Reads the derivative gain for current control Sets the motor inductance Reads the motor inductance Sets the motor DC resistance Reads the motor DC resistance Sets the target voltage Reads the target voltage Reads the present effective voltage Sets the maximum effective voltage (effective voltage limit) Reads the maximum effective voltage (effective voltage limit) Sets the back-emf coefficient (KV value: [rpm/v]) Reads the back-emf coefficient (KV value: [rpm/v]) Reads the supply voltage (bus-line voltage) 36 / 119

38 PWM control Trigger Collective read and write Rotational direction setting Enable/disable Temperature uint8_t settargetduty(float duty, int triggerid=0) Sets the target duty ratio float gettargetduty(int fromreserved=0) Reads the target duty ratio float getpresentduty(int fromcaptured=0) Reads the present duty ratio uint8_t setmaxduty(float duty, int triggerid=0) Sets the maximum duty ratio (duty ratio limit) float getmaxduty( void ) Reads the maximum duty ratio (duty ratio limit) uint8_t enabletrigger( void ) Enables triggers uint8_t disabletrigger( void ) Disables triggers (Ignores all trigger) Schedules a collective capture of variables. uint8_t capturepresentvalues(int Captured values are triggerid) transferred to registers when a trigger is detected. uint8_t setmaxvalues(float anglemax, float anglemin, float speed, float Collectively sets maximum torque, float current, float voltage, float values duty, int triggerid=0) float getpresetvalues(float *data, int Collectively reads present fromcaptured=0) values uint8_t Sets the positive rotational setpositiveangledirection(boolean direction direction) getpositiveangledirection( void ) Reads the positive rotational direction uint8_t enablefeedbackcontrol( void ) Enables feedback control uint8_t disablefeedbackcontrol( void ) Disables feedback control uint8_t settemperaturelimit(int8 temp) Sets the temperature limit float gettemperaturelimit( void ) Reads the temperature limit float getpresenttemperature( void ) Reads the temperature (present value) 37 / 119

39 Module information float getabsmaxratedangle( void ) float getabsminratedangle( void ) float getangleresolution( void ) float getabsmaxratedrotationspeed( void ) float getabsmaxratedcurrent( void ) float getabsmaxratedvoltage( void ) Reads the absolute maximum rated angle Reads the absolute minimum rated angle Reads the resolution for angle control Reads the absolute maximum rated speed Reads the absolute maximum rated current Reads the absolute maximum rated voltage Methods Angle control In angle control, the motor angle can be set to an arbitrary value. For angle control, use the settargetangle command or the addtargetangle command to set the target angle for the motor. The motor module automatically calculates the target angle, the target speed, the target torque, the target current, the target voltage, and the duty ratio in this order according to the difference between target values and present values, as shown in Figure 3-4. For example, if the target angle is set, the target speed is automatically calculated according to the difference between the target angle and the present angle, as shown with a dotted line in the upper part of Figure 3-5. Within the module, target values are automatically calculated in the following order: target angle, target speed, target torque, target current, target voltage, and duty ratio. You can also limit the maximum of each target value to control operation. For example, in order to rotate the motor 3600 degrees (10 turns) at 60 rpm or less, use the setmaxspeed(60) command to limit the maximum of the rotational speed to 60 rpm, and then use settargetangle(3600) command to perform a 3600-dgree (10-turn) rotation. In this case, the target rotational speed automatically calculated from the difference between the target angle and the present angle will become more than 60 rpm, but rotation will be performed at 60 rpm for a while because the maximum speed is limited to 60 rpm, as shown with a solid line in the lower part of Figure 3-5. Then, when the target rotational speed automatically calculated from the difference between the target angle and the present angle becomes less 38 / 119

40 than 60 rpm, the motor is controlled so that it rotates at that rotational speed. Immediately after a target value is set by using a settarget command, the motor starts rotating; therefore, a setmax command to limit a maximum value must be executed before a settarget command to set a target value. By using setmax commands, you can limit multiple target values. For example, it is possible to limit both the maximum speed and the maximum torque. Figure 3-4 Calculation of Target Values for Angle Control 39 / 119

41 Figure 3-5 Timing Chart of Angle Control Figure 3-6 shows the error between the target angle and the present angle, and the offset for the target speed. The acceptable range of the stop position of the motor is specified using the deadband value. If the present value is within the range selected as the deadband for the target position, then it is determined that the target position has been reached, and the motor is stopped. The offset for the target speed to be used when the present value is outside the deadband is specified using the punch value. Optimizing this value allows improvement of convergence of control. 40 / 119

42 Figure 3-6 The Error between the Target and Present Angles and the Offset for the Target Speed Figure 3-7 and Figure 3-8 show transfer functions for angle control and commands effective in angle control. 41 / 119

43 Figure 3-7 Transfer Functions for Angle Control and Effective set Commands 42 / 119

44 Figure 3-8 Transfer Functions for Angle Control and Effective get Commands 43 / 119

45 settargetangle uint8_t settargetangle( float angle, int triggerid=0 ) Sets the absolute target angle assuming that the angle given at the time of start-up is zero. Parameters angle triggerid : Absolute target angle [degree] : Trigger ID If this parameter is 0, the command is immediately executed; otherwise, it waits until a trigger command is issued. It is executed when the same trigger ID is issued with a trigger command. If this parameter is omitted, the trigger ID becomes 0. 0: Execution succeeded 1: Execution failed addtargetangle uint8_t addtargetangle( float angle, int triggerid=0 ) Sets the target angle relative to the present angle. Parameters angle triggerid : Relative target angle [degree] : Trigger ID If this parameter is 0, the command is immediately executed; otherwise, it waits until a trigger command is issued. It is executed when the same trigger ID is issued with a trigger command. If this parameter is omitted, the trigger ID becomes 0. 0: Execution succeeded 1: Execution failed gettargetangle float gettargetangle( boolean fromreserved=0 ) Reads the target angle. Parameters 44 / 119

46 fromreserved : Flag for reading from the reserved register (Target Value (Reserved)) If this parameter is 0, the target value (Target Value) is read. If 1, the reserved register (Target Value (Reserved)) is read. If omitted, 0 is assigned. Target angle [degree] getpresentangle float getpresentangle( boolean fromcaptured=0 ) Reads the present angle. Parameters fromcaptured : Flag for reading from the register (Captured Value) If this parameter is 0, the present value (Present Value) is read. If 1, the register (Captured Value) is read. If omitted, 0 is assigned. Present angle [degree] resetangle uint8_t resetangle( float angle=0 ) Initializes the present angle to the angle specified by the parameter angle. The new target value is set by adding the angle specified by the parameter angle to the difference between the present target angle and the present angle. For example, when resetangle(0) is executed with both the present and target angles at 45 degrees, they both become 0 degrees. When resetangle(0) is executed with the present and target angles at 45 and 90 degrees, respectively, they become 0 and 45 degrees, respectively. Parameters angle : The angle value for initialization. If this parameter is omitted, an angle of 0 degrees is assigned. 0: Execution succeeded 1: Execution failed 45 / 119

47 setmaxangle uint8_t setmaxangle( float angle, int triggerid=0 ) Sets the maximum angle in the rotational range. Parameters angle triggerid : Maximum angle [degree] : Trigger ID If this parameter is 0, the command is immediately executed; otherwise, it waits until a trigger command is issued. It is executed when the same trigger ID is issued with a trigger command. If this parameter is omitted, the trigger ID becomes 0. 0: Execution succeeded 1: Execution failed getmaxangle float getmaxangle( void ) Reads the maximum angle. Maximum angle [degree] setminangle uint8_t setminangle( float angle, int triggerid=0 ) Sets the minimum angle in the rotational range. Parameters angle triggerid : Minimum angle [degree] : Trigger ID If this parameter is 0, the command is immediately executed; otherwise, it waits until a trigger command is issued. It is executed when the same trigger ID is issued with a trigger command. If this parameter is omitted, the trigger ID becomes / 119

48 0: Execution succeeded 1: Execution failed getminangle float getminangle( void ) Reads the minimum angle. Minimum angle [degree] setangletospeedgainp uint8_t setangletospeedgainp( float gain ) Adjusts the proportional gain from the angle error to the target rotational speed. (Refer to Figure 3-7) Parameters gain speed [non-dimensional] : Proportional gain from the angle error to the target rotational 0: Execution succeeded 1: Execution failed getangletospeedgainp float getangletospeedgainp( void ) Reads the proportional gain from the angle error to the target rotational speed. (Refer to Figure 3-7) Proportional gain from the angle error to the target rotational speed [nondimensional] setangletospeedgaini uint8_t setangletospeedgaini( float gain ) Adjusts the integral gain from the angle error to the target rotational speed. (Refer to Figure 3-7) 47 / 119

49 Parameters gain [non-dimensional] : Integral gain from the angle error to the target rotational speed 0: Execution succeeded 1: Execution failed getangletospeedgaini float getangletospeedgaini( void ) Reads the integral gain from the angle error to the target rotational speed. (Refer to Figure 3-7) Integral gain from the angle error to the target rotational speed [non-dimensional] setangletospeedgaind uint8_t setangletospeedgaind( float gain ) Adjusts the derivative gain from the angle error to the target rotational speed. (Refer to Figure 3-7) Parameters gain [non-dimensional] : Derivative gain from the angle error to the target rotational speed 0: Execution succeeded 1: Execution failed getangletospeedgaind float getangletospeedgaind( void ) Reads the derivative gain from the angle error to the target rotational speed. (Refer to Figure 3-7) Derivative gain from the angle error to the target rotational speed [non-dimensional] 48 / 119

50 setangledeadband uint8_t setangledeadband(float angle) Adjusts the deadband (compliance margin) angle for angle control. (Refer to Figure 3-6) Parameters angle : Deadband angle [degree] 0: Execution succeeded 1: Execution failed getangledeadband float getangledeadband( void ) Reads the deadband (compliance margin) angle for angle control. (Refer to Figure 3-6) Deadband angle [degree] setanglepunch uint8_t setanglepunch(float angle) Adjusts the punch for angle control. (Refer to Figure 3-6) Parameters angle : Punch [rpm] 0: Execution succeeded 1: Execution failed getanglepunch float getanglepunch( void ) Adjusts the punch for angle control. (Refer to Figure 3-6) Punch [rpm] Sample Code 49 / 119

51 Angle control sample program This sample program newly sets control parameters to perform angle control with multiple limitations on angle, speed, etc. #include <Control.h> #include <Wire.h> #include <SPI.h> AngleControl.ino //Includes Control.h ControlRoot root; ControlMotor motor; //Declares root class //Declares motor module void setup() { root.controlinit(); motor.attach( 1, 32 ); motor.resetangle( 0.0 ); //Initializes Control API //Assigns a motor module //Rests present angle to 0 degree motor.setangletospeedgaind( 0.0 ); motor.setspeedtotorquegaind( 0.0 ); motor.setcurrenttovoltagegaind( 0.0 ); //Sets Control Constant //Changes from PID control to PI control motor.setangledeadband( 10.0 ); //Sets deadband angle to 10.0 degree motor.setmaxspeed( ); motor.setmaxcurrent( 3.0 ); motor.setmaxvoltage( 10.0 ); } motor.settargetangle( ); delay(5000); //Sets target angle to 3600 degree void loop(){ motor.addtargetangle( ); //Adds 720 degree to target angle 50 / 119

52 float angle = motor.getpresentangle(); //Obtains present angle [degree] delay(2000); } 51 / 119

53 Speed control In speed control, the motor can be rotated at an arbitrary speed. For speed control, use the settargetspeed command to set the target speed. When the motor module accepts the setting, the target values other than the target speed are ignored, and are automatically calculated in the following order as shown in Figure 3-9: target speed, target torque, target current, target voltage, and duty ratio. Like in angle control, you can limit the maximum of each target value to control operation. For example, in order to rotate the motor gradually increasing the rotational speed up to 60 rpm at an acceleration of 10 rpm/s or less, you can use setmaxacceleration(10) command to limit the rotational acceleration to 10 rpm/s, and then use settargetspeed(60) command to rotate it at a constant speed of 60 rpm. Figure 3-9 Calculation of the Target Value in Speed Control Figure 3-10 and Figure 3-11 show transfer functions for speed control and commands effective in angle control. If the speed target has been set by the settargetspeed command, then the target and maximum angles, and parameters such as gain are ignored. 52 / 119

54 Figure 3-10 Transfer Functions for Speed Control and Effective set Commands 53 / 119

55 Figure 3-11 Transfer Functions for Speed Control and Effective get Commands 54 / 119

56 settargetspeed uint8_t settargetspeed( float speedrpm, int triggerid=0 ) Sets the target speed. Parameters speedrpm triggerid : Target speed [rpm] : Triger ID If this parameter is 0, the command is immediately executed; otherwise, it waits until a trigger command is issued. It is executed when the same trigger ID is issued with a trigger command. If this parameter is omitted, the trigger ID becomes 0. 0: Execution succeeded 1: Execution failed gettargetspeed float gettargetspeed( boolean fromreserved=0 ) Reads the target speed. Parameters fromreserved : Flag for reading from the reserved register (Target Value (Reserved)) If this parameter is 0, the target value (Target Value) is read. If 1, the reserved register (Target Value (Reserved)) is read. If omitted, 0 is assigned. Target speed [rpm] getpresentspeed float getpresentspeed( boolean fromcapture=0 ) Reads the present speed. Parameters fromcapture : Flag for reading from the register (Captured Value) 55 / 119

57 If this parameter is 0, the present value (Present Value) is read. If 1, the register (Captured Value) is read. If omitted, 0 is assigned. Present speed [rpm] setmaxspeed uint8_t setmaxspeed( float speedrpm, int triggerid=0 ) Sets the absolute value of the maximum speed (speed limit). Parameters speedrpm triggerid : Maximum speed [rpm] : Trigger ID If this parameter is 0, the command is immediately executed; otherwise, it waits until a trigger command is issued. It is executed when the same trigger ID is issued with a trigger command. If this parameter is omitted, the trigger ID becomes 0. 0: Execution succeeded 1: Execution failed getmaxspeed float getmaxspeed( void ) Reads the absolute value of the maximum speed (speed limit). Maximum speed [rpm] setmaxacceleration uint8_t setmaxacceleration( float AccelerationRPM/s, int triggerid=0 ) Sets the absolute value of the maximum acceleration (acceleration limit). Parameters AccelerationRPM/s : Maximum acceleration [rpm/s] triggerid : Trigger ID If this parameter is 0, the command is immediately executed; 56 / 119

58 otherwise, it waits until a trigger command is issued. It is executed when the same trigger ID is issued with a trigger command. If this parameter is omitted, the trigger ID becomes 0. 0: Execution succeeded 1: Execution failed getmaxacceleration float getmaxacceleration( void ) Reads the absolute value of the maximum acceleration (acceleration limit). maximum acceleration [rpm/s] setspeedtotorquegainp uint8_t setspeedtotorquegainp( float gain ) Adjusts the proportional gain from the speed error to the target torque. (Refer to Figure 3-13) Parameters gain : Proportional gain from the speed error to the target torque [nondimensional] 0: Execution succeeded 1: Execution failed getspeedtotorquegainp float getspeedtotorquegainp( void ) Reads the proportional gain from the speed error to the target torque. (Refer to Figure 3-13) Proportional gain from the speed error to the target torque [non-dimensional] setspeedtotorquegaini uint8_t setspeedtotorquegaini( float gain ) Adjusts the integral gain from the speed error to the target torque. (Refer to Figure 3-13) 57 / 119

59 Parameters gain : Integral gain from the speed error to the target torque [nondimensional] 0: Execution succeeded 1: Execution failed getspeedtotorquegaini float getspeedtotorquegaini( void ) Adjusts the integral gain from the speed error to the target torque. (Refer to Figure 3-13) Integral gain from the speed error to the target torque [non-dimensional] setspeedtotorquegaind uint8_t setspeedtotorquegaind( float gain ) Adjusts the derivative gain from the speed error to the target torque. (Refer to Figure 3-13) Parameters gain : Derivative gain from the speed error to the target torque [nondimensional] 0: Execution succeeded 1: Execution failed getspeedtotorquegaind float getspeedtotorquegaind( void ) Read the derivative gain from the speed error to the target torque. (Refer to Figure 3-13) Derivative gain from the speed error to the target torque [non-dimensional] Sample Code This sample code newly sets control parameters to perform speed control with multiple 58 / 119

60 limitations on speed, voltage, etc. #include <Control.h> #include <Wire.h> #include <SPI.h> SpeedControl.ino //Includes Control.h ControlRoot root; ControlMotor motor; //Declares root class //Declares motor module void setup() { root.controlinit(); motor.attach( 1, 32 ); //Initializes Control API //Assigns a motor module motor.setspeedtotorquegaind( 0.0 ); motor.setcurrenttovoltagegaind( 0.0 ); //Sets Control Constant //Changes from PID control to PI control motor.setmaxspeed( ); motor.setmaxcurrent( 3.0 ); motor.setmaxvoltage( 10.0 ); //Sets max values motor.settargetspeed( 60.0 ); //Sets target rotational speed to 60rpm } void loop(){ float speed = motor.getpresentspeed(); //Obtains present rotational speed [rpm] } 59 / 119

61 Torque control In torque control, the motor can be rotated at an arbitrary torque. For torque control, use the settargettorque command to set the target torque. When the motor module accepts the setting, the target values other than the target torque are ignored, and are automatically calculated in the following order as shown in Figure 3-12: target torque, target torque, target current, target voltage, and duty ratio. Like in angle control, you can limit the maximum of each target value to control operation. For example, in order to rotate the motor at an effective voltage of 10 V or less and a constant torque of 2 mn m, you can use setmaxvoltage(10) command to limit the voltage to 10 V or less, and then use settargettorque(0.002) command to rotate it at a constant torque of 2 mn m. Figure 3-12 Calculation of the Target Value in Torque Control Figure 3-13 and Figure 3-14 show transfer functions for torque control and commands effective in torque control. If the torque target has been set by the settargettorque command, then the target or maximum angle or speed, and parameters such as gain are ignored. 60 / 119

62 Figure 3-13 Transfer Functions for Torque Control and Effective set Commands 61 / 119

63 Figure 3-14 Transfer Functions for Torque Control and Effective get Commands 62 / 119

64 settargettorque uint8_t settargettorque( float torquenm, int triggerid=0 ) Sets the target torque. Parameters torquenm triggerid : Target torque [N m] : Trigger ID If this parameter is 0, the command is immediately executed; otherwise, it waits until a trigger command is issued. It is executed when the same trigger ID is issued with a trigger command. If this parameter is omitted, the trigger ID becomes 0. 0: Execution succeeded 1: Execution failed gettargettorque float gettargettorque( boolean fromreserved=0 ) Reads the target torque. Parameters fromreserved : Flag for reading from the reserved register (Target Value (Reserved)). If this parameter is 0, the target value (Target Value) is read. If 1, the reserved register (Target Value (Reserved)) is read. If omitted, 0 is assigned. target torque [N m] getpresenttorque float getpresenttorque( boolean fromcapture=0 ) Reads the present torque. Parameters fromcapture : Flag for reading from the register (Captured Value) If this parameter is 0, the present value (Present Value) is read. 63 / 119

65 If 1, the register (Captured Value) is read. If omitted, 0 is assigned. Present torque [N m] setmaxtorque uint8_t setmaxtorque( float torquenm, int triggerid=0 ) Sets the absolute value of the maximum torque (torque limit). Parameters torquenm : Maximum torque [N m] triggerid : Trigger ID If this parameter is 0, the command is immediately executed; otherwise, it waits until a trigger command is issued. It is executed when the same trigger ID is issued with a trigger command. If this parameter is omitted, the trigger ID becomes 0. 0: Execution succeeded 1: Execution failed getmaxtorque float getmaxtorque( void ) Read the absolute value of the maximum torque (torque limit). maximum torque [N m] setkt uint8_t setkt (float gain) Adjusts the torque constant (KT value) of the motor. [N m/a] Parameters gain : Torque constant of the motor (KT value) [N m/a] 0: Execution succeeded 1: Execution failed 64 / 119

66 getkt float getkt(void ) Reads the torque constant (KT value) of the motor. Torque constant of the motor (KT value) [N m/a] Sample Code This sample code newly sets control parameters to perform torque control with limitations on voltage, etc. #include <Control.h> #include <Wire.h> #include <SPI.h> TorqueControl.ino //Includes Control.h ControlRoot root; ControlMotor motor; //Declares root class //Declares motor module void setup() { root.controlinit(); motor.attach( 1, 32 ); //Initializes Control API //Assigns a motor module motor.setcurrenttovoltagegaind( 0.0 ); //Changes from PID control to PI control motor.setmaxcurrent( 3.0 ); motor.setmaxvoltage( 10.0 ); //Sets max values motor.settargettorque( ); //Sets target torque to N m } void loop(){ 65 / 119

67 float torque = motor.getpresenttorque(); //Obtains present torque [N m] } 66 / 119

68 Current control In current control, the motor can be rotated by applying an arbitrary current to it. For current control, use the settargetcurrent command to set the target current. When the motor module accepts the setting, the target values other than the target current are ignored, and are automatically calculated in the following order as shown in Figure 3-15: target current, target voltage, and duty ratio. Like in angle control, you can limit the maximum of each target value to control operation. For example, in order to rotate the motor by applying a constant current of 2 A at an effective voltage of 10 V or less, you can use setmaxvoltage(10) command to limit the voltage to 10 V or less, and then use settargetcurrent(2) command to rotate it at a constant current of 2 A. Figure 3-15 Calculation of the Target Value in Current Control Figure 3-16 and Figure 3-17 show transfer functions for current control and commands effective in current control. If the current target has been set by the settargetcurrent command, then neither the target or maximum angle or speed, nor parameters such as gain are used, and they become ineffective. 67 / 119

69 Figure 3-16 Transfer Functions for Current Control and Effective set Commands 68 / 119

70 Figure 3-17 Transfer Functions for Current Control and Effective set Commands 69 / 119

71 settargetcurrent uint8_t settargetcurrent( float current, int triggerid=0 ) Sets the target current. Parameters current triggerid : Target current [A] : Trigger ID If this parameter is 0, the command is immediately executed; otherwise, it waits until a trigger command is issued. It is executed when the same trigger ID is issued with a trigger command. If this parameter is omitted, the trigger ID becomes 0. 0: Execution succeeded 1: Execution failed gettargetcurrent float gettargetcurrent( boolean fromreserved=0 ) Reads the target current. Parameters fromreserved : Flag for reading from the reserved register (Target Value (Reserved)). If this parameter is 0, the target value (Target Value) is read. If 1, the reserved register (Target Value (Reserved)) is read. If omitted, 0 is assigned. Target current [A] getpresentcurrent float getpresentcurrent( boolean fromcapture=0 ) Reads the present current. Parameters fromcapture : Flag for reading from the register (Captured Value) If this parameter is 0, the present value (Present Value) is read. 70 / 119

72 If 1, the register (Captured Value) is read. If omitted, 0 is assigned. Present current [A] setmaxcurrent uint8_t setmaxcurrent (float current, int triggerid=0) Sets the absolute value of the maximum current (current limit). Parameters current triggerid : Maximum current [A] : Trigger ID If this parameter is 0, the command is immediately executed; otherwise, it waits until a trigger command is issued. It is executed when the same trigger ID is issued with a trigger command. If this parameter is omitted, the trigger ID becomes 0. 0: Execution succeeded 1: Execution failed getmaxcurrent float getmaxcurrent( void ) Reads the absolute value of the maximum current (current limit). Maximum current [A] setcurrenttovoltagegainp uint8_t setcurrenttovoltagegainp( float gain ) Adjusts the proportional gain from the current error to the target voltage. (Refer to Figure 3-16) Parameters gain [non-dimensional] : Proportional gain from the current error to the target voltage 71 / 119

73 0: Execution succeeded 1: Execution failed getcurrenttovoltagegainp float getcurrenttovoltagegainp( void ) Reads proportional gain from the current error to the target voltage. (Refer to Figure 3-16) Proportional gain from the current error to the target voltage [non-dimensional] setcurrenttovoltagegaini uint8_t setcurrenttovoltagegaini ( float gain ) Adjusts the integral gain from the current error to the target voltage. (Refer to Figure 3-16) Parameters gain : Integral gain from the current error to the target voltage [nondimensional] 0: Execution succeeded 1: Execution failed getcurrenttovoltagegaini float getcurrenttovoltagegaini( void ) Reads the integral gain from the current error to the target voltage. (Refer to Figure 3-16) Integral gain from the current error to the target voltage [non-dimensional] setcurrenttovoltagegaind uint8_t setcurrenttovoltagegaind( float gain ) Adjusts the derivative gain from the current error to the target voltage. (Refer to Figure 3-16) Parameters gain : Derivative gain from the current error to the target voltage [nondimensional] 72 / 119

74 0: Execution succeeded 1: Execution failed getcurrenttovoltagegaind float getcurrenttovoltagegaind( void ) Reads the derivative gain from the current error to the target voltage. (Refer to Figure 3-16) Derivative gain from the current error to the target voltage [non-dimensional] setinductance uint8_t setinductance( float inductance ) Sets the inductance of the motor. Parameter inductance : Motor inductance [H] 0: Execution succeeded 1: Execution failed getinductance float getinductance( void ) Reads the inductance of the motor. Motor inductance [H] setresistance uint8_t setresistance(float resistance) Sets the DC resistance of the motor. Parameter resistance : Motor DC resistance 0: Execution succeeded 1: Execution failed 73 / 119

75 getresistance float getresistance( void ) Reads the DC resistance of the motor. Motor DC resistance Sample Code This sample code newly sets control parameters to perform current control with limitations on voltage, etc. #include <Control.h> #include <Wire.h> #include <SPI.h> CurrentControl.ino //Includes Control.h ControlRoot root; ControlMotor motor; //Declares root class //Declares motor module void setup() { root.controlinit(); motor.attach( 1, 32 ); //Initializes Control API //Assigns a motor module motor.setcurrenttovoltagegaind( 0.0 ); //Changes from PID control to PI control motor.setmaxvoltage( 10.0 ); //Sets max values motor.settargetcurrent( 1.0 ); //Sets target current to 1 A } void loop(){ 74 / 119

76 float current = motor.getpresentcurrent(); //Obtains present current [A] } 75 / 119

77 Voltage control In voltage control, the motor can be rotated by applying an arbitrary voltage to it. For voltage control, use the settargetvoltage command to set the target voltage. When the motor module accepts the setting, the target values other than the target voltage are ignored, and are automatically calculated in the following order as shown in Figure 3-18: target voltage and duty ratio. Like in angle control, you can limit the maximum of each target value to control operation. Figure 3-18 Calculation of the Target Value in Voltage Control Figure 3-19 and Figure 3-20 show transfer functions executed within the motor module for voltage control, and commands effective in voltage control. If the target voltage has been set by the settargetvoltage command, then the target and maximum values for angle, speed, etc., and parameters such as gain are ignored. 76 / 119

78 Figure 3-19 Transfer Functions for Voltage Control and Effective set Commands 77 / 119

79 Figure 3-20 Transfer Functions for Voltage Control and Effective get Commands 78 / 119

80 settargetvoltage uint8_t settargetvoltage( float voltage, int triggerid=0 ) Sets the target voltage. Parameter voltage triggerid : Target voltage [V] : Trigger ID If this parameter is 0, the command is immediately executed; otherwise, it waits until a trigger command is issued. It is executed when the same trigger ID is issued with a trigger command. If this parameter is omitted, the trigger ID becomes 0. 0: Execution succeeded 1: Execution failed gettargetvoltage float gettargetvoltage(boolean fromreserved=0) Reads the target voltage. Parameters fromreserved : Flag for reading from the reserved register (Target Value (Reserved)). If this parameter is 0, the target value (Target Value) is read. If 1, the reserved register (Target Value (Reserved)) is read. If omitted, 0 is assigned. Target voltage [V] getpresentvoltage float getpresentvoltage( boolean fromcapture=0 ) Reads the present effective voltage. Parameters fromcapture : Flag for reading from the register (Captured Value) If this parameter is 0, the present value (Present Value) is read. 79 / 119

81 If 1, the register (Captured Value) is read. If omitted, 0 is assigned. Present voltage [V] setmaxvoltage uint8_t setmaxvoltage( float voltage, int triggerid=0 ) Sets the absolute value of the maximum effective voltage (effective voltage limit). Parameter voltage triggerid : Maximum voltage [V] : Trigger ID If this parameter is 0, the command is immediately executed; otherwise, it waits until a trigger command is issued. It is executed when the same trigger ID is issued with a trigger command. If this parameter is omitted, the trigger ID becomes 0. 0: Execution succeeded 1: Execution failed getmaxvoltage float getmaxvoltage( void ) Reads the absolute value of the maximum effective voltage (effective voltage limit). Maximum voltage [V] setkv uint8_t setkv( float gain ) Adjusts the constant number of rotations (KV value) of the motor. Parameters gain : Constant number of rotations (KV value) of the motor [rpm/v] 0: Execution succeeded 1: Execution failed 80 / 119

82 getkv float getkv( void ) Reads the constant number of rotations (KV value) of the motor. Constant number of rotations (KV value) of the motor [rpm/v] getsupplyvoltage float getsupplyvoltage( void ) Reads the supply voltage (bus-line voltage) of the motor. Supply voltage of the motor [V] 81 / 119

83 Sample Code This sample code applies 10 V to the motor. #include <Control.h> #include <Wire.h> #include <SPI.h> VoltageControl.ino //Includes Control.h ControlRoot root; ControlMotor motor; //Declares root class //Declares motor module void setup() { root.controlinit(); motor.attach( 1, 32 ); //Initializes Control API //Assigns a motor module motor.settargetvoltage( 10.0 ); //Sets target voltage to 10 V } void loop(){ float voltage = motor.getpresentvoltage(); //Obtains present voltage [V] } 82 / 119

84 PWM control In PWM control, the motor can be rotated by applying a pulse with an arbitrary duty ratio to it. For PWM control, use the settargetduty command to set the target duty ratio. When the motor module accepts the setting, the target values other than the target duty ratio are ignored, and the duty ratio is calculated as shown in Figure Figure 3-21 Calculation of the Target Value in PWM Control Figure 3-22 and Figure 3-23 show transfer functions for PWM control, and commands effective in PWM control. If the target duty ratio has been set by the settargetduty command, then neither the target or maximum angle, speed, etc., nor parameters such as gain are used, and they become ineffective. 83 / 119

85 Figure 3-22 Transfer Functions for PWM Control and Effective set Commands 84 / 119

86 Figure 3-23 Transfer Functions for PWM Control and Effective get Commands 85 / 119

87 settargetduty uint8_t settargetduty( float duty, int triggerid=0 ) Sets the duty ratio (0 to 1) Parameter duty triggerid : Target duty ratio [non-dimensional] : Trigger ID If this parameter is 0, the command is immediately executed; otherwise, it waits until a trigger command is issued. It is executed when the same trigger ID is issued with a trigger command. If this parameter is omitted, the trigger ID becomes 0. 0: Execution succeeded 1: Execution failed gettargetvoltage float gettargetvoltage(boolean fromreserved=0) Reads the target voltage. Parameters fromreserved : Flag for reading from the reserved register (Target Value (Reserved)). If this parameter is 0, the target value (Target Value) is read. If 1, the reserved register (Target Value (Reserved)) is read. If omitted, 0 is assigned. Target voltage [V] getpresentduty float getpresentduty( boolean fromcapture=0 ) Reads the present duty ratio. Parameters fromcapture : Flag for reading from the register (Captured Value) If this parameter is 0, the present value (Present Value) is read. 86 / 119

88 If 1, the register (Captured Value) is read. If omitted, 0 is assigned. Present duty ratio [non-dimensional] setmaxduty uint8_t setmaxduty( float duty, int triggerid=0 ) Sets the absolute value of the maximum duty ratio (duty ratio limit). Parameters duty triggerid : maximum duty ratio [non-dimensional] : Trigger ID If this parameter is 0, the command is immediately executed; otherwise, it waits until a trigger command is issued. It is executed when the same trigger ID is issued with a trigger command. If this parameter is omitted, the trigger ID becomes 0. 0: Execution succeeded 1: Execution failed getmaxduty float getmaxduty( void ) Reads the absolute value of the maximum duty ratio (duty ratio limit). maximum duty ratio [non-dimensional] Sample Code This sample code applies a pulse with a duty ratio of 0.5 to the motor. #include <Control.h> #include <Wire.h> #include <SPI.h> PWMControl.ino //Includes Control.h 87 / 119

89 ControlRoot root; ControlMotor motor; //Declares root class //Declares motor module void setup() { root.controlinit(); motor.attach( 1, 32 ); //Initializes Control API //Assigns a motor module motor.settargetduty( 0.5 ); //Sets target duty to 0.5 } void loop(){ float duty = motor.getpresentduty(); //Obtains present duty } 88 / 119

90 Trigger Trigger commands are used to operate multiple modules simultaneously or to obtain the status of multiple modules at the same time point. Figure 3-24 shows an operating model of the motor module. When a settarget command is used with no trigger ID specified, the target value (Target Value (Active)) is directly written to and is immediately applied to control operation. Meanwhile, when a settarget command is used with a trigger ID specified, the reserved register (Target Value (Reserved)) is written to. The value of the reserved register is transferred to the target value (Target Value (Active)) and is applied to control operation when the applicable trigger ID is received through a trigger command. The target values for multiple motors can be simultaneously made effective by using the same trigger ID for settarget commands for these motors and issuing a trigger command. Figure 3-24 Operating Model of the Motor Module Figure 3-25 shows timing charts of immediate and triggered operations of settarget commands. In a configuration where multiple modules are connected to the same bus, it is impossible to simultaneously transfer a command to multiple modules. Therefore, if the motor1.settargetangle(90) command and the motor2.settargetangle(90) command are executed in this order, the motors start separately at the interval required to transfer the commands, as shown in the upper part of Figure Meanwhile, if the 89 / 119

91 motor1.settargetangle(90,1) command, the motor2.settargetangle(90,1) command, and the controlglobaltrigger(1) command are executed in this order, the settings of the motors are enabled simultaneously when the trigger command is received, so that the two motors can start at the same time, as shown in the lower part of Figure Figure 3-25 Timing Charts of Immediate and Triggered Operations of settarget Commands Figure 3-26 shows timing charts of immediate and triggered operations of getpresent commands. If the motor1.getpresentangle() command, the motor1.getpresentspeed() command, the motor2.getpresentangle() command, and the motor2.getpresentspeed() 90 / 119

92 command are executed in this order, the commands obtain an angle or a speed separately at the intervals required to transfer the commands, as shown in the upper part of Figure Meanwhile, if the motor1.capturevalues(1) command, the motor2.capturevalues(1) command, and the controlglobaltrigger(1) command are executed in this order, the present values (Present Value) such as a speed and an angle that are given when the trigger command is received are transferred to the registers (Captured Value), as shown in the lower part of the Figure The speeds and angles given at the same time point that are stored in the same registers (Captured Value) can be obtained by using the motor1.getpresentangle(1) command, the motor1.getpresentspeed(1) command, the motor2.getpresentangle(1) command, and the motor2.getpresentspeed(1) command to read the values sequentially. 91 / 119

93 Figure 3-26 Timing Charts of Immediate and Triggered Operations of getpresent Commands Figure 3-27 shows an example of periodic control of multiple modules. In periodic control, the following sequential operations are performed: (1) obtaining data from each module, (2) using transfer functions to calculate the next target values based on the obtained values, (3) assigning the next target values to the reserved registers of each module, and (4) using a 92 / 119

94 trigger command to make the target values effective at the same time and capturing the present values into registers; multiple modules can be periodically controlled by executing the trigger command in (4) synchronously with the control cycle. Figure 3-27 Periodic Control of Multiple Modules disabletrigger uint8_t disabletrigger( void ) Disables the trigger function. Trigger IDs set by settarget commands or setmax commands are made ineffective, and all triggers are ignored. 0: Execution succeeded 1: Execution failed enabletrigger uint8_t enabletrigger( void ) Enables the trigger function. The trigger function is enabled after it is disabled by disabletrigger. 93 / 119

95 0: Execution succeeded 1: Execution failed capturepresentvalues uint8_t capturepresentvalues( int triggerid ) Transfers present values (Present Value) to registers (Captured Value). Alternatively it sets a trigger ID used to transfer present values (Present Value) to registers (Captured Value). Parameter triggerid : Trigger ID If this parameter is 0, the command is immediately executed; otherwise, it waits until a trigger command is issued. It is executed when the same trigger ID is issued with a trigger command. If this parameter is omitted, the trigger ID becomes 0. 0: Execution succeeded 1: Execution failed Sample Code This sample code obtains multiple present values (such as speed and angle) at the same time point. #include <Control.h> #include <Wire.h> #include <SPI.h> Capture1.ino //Includes Control.h ControlRoot root; ControlMotor motor; //Declares root class //Declares motor module void setup() { root.controlinit(); motor.attach( 2, 32 ); //Initializes Control API //Assigns a motor module motor.settargetangle( 90.0 ); //Sets target angle to 90 degree 94 / 119

96 } void loop(){ motor.capturepresentvalue(); float angle = motor.getpresentangle(1); //Obtains present angle [degree] float speed = motor.getpresentspeed(1); //Obtains present rotational speed[rmp] } This sample code obtains the present values of multiple motors at the same time point. #include <Control.h> #include <Wire.h> #include <SPI.h> Capture2.ino //Includes Control.h ControlRoot root; ControlMotor motor1, motor2; //Declares root class //Declares motor module void setup() { root.controlinit(); motor1.attach( 2, 32 ); motor2.attach( 2, 83 ); //Initializes Control API //Assigns a motor modules motor1.settargetangle( 90.0 ); motor2.settargetangle( 90.0 ); //Sets target angle to 90 degree } void loop(){ motor1.capturepresentvalues(1); motor2.capturepresentvalues(1); // Captures present value to buffer 95 / 119

97 root.controlglobaltrigger(1); float angle1 = motor1.getpresentangle(1); // Obtains present angle [degree] float angle2 = motor2.getpresentangle(1); } 96 / 119

98 Collective read and write The maximum values (Max Value) and the present values (Present Value) shown in Figure 3-24 include multiple parameters, and the commands used to collectively read or write them are described below. setmaxvalues uint8_t setmaxvalues(float anglemax, float anglemin, float speed, float torque, float current, float voltage, float duty, int triggerid=0) Sets maximum values collectively. Parameter anglemax anglemin speed acceleration torque current voltage duty triggerid : Maximum angle [degree] : Minimum angle [degree] : Maximum speed [rpm] : Maximum acceleration [rpm/s] : Maximum torque [N m] : Maximum current [A] : Maximum voltage [V] : Maximum duty ratio [non-dimensional] : Trigger ID If this parameter is 0, the command is immediately executed; otherwise, it waits until a trigger command is issued. It is executed when the same trigger ID is issued with a trigger command. If this parameter is omitted, the trigger ID becomes 0. 0: Execution succeeded 1: Execution failed getmaxvalues uint8_t getmaxvalues(float *data, boolean fromreserved=0) Reads maximum values collectively. Parameter *data : Pointer to the location where maximum values are stored 97 / 119

99 fromreserved : Flag for reading from the reserved register (Target Value (Reserved)). If this parameter is 0, the target value (Target Value) is read. If 1, the reserved register (Target Value (Reserved)) is read. If omitted, 0 is assigned. 0: Execution succeeded 1: Execution failed getpresetvalues uint8_t getpresetvalues(float *data, boolean fromcapture=0) Reads present values collectively. Parameters *data fromcapture : Pointer to the location where present values are stored : Flag for reading from the register (Captured Value) If this parameter is 0, the present value (Present Value) is read. If 1, the register (Captured Value) is read. If omitted, 0 is assigned. 0: Execution succeeded 1: Execution failed 98 / 119

100 Rotational direction setting setpositiveangledirection uint8_t setpositiveangledirection(boolean direction) Sets the rotational direction (positive). Parameter direction : Positive rotational direction, 0: CCW (Default), 1: CW 0: Execution succeeded 1: Execution failed boolean getpositiveangledirection uint8_t getpositiveangledirection( void ) Reads the rotational direction (positive). Positive rotational direction Whether to use feedback The commands to enable or disable feedback select whether to enable or disable the control of the motor. If it is disabled, the motor terminal is released. Note that feedback is enabled after the motor module is powered on. enablefeedbackcontrol uint8_t enablefeedbackcontrol( void ) Enables the feedback control. 0: Execution succeeded 1: Execution failed 99 / 119

101 disablefeedbackcontrol uint8_t disablefeedbackcontrol( void ) Disables the feedback control. The motor is released. 0: Execution succeeded 1: Execution failed 100 / 119

102 Temperature Obtain the maximum operating temperature or present temperate of the motor. settemperaturelimit uint8_t settemperaturelimit( uint8_t temp ) Sets the upper temperature limit. Parameter temp : Temperature limit [degree Celsius] 0: Execution succeeded 1: Execution failed gettemperaturelimit uint8_t gettemperaturelimit( void ) Reads the upper temperature limit. Temperature limit [degree Celsius] getpresenttemperature uint8_t getpresenttemperature( void ) Reads the temperature (present value). Temperature [degree Celsius] 101 / 119

103 Module information Obtain motor-specific values such as an absolute maximum rating. getabsmaxratedangle float getabsmaxratedangle( void ) Reads the absolute maximum rated angle. Absolute maximum rated angle [degree] getabsminratedangle float getabsminratedangle( void ) Reads the absolute minimum rated angle. Absolute minimum rated angle [degree] getangleresolution float getangleresolution( void ) Reads the angle resolution for angle control. Angle resolution [degree] getabsmaxratedrotationspeed float getabsmaxratedrotationspeed( void ) Reads the absolute maximum rated speed. Absolute maximum rated speed [rpm] getabsmaxratedcurrent float getabsmaxratedcurrent( void ) Reads the absolute maximum rated current. 102 / 119

104 Absolute maximum rated current [A] getabsmaxratedvoltage float getabsmaxratedvoltage( void ) Reads the absolute maximum rated voltage. Absolute maximum rated voltage [V] 103 / 119

105 3.4.4 Serial Communication Class The Serial Communication class consists of commands for communication with modules. Table 3-8 List of the Methods of the Serial Communication Class Method Name Description uint8_t serialwrite(uint8_t busnumber, uint8_t address, Serial communication write uint8_t commandcode, uint8_t, bytecount, uint8_t *data) command uint8_t serialread(uint8_t busnumber, uint8_t address, Serial communication read uint8_t commandcode, uint8_t bytecount, uint8_t *data) command uint8_t settablevalue(uint8_t busnumber, int index, int Incremental write to the bytecount, byte *data) control table for modules uint8_t gettablevalue(uint8_t busnumber, int index, int Incremental read from the bytecount, byte *data) control table for modules Methods serialwrite uint8_t serialwrite(uint8_t busnumber,uint8_t address, uint8_t commandcode, uint8_t, bytecount, uint8_t *data ) Serial communication write command. Parameters busnumber : Bus number (Refer to Table 3-5) address : Module I 2 C address commandcode : Command code bytecount : Byte count *data : Pointer to the data to be written 0: Execution succeeded 1: Execution failed serialread uint8_t serialread(uint8_t busnumber,uint8_t address, uint8_t commandcode, uint8_t bytecount, uint8_t *data ) 104 / 119

106 Serial communication read command. Parameters busnumber : Bus number(refer to Table 3-5) address : Module I 2 C address commandcode : Command code bytecount : Byte count *data : Pointer to the data to be read 0: Execution succeeded 1: Execution failed settablevalue uint8_t settablevalues(uint8_t busnumber, uint8_t index, uint8_t bytecount, byte *data) Incremental write to the control table for modules. Parameters busnumber : Bus number(refer to Table 3-5) address : Module I 2 C address index : Index on the module control table bytecount : Byte count *data : Pointer to the data to be written 0: Execution succeeded 1: Execution failed gettablevalues uint8_t gettablevalue(uint8_t busnumber, uint8_t index, uint8_t bytecount, byte *data) Incremental read from the control table for modules. Parameters busnumber : Bus number(refer to Table 3-5) address : Module I 2 C address index : Index on the module control table bytecount : Byte count *data : Pointer to the data to be written 105 / 119

107 0: Execution succeeded 1: Execution failed 106 / 119

108 4 Serial Communication Specifications 4.1 Overview This section describes the I 2 C serial communication standards and the packet specifications that are used for communication with modules supporting the Control API. Figure 4-1 Serial communication standards for data transfer 4.2 Applicable Communication Standards The I 2 C Standard is used for I 2 C serial communication. I 2 C Standard : The physical and data link layers are compliant with the I 2 C Standard. Address Resolution Protocol, CRC (Cyclic Redundancy Check) and retransmission control are scheduled to be implemented in order to deal with communication errors in the future. 107 / 119

109 4.3 Packet Specifications Figure 4-2 shows the packet structure. In the future, the protocol will be changed to one with CRC. As for command codes, the next section provides details. Figure 4-2 Packet Specifications 108 / 119

110 4.4 Command Codes The Arduino and the motor module use serial communication to transmit and receive desired control parameters. The command codes indicate which control parameter will be transmitted and received. Table 4-1 lists the command codes. Command Code : Indicates the command code. Control parameter to be accessed: Indicates the motor control parameter to be accessed. Byte Count : Indicates the byte count. Data Bytes(Type) : Indicates the content of the data bytes. () indicates the type of the data. uint8_t is one byte, and float is four bytes. The byte order is little-endian. When multiple parameters are to be transmitted and received, descriptions are provided in the order of data bytes. Table 4-1 List of the Command Codes Command Code Control Parameter To Be Accessed Byte Count Data Bytes(type) 0x00 Target Values Parameter Code 1 Parameter Code(uint8_t) 0x01 (Active) Parameter 4 Parameter(float) 0x02 Parameter Code 1 Parameter Code(uint8_t) Target Values 0x03 Parameter 4 Parameter(float) (Reserved) 0x04 Trigger ID 1 Trigger ID(uint8_t) 0x05 MaxAngle 4 Angle(float) 0x06 MinAngle 4 Angle(float) 0x07 AbsMaxSpeed 4 Speed(float) 0x08 Max Values AbsMaxAcceleration 4 Accel(float) 0x09 (Active) AbsMaxTorque 4 Torque(float) 0x0A AbsMaxCurrent 4 Current(float) 0x0B AbsMaxVoltage 4 Volt(float) 0x0C AbsMaxDuty 4 Duty(float) 0x0D MaxAngle 5 Angle(float) 0x0E Max Values MinAngle 5 Angle(float) 0x0F (Reserved) AbsMaxSpeed 5 Speed(float) 0x10 AbsMaxAcceleration 4 Accel(float) 109 / 119

111 0x11 AbsMaxTorque 5 Torque(float) 0x12 AbsMaxCurrent 5 Current(float) 0x13 AbsMaxVoltage 5 Volt(float) 0x14 AbsMaxDuty 5 Duty(float) 0x15 Trigger ID 1 Trigger ID(uint8_t) 0x16 Angle 4 Angle(float) 0x17 Speed 4 Speed(float) 0x18 Present Acceleration 4 Accel(float) 0x19 Values Torque 4 Torque(float) 0x1A (Active) Current 4 Current(float) 0x1B Voltage 4 Volt(float) 0x1C Duty 4 Duty(float) 0x1D Angle 4 Angle(float) 0x1E Speed 4 Speed(float) 0x1F Acceleration 4 Accel(float) 0x20 Captured Torque 4 Torque(float) 0x21 Values Current 4 Current(float) 0x22 Voltage 4 Volt(float) 0x23 Duty 4 Duty(float) 0x24 Trigger ID 1 Trigger ID(uint8_t) 0x25 Temperature 4 Temp(float) 0x26 Supply Voltage 4 Volt(float) 0x27 Reset Angle 1 data(uint8_t) 0x28 Trigger 1 data(uint8_t) 0x29 Factory Reset 1 data(uint8_t) 0x2A Reboot 1 data(uint8_t) 0x2B Status 1 data(uint8_t) 0x2C Error Code 1 data(uint8_t) 0x2D Feedback 1 data(uint8_t) 0x2E LED 2 data(uint8_t) 0x2F Angle to P 4 Param(float) 0x30 Speed I 4 Param(float) 0x31 Gain D 4 Param(float) 0x32 P 4 Param(float) 0x33 I 4 Param(float) 110 / 119

112 0x34 Speed to Torque Gain D 4 Param(float) 0x35 KT 4 Param(float) 0x36 Motor Inductance 4 Param(float) 0x37 Motor Resistance 4 Param(float) 0x38 Current to P 4 Param(float) 0x39 Voltage I 4 Param(float) 0x3A Gain D 4 Param(float) 0x3B KV 4 Param(float) 0x3C Deadband 4 Param(float) 0x3D Punch 4 Param(float) 0x3E MaxAngle 4 Angle(float) 0x3F MinAngle 4 Angle(float) 0x40 AbsMaxSpeed 4 Speed(float) 0x41 AbsMaxAcceleration 4 Accel(float) Absolute 0x42 AbsMaxTorque 4 Torque(float) Maximum 0x43 AbsMaxCurrent 4 Current(float) 0x44 AbsMaxVoltage 4 Volt(float) 0x45 MaxTemperature 4 Temp(float) 0x46 MinTemperature 4 Temp(float) 0x47 Angle Resolution 4 Angle(float) 0x48 Positive Angle Direction 1 data(uint8_t) 0x48 to 0x79 0x7A Target Values Parameter Code(uint8_t), 6 (Active) Parameter(float) 0x7B Target Values 7 Parameter Code(uint8_t), Parameter(float), Batch (Reserved) Trigger ID(uint8_t) 0x7C Access Max Values MaxAngle to 28 (Active) AbsMaxDuty(float) 0x7D Max Values (Reserved) 29 MaxAngle to AbsMaxDuty(float), TriggerID(uint8_t) 111 / 119

113 0x7E Present Values (Active) 28 Angle to Duty(float) 0x7F Captured Values 28 Angle to Duty(float) 0x80 Table Direct Pointer 1 data(uint8_t) 0x81 Access Data N Command codes can either separately or collectively access the parameters used for transfer functions for motor control. Figure 4-3 shows the relationship between the command codes and the control parameters to be accessed. In order to access maximum values (Max Values) or present values (Present Values), use the command codes corresponding to their respective parameters. For example, the command codes for the maximum angle and the present angle are 0x05 and 0x16, respectively; in order to collectively read from or write to multiple parameters for maximum values (Max Values (Active)), 0x7E must be used as the command code. To access present values (Target Values), use two types of command codes. The first command code specifies the type of the target parameter (0: angle, 1: speed, 2: torque, 3: current, 4: voltage, 5: duty, etc.), and the other one specifies the target value itself. For example, in order to perform speed control at 60 rpm, use the command code 0x00 to specify the type of the target parameter and then use the command code 0x01 to specify the target value. The motor module inputs the target value through only one transfer function according to the type of the target parameter. Some command codes access a parameter by specifying the address on the control table, like a conventional command servo. Specifically, you can use the command code 0x80 to specify the location to be accessed on the module control table and then use the command code 0x81 to transfer the desired size of data. The access positon is automatically incremented to sequentially store the data in the control table. Command codes are common to motors that support the Control API. This makes it possible to use the same command codes even for different types or models of motors, eliminating the need for changes to programs. Also, this makes it easier to substitute a motor with a different maximum output or of a different type according to the circumstances. 112 / 119

114 Figure 4-3 Command Codes and Accessed Control Parameters 113 / 119

115 5 Modules Various modules, such as motor modules, sensor modules, and battery modules, are planned to be provided. 5.1 Motor Modules There are various types of motor modules such as a DC motor module and an AC motor module DC Motor Module Control Table The motor module refers to values on the control table to control a motor. They can be rewritten through serial communication with the control table. Figure 5-1 shows the control table. RAM/FLASH: Index: Initial value: Values in RAM are returned to the initial values each time the power is turned on. Those in FLASH are retained even after the power is turned on. Indicates the parameter position. To directly access the control table, use Index values. Values to which parameters are set by power-up or factory reset. RAM/ FLASH RAM Figure 5-1 Control Table INDEX Type Content (byte) Initial Value 0 Target Parameter Type uint8_t (1) 0 1 Value (Active) Parameter float (4) 0 2 Target Parameter Type uint8_t (1) 0 3 Value Parameter float (4) 0 4 (Reserved) Trigger ID uint8_t (1) 0 5 Max Value MaxAngle float (4) 6 (Active) MinAngle float (4) / 119

116 7 AbsMaxSpeed float (4) AbsMaxAcceleration float (4) 9 AbsMaxTorque float (4) AbsMaxCurrent float (4) AbsMaxVoltage float (4) AbsMaxDuty float (4) MaxAngle float (4) 14 MinAngle float (4) -l 15 AbsMaxSpeed float (4) AbsMaxAcceleration float (4) Max Value 17 AbsMaxTorque float (4) (Reserved) 18 AbsMaxCurrent float (4) AbsMaxVoltage float (4) AbsMaxDuty float (4) Trigger ID uint8_t (1) 22 Angle float (4) 0 23 Speed float (4) 0 24 Present Acceleration float (4) 0 25 Values Torque float (4) 0 26 (Active) Current float (4) 0 27 Voltage float (4) 0 28 Duty float (4) 0 29 Angle float (4) 0 30 Speed float (4) 0 31 Acceleration float (4) 0 32 Capture Torque float (4) 0 33 Values Current float (4) 0 34 Voltage float (4) 0 35 Duty float (4) 0 36 Trigger ID uint8_t (1) 0 37 Temperature float (4) 0 38 Supply Voltage float (4) 0 39 Reset Angle float (4) 0 40 Trigger uint8_t (1) 0 41 Factory Reset uint8_t (1) / 119

117 FLASH 42 Reboot uint8_t (1) 0 43 Status uint8_t (1) 0 44 Error Code uint8_t (1) 0 45 Feedback uint8_t (1) 0 46 LED uint8_t (1) 0 47 Angle to P float (4) Speed I float (4) 0 49 Gain D float (4) 0 50 Speed to P float (4) Torque I float (4) Gain D float (4) 0 53 KT float (4) Motor Inductance float (4) 0 55 Motor Resistance float (4) 0 56 Current to P float (4) 5 57 Voltage I float (4) Gain D float (4) 0 59 KV float (4) Deadband float (4) 5 61 Punch float (4) 0 62 MaxAngle float (4) 63 MinAngle float (4) - 64 AbsMaxSpeed float (4) AbsMaxAcceleration float (4) Absolute 66 AbsMaxTorque float (4) Maximum 67 AbsMaxCurrent float (4) AbsMaxVoltage float (4) MaxTemperature float (4) MinTemperature float (4) Angle Resolution float (4) 5 72 Positive Angle Direction uint8_t (1) 0 73 Encoder Slit Count uint8_t (1) / 119

118 Control Line Diagram Figure 5-2 shows a control line diagram. Figure 5-2 Control Line Diagram 117 / 119

KOLLMORGEN. SERVOSTAR CD. SERCOS IDN Manual M-SS rev. F. Solutions by D A N A H E R M O T I O N

KOLLMORGEN.  SERVOSTAR CD. SERCOS IDN Manual M-SS rev. F. Solutions by D A N A H E R M O T I O N KOLLMORGEN www.danahermotion.com SERVOSTAR CD Solutions by D A N A H E R M O T I O N SERCOS IDN Manual M-SS-017-05 rev. F Revision History Revision Edition Date Reason for Revision 1 05/01/1999 Initial

More information

2G Actuator Communications Protocol Document Rotary & Linear Actuators

2G Actuator Communications Protocol Document Rotary & Linear Actuators 2752 Capitol Drive Suite #103 Sun Prairie, WI 53590 2150080 2G Actuator Packets - Rotary & Linear Revision AI Date 4/25/2018 2G Actuator Communications Protocol Document Rotary & Linear Actuators DOCUMENT

More information

Experiment 4.A. Speed and Position Control. ECEN 2270 Electronics Design Laboratory 1

Experiment 4.A. Speed and Position Control. ECEN 2270 Electronics Design Laboratory 1 .A Speed and Position Control Electronics Design Laboratory 1 Procedures 4.A.0 4.A.1 4.A.2 4.A.3 4.A.4 Turn in your Pre-Lab before doing anything else Speed controller for second wheel Test Arduino Connect

More information

ROBOTIS e-manual v AX-12W. Part Photo [AX-12W] Hardware Specifications. Weight : 52.9g Dimension : 32mm * 50mm * 40mm

ROBOTIS e-manual v AX-12W. Part Photo [AX-12W] Hardware Specifications. Weight : 52.9g Dimension : 32mm * 50mm * 40mm ROBOTIS e-manual v1.20.00 AX-12W Part Photo [AX-12W] Hardware Specifications Weight : 52.9g Dimension : 32mm * 50mm * 40mm Resolution : 0.29 Gear Reduction Ratio : 32 : 1 No load speed : 470rpm (at 12V,

More information

AX-18F/ AX-18A. Part Photo. H/W Specification [AX-18F] [AX-18A]

AX-18F/ AX-18A. Part Photo. H/W Specification [AX-18F] [AX-18A] AX-18F/ AX-18A Part Photo [AX-18F] [AX-18A] AX-18A is a new version of the AX-18F with the same performance but more advanced external design. H/W Specification Weight : 54.5g (AX-18F), 55.9g(AX-18A) Dimension

More information

v1.2 Closer to Real, USB2Dynamixel User s Manual ROBOTIS CO.,LTD.

v1.2 Closer to Real, USB2Dynamixel User s Manual ROBOTIS CO.,LTD. v1.2 Closer to Real, USB2Dynamixel User s Manual ROBOTIS CO.,LTD. www.robotis.com contents 1. Introduction 2 1-1. Functions 2 1-2. Composition 3 1-3. System Requirements 3 1-4. USB2Dynamixel Connection

More information

OTO Photonics. Sidewinder TM Series Datasheet. Description

OTO Photonics. Sidewinder TM Series Datasheet. Description OTO Photonics Sidewinder TM Series Datasheet Description SW (Sidewinder TM ) Series spectrometer,built with the InGaAs type sensor and high performance 32bits RISC controller in, is specially designed

More information

Arduino Uno. Power & Interface. Arduino Part 1. Introductory Medical Device Prototyping. Digital I/O Pins. Reset Button. USB Interface.

Arduino Uno. Power & Interface. Arduino Part 1. Introductory Medical Device Prototyping. Digital I/O Pins. Reset Button. USB Interface. Introductory Medical Device Prototyping Arduino Part 1, http://saliterman.umn.edu/ Department of Biomedical Engineering, University of Minnesota Arduino Uno Power & Interface Reset Button USB Interface

More information

Dynamixel Shield for Arduino Mega2560

Dynamixel Shield for Arduino Mega2560 Dynamixel Shield for Arduino Mega2560 Maximum Baud Rate (Tested) : 1,000,000 bps PWR LED RS485 TTL LED for User - LED 1 : Pin 30 - LED 2 : Pin 28 - LED 3 : Pin 26 Switch for User (with 10k Pull-up) - SW1

More information

Introduction To Arduino

Introduction To Arduino Introduction To Arduino What is Arduino? Hardware Boards / microcontrollers Shields Software Arduino IDE Simplified C Community Tutorials Forums Sample projects Arduino Uno Power: 5v (7-12v input) Digital

More information

RS422/RS485 Shield. Application Note: Multiple RS485 busses. 1 Introduction

RS422/RS485 Shield. Application Note: Multiple RS485 busses. 1 Introduction 1 Introduction This application note will show you how to connect up to 3 independent RS485 busses to one Arduino. This can be useful if you want to create a gateway between these busses or if you want

More information

Introduction to Internet of Things Prof. Sudip Misra Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur

Introduction to Internet of Things Prof. Sudip Misra Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Introduction to Internet of Things Prof. Sudip Misra Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Lecture - 23 Introduction to Arduino- II Hi. Now, we will continue

More information

HD25A. Absolute Industrial Rugged Metal Optical Encoder Absolute Industrial Rugged Metal Optical Encoder, Page 1 of 5. Description.

HD25A. Absolute Industrial Rugged Metal Optical Encoder Absolute Industrial Rugged Metal Optical Encoder, Page 1 of 5. Description. Description HD25A, Page 1 of 5 The HD25A is a NEMA 25 sized absolute encoder designed for industrial applications. The HD25A optical encoder is a 12-bit absolute rotary position sensor, which reports a

More information

OtO Photonics. Sidewinder TM Series Datasheet. Description

OtO Photonics. Sidewinder TM Series Datasheet. Description OtO Photonics Sidewinder TM Series Datasheet Description SW (Sidewinder TM ) Series spectrometer,built with the InGaAs type sensor and high performance 32bits RISC controller in, is specially designed

More information

Introduction to Arduino Programming. Sistemi Real-Time Prof. Davide Brugali Università degli Studi di Bergamo

Introduction to Arduino Programming. Sistemi Real-Time Prof. Davide Brugali Università degli Studi di Bergamo Introduction to Arduino Programming Sistemi Real-Time Prof. Davide Brugali Università degli Studi di Bergamo What is a Microcontroller www.mikroe.com/chapters/view/1 A small computer on a single chip containing

More information

ARDUINO MEGA INTRODUCTION

ARDUINO MEGA INTRODUCTION ARDUINO MEGA INTRODUCTION The Arduino MEGA 2560 is designed for projects that require more I/O llines, more sketch memory and more RAM. With 54 digital I/O pins, 16 analog inputs so it is suitable for

More information

General Description. The TETRIX MAX DC Motor Expansion Controller features the following:

General Description. The TETRIX MAX DC Motor Expansion Controller features the following: General Description The TETRIX MAX DC Motor Expansion Controller is a DC motor expansion peripheral designed to allow the addition of multiple DC motors to the PRIZM Robotics Controller. The device provides

More information

How to Use an Arduino

How to Use an Arduino How to Use an Arduino By Vivian Law Introduction The first microcontroller, TMS-1802-NC, was built in 1971 by Texas Instruments. It owed its existence to the innovation and versatility of silicon and the

More information

INSTRUCTIONS MANUAL. ParaMon Software

INSTRUCTIONS MANUAL. ParaMon Software INSTRUCTIONS MANUAL ParaMon Software Index 1. Installation 1 1.1 Required PC specification 1 1.2 Software 1 2. Operation 2 2.1 Connection 2 2.2 Menu 2 2.2.1 System 4 1) Firmware downloader 4 2) Firmware

More information

Arduino Programming and Interfacing

Arduino Programming and Interfacing Arduino Programming and Interfacing Stensat Group LLC, Copyright 2017 1 Robotic Arm Experimenters Kit 2 Legal Stuff Stensat Group LLC assumes no responsibility and/or liability for the use of the kit and

More information

GUIDE TO SP STARTER SHIELD (V3.0)

GUIDE TO SP STARTER SHIELD (V3.0) OVERVIEW: The SP Starter shield provides a complete learning platform for beginners and newbies. The board is equipped with loads of sensors and components like relays, user button, LED, IR Remote and

More information

LIS3DH Hookup Guide. Introduction. SparkFun Triple Axis Accelerometer Breakout - LIS3DH SEN Required Materials

LIS3DH Hookup Guide. Introduction. SparkFun Triple Axis Accelerometer Breakout - LIS3DH SEN Required Materials Page 1 of 15 LIS3DH Hookup Guide Introduction The LIS3DH is a triple axis accelerometer you can use to add translation detection to your project. It would be classified as a 3DoF, or 3 Degrees of Freedom.

More information

L298N Dual H-Bridge Motor Driver

L298N Dual H-Bridge Motor Driver Handson Technology User Guide L298N Dual H-Bridge Motor Driver This dua l bidirectional motor driver, is based on the very popular L298 Dual H-Bridge Motor Driver Integrated Circuit. The circuit will allow

More information

Robotics/Electronics Review for the Final Exam

Robotics/Electronics Review for the Final Exam Robotics/Electronics Review for the Final Exam Unit 1 Review. 1. The battery is 12V, R1 is 400 ohms, and the current through R1 is 20 ma. How many ohms is R2? ohms What is the voltage drop across R1? V

More information

Serial.begin ( ); Serial.println( ); analogread ( ); map ( );

Serial.begin ( ); Serial.println( ); analogread ( ); map ( ); Control and Serial.begin ( ); Serial.println( ); analogread ( ); map ( ); A system output can be changed through the use of knobs, motion, or environmental conditions. Many electronic systems in our world

More information

Data Sheet MEM 22. Absolute Encoder Multiturn

Data Sheet MEM 22. Absolute Encoder Multiturn Absolute Encoder Multiturn Features Resolution: Singleturn: up to 16,384 (14 Bit) steps per revolution Multiturn: up to 16,777,216 (24 Bit) revolutions Interface: SSI (synchron serial interface) or BiSS

More information

Modern Robotics Inc. Sensor Documentation

Modern Robotics Inc. Sensor Documentation Sensor Documentation Version 1.0.1 September 9, 2016 Contents 1. Document Control... 3 2. Introduction... 4 3. Three-Wire Analog & Digital Sensors... 5 3.1. Program Control Button (45-2002)... 6 3.2. Optical

More information

MAE106 Laboratory Exercises Lab # 1 - Laboratory tools

MAE106 Laboratory Exercises Lab # 1 - Laboratory tools MAE106 Laboratory Exercises Lab # 1 - Laboratory tools University of California, Irvine Department of Mechanical and Aerospace Engineering Goals To learn how to use the oscilloscope, function generator,

More information

8:1 Serial Port Expander

8:1 Serial Port Expander 8:1 Serial Port Expander V 1.3 This is an evolving document check back for updates. Features Expand a single UART (RX / TX) serial port into 8 additional serial ports On-board LEDs indicate which channel

More information

RoboClaw 2x30A Dual Channel Motor Controller

RoboClaw 2x30A Dual Channel Motor Controller RoboClaw 2x30A, 34VDC Dual Channel Brushed DC Motor Controller Version 2.2 (c) 2016 Ion Motion Control. All Rights Reserved. Feature Overview: 60 Amps Peak Per Channel Channel Bridging Supported Dual Quadrature

More information

DAQ-1000 Data Acquisition and Control System Application

DAQ-1000 Data Acquisition and Control System Application WWW.INHAOS.COM DAQ-1000 Data Acquisition and Control System Application Based on the DAQ-1000 Arduino UNO Data Acquisition shield Tony Tan 2015/11/10 1. Summary This document gives an example of how to

More information

robotics/ openel.h File Reference Macros Macro Definition Documentation Typedefs Functions

robotics/ openel.h File Reference Macros Macro Definition Documentation Typedefs Functions openel.h File Reference Macros #define EL_TRUE 1 #define EL_FALSE 0 #define EL_NXT_PORT_A 0 #define EL_NXT_PORT_B 1 #define EL_NXT_PORT_C 2 #define EL_NXT_PORT_S1 0 #define EL_NXT_PORT_S2 1 #define EL_NXT_PORT_S3

More information

Optidrive Applications Support Library

Optidrive Applications Support Library Optidrive Applications Support Library Application Note Title AN-ODV-3-038 Related Products Optidrive Eco Overview Level 3 Modbus RTU Control and Register Mapping 1 Fundamental - No previous experience

More information

VEX ARM Cortex -based Microcontroller and VEXnet Joystick User Guide

VEX ARM Cortex -based Microcontroller and VEXnet Joystick User Guide 1. VEX ARM Cortex -based Microcontroller and VEXnet Joystick Pairing Procedure: a. The Joystick must first be paired to the VEX ARM Cortex -based Microcontroller before they will work using VEXnet Keys.

More information

3GV M Modbus RTU Register Map

3GV M Modbus RTU Register Map Application Note AN-ODP- 38 3GV M Modbus RTU Register Map Author: Ning Xu, Invertek Drives Ltd Revision: 2.21 15 June 2007 General This document details the Modbus RTU memory mapping implemented in Optidrive

More information

MotionView Configuration and Programming Software USER S MANUAL

MotionView Configuration and Programming Software USER S MANUAL MotionView Configuration and Programming Software USER S MANUAL IM94MV01C Table of Contents 1 MotionView Software Overview......................................... 3 1.1 Installation and Package Revision.................................................

More information

Interrupts, timers and counters

Interrupts, timers and counters Interrupts, timers and counters Posted on May 10, 2008, by Ibrahim KAMAL, in Micro-controllers, tagged Most microcontrollers come with a set of ADD-ONs called peripherals, to enhance the functioning of

More information

keyestudio Keyestudio MEGA 2560 R3 Board

keyestudio Keyestudio MEGA 2560 R3 Board Keyestudio MEGA 2560 R3 Board Introduction: Keyestudio Mega 2560 R3 is a microcontroller board based on the ATMEGA2560-16AU, fully compatible with ARDUINO MEGA 2560 REV3. It has 54 digital input/output

More information

The Arduino Briefing. The Arduino Briefing

The Arduino Briefing. The Arduino Briefing Mr. Yee Choon Seng Email : csyee@simtech.a-star.edu.sg Design Project resources http://guppy.mpe.nus.edu.sg/me3design.html One-Stop robotics shop A-Main Objectives Pte Ltd, Block 1 Rochor Road, #02-608,

More information

Diploma in Embedded Systems

Diploma in Embedded Systems Diploma in Embedded Systems Duration: 5 Months[5 days a week,3 hours a day, Total 300 hours] Module 1: 8051 Microcontroller in Assemble Language Characteristics of Embedded System Overview of 8051 Family

More information

The Maze Runner Zumo version. Alexander Kirillov

The Maze Runner Zumo version. Alexander Kirillov The Maze Runner Zumo version Alexander Kirillov URL: http://sigmacamp.org/mazerunner-zumo E-mail address: shurik179@gmail.com This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike

More information

TMC260 Stepper Motor Driver Shield SKU: DRI0035

TMC260 Stepper Motor Driver Shield SKU: DRI0035 TMC260 Stepper Motor Driver Shield SKU: DRI0035 Contents 1 Introduction 2 Specification 3 Board Overview o 3.1 TMC260 Control Mode Selection 4 Tutorial o 4.1 Requirements o 4.2 Sample Code 4.2.1 SPI Sample

More information

Note. The above image and many others are courtesy of - this is a wonderful resource for designing circuits.

Note. The above image and many others are courtesy of   - this is a wonderful resource for designing circuits. Robotics and Electronics Unit 2. Arduino Objectives. Students will understand the basic characteristics of an Arduino Uno microcontroller. understand the basic structure of an Arduino program. know how

More information

TMCM-1613 FIRMWARE MANUAL

TMCM-1613 FIRMWARE MANUAL Module for BLDC Motors Modules TMCM-1613 FIRMWARE MANUAL TMCM-1613 Firmware Version 1.00 2016-MAR-28 Document Revision 1.00 2016-MAR-28 SHORT SPEC The TMCM-1613 firmware performs hall sensor-based block

More information

Galil Motion Control. EDD 3701x

Galil Motion Control. EDD 3701x Galil Motion Control EDD 3701x Datasheet : Digital Drive 1-916-626-0101 Galil Motion Control 270 Technology Way, Rocklin, CA [Type here] [Type here] (US ONLY) 1-800-377-6329 [Type here] Product Description

More information

APPLICATION NOTE IDM.101

APPLICATION NOTE IDM.101 Problem: For new users of an intelligent drive, starting to implement a motion control application can be a quite complex task. You need to know how to hook-up the components of the motion system, to configure

More information

Adapted from a lab originally written by Simon Hastings and Bill Ashmanskas

Adapted from a lab originally written by Simon Hastings and Bill Ashmanskas Physics 364 Arduino Lab 1 Adapted from a lab originally written by Simon Hastings and Bill Ashmanskas Vithayathil/Kroll Introduction Last revised: 2014-11-12 This lab introduces you to an electronic development

More information

4 Channel Stepper Driver Shield

4 Channel Stepper Driver Shield 4 Channel Stepper Driver Shield for Arduino and Raspberry-Pi Product Overview The IES-SHIELD-STX4 is a four [4] channel 5V or 6-12V (jumper selectable) Unipolar stepper motor driver with advanced control

More information

System Design Guide for Slave

System Design Guide for Slave System Design Guide for Slave Motor Business Unit Appliances Company 2012/2/15 Rev. 2 Page 1 Revision History Revision Date Change Description 1 2010/3/3 Initial Release 2 2012/2/15 P1 Changed title from

More information

RMS Resolver Calibration Process

RMS Resolver Calibration Process RMS Resolver Calibration Process Revision 0.2 6/27/2011 RMS Resolver Calibration Process 1 of 8 Revision History Version Description of Versions / Changes Responsible Party Date 0.1 Initial version Chris

More information

Protocol of data exchange with modem via USB interface Version

Protocol of data exchange with modem via USB interface Version Protocol of data exchange with modem via USB interface Version 2017.12.19 - Modem connects to USB-host as USB device of CDC class (virtual COM port in Windows, ttyusb or ttyacm in Linux) - Because real

More information

Appendix C: HVAC PRO Modules

Appendix C: HVAC PRO Modules FANs 637.5, 1637.5 Appendix Section Issue Date 0400 APPLICATION NOTE Appendix C: HVAC PRO Modules HVAC PRO Modules...3 Introduction...*3 Key Concepts...*4 ABS VALUE... 6 ADD... 6 ANALOG OUTPUT... 6 AND...

More information

RX Family APPLICATION NOTE. I 2 C Bus Interface (RIIC) Module Using Firmware Integration Technology. Introduction. Target Device.

RX Family APPLICATION NOTE. I 2 C Bus Interface (RIIC) Module Using Firmware Integration Technology. Introduction. Target Device. I 2 C Bus Interface (RIIC) Module Using Firmware Integration Technology Introduction APPLICATION NOTE R01AN1692EJ0231 Rev. 2.31 This application note describes the I 2 C bus interface (RIIC) module using

More information

Arduino Uno R3 INTRODUCTION

Arduino Uno R3 INTRODUCTION Arduino Uno R3 INTRODUCTION Arduino is used for building different types of electronic circuits easily using of both a physical programmable circuit board usually microcontroller and piece of code running

More information

Lab 01 Arduino 程式設計實驗. Essential Arduino Programming and Digital Signal Process

Lab 01 Arduino 程式設計實驗. Essential Arduino Programming and Digital Signal Process Lab 01 Arduino 程式設計實驗 Essential Arduino Programming and Digital Signal Process Arduino Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It's

More information

Serial Communications Guide

Serial Communications Guide M-5000 Smart Ultrasonic Sensor Serial Communications Guide Page 1 of 14 Serial Communications Guide MassaSonic TM M-5000 Smart Ultrasonic Sensors MASSA PRODUCTS CORPORATION 280 Lincoln Street Hingham,

More information

December 9, ExROS -- Excitron Robot Operating System

December 9, ExROS -- Excitron Robot Operating System ExROS -- Excitron Robot Operating System December 9, 2014 These notes are additional details about ExROS and general operation of our new X Controllers. Our plan is to merge these notes into the X Controller

More information

LM24A-MOD. Cable 1 m, 6 x 0.75 mm 2 RJ12 socket

LM24A-MOD. Cable 1 m, 6 x 0.75 mm 2 RJ12 socket echnical data sheet Damper actuator for Modbus for adjusting air dampers in ventilation and air conditioning systems in buildings orque 5 Nm Nominal voltage AC/DC 4V Communication via Modbus RU (RS-485)

More information

Flex Series User Guide

Flex Series User Guide User Programmable Current 4..20mA Digital RS485 Dual & Single Axis Up to 360º 2016 Flex Series User Guide Sensor Installation, Wiring, Flexware App Instructions Page 1 of 33 Page 2 of 33 Table of Contents

More information

Laboratory 5 Communication Interfaces

Laboratory 5 Communication Interfaces Laboratory 5 Communication Interfaces Embedded electronics refers to the interconnection of circuits (micro-processors or other integrated circuits) with the goal of creating a unified system. In order

More information

Make your own secret locking mechanism to keep unwanted guests out of your space!

Make your own secret locking mechanism to keep unwanted guests out of your space! KNOCK LOCK Make your own secret locking mechanism to keep unwanted guests out of your space! Discover : input with a piezo, writing your own functions Time : 1 hour Level : Builds on projects : 1,,3,4,5

More information

Architecture of Computers and Parallel Systems Part 6: Microcomputers

Architecture of Computers and Parallel Systems Part 6: Microcomputers Architecture of Computers and Parallel Systems Part 6: Microcomputers Ing. Petr Olivka petr.olivka@vsb.cz Department of Computer Science FEI VSB-TUO Architecture of Computers and Parallel Systems Part

More information

Nubotics Device Interface DLL

Nubotics Device Interface DLL Nubotics Device Interface DLL ver-1.1 Generated by Doxygen 1.5.5 Mon Mar 2 17:01:02 2009 Contents Chapter 1 Module Index 1.1 Modules Here is a list of all modules: Initialization Functions.............................??

More information

- Electronic Limit Switches - Very Accurate - Easy to use - Robust - Dependable - High Resolution - Non Contact Measurement - Wide Temp.

- Electronic Limit Switches - Very Accurate - Easy to use - Robust - Dependable - High Resolution - Non Contact Measurement - Wide Temp. 1-30-2018 EPS 02 Operating Instructions RACO Electronic Position Sensor - Electronic Limit Switches - Very Accurate - Easy to use - Robust - Dependable - High Resolution - Non Contact Measurement - Wide

More information

TMCC160 TMCL FIRMWARE MANUAL

TMCC160 TMCL FIRMWARE MANUAL motioncookie SYSTEM IN A PACKAGE motioncookie TMCC160 TMCL FIRMWARE MANUAL TMCC160 TMCL Firmware Version 2.09 2015-NOV-25 Document Revision 1.0 2015-DEC-04 The TMCL Firmware is used in combination with

More information

MassaSonic PulStar and FlatPack Series Ultrasonic Level Sensors. Serial Communications Guide

MassaSonic PulStar and FlatPack Series Ultrasonic Level Sensors. Serial Communications Guide Guide to MassaSonic PulStar & FlatPack Sensor Serial Communications Page 1 of 26 MassaSonic PulStar and FlatPack Series Ultrasonic Level Sensors Serial Communications Guide March 23, 2016 Tel: 781-749-4800

More information

Clearpath Communication Protocol. For use with the Clearpath Robotics research platforms

Clearpath Communication Protocol. For use with the Clearpath Robotics research platforms Clearpath Communication Protocol For use with the Clearpath Robotics research platforms Version: 1.1 Date: 2 September 2010 Revision History Version Date Description 1.0 26 March 2010 Release 1.1 2 September

More information

Absolute Encoder Multiturn

Absolute Encoder Multiturn Absolute Encoder Multiturn Features Resolution: Singleturn: up to 16,384 (14 Bit) steps per revolution Multiturn: up to 16,777,216 (24 Bit) revolutions Interface: SSI (synchron serial interface) or BiSS

More information

TTC Series Torque Tool Tester Operation Manual

TTC Series Torque Tool Tester Operation Manual TTC Series Torque Tool Tester Operation Manual Operators should wear protection such as a mask and gloves in case pieces or components break away from the unit under test. Whether the unit is ON or OFF,

More information

Simulink Based Robot Arm Control Workstation. Figure 1-1 High Level Block Diagram

Simulink Based Robot Arm Control Workstation. Figure 1-1 High Level Block Diagram Introduction: This project consists of designing a software-based control workstation in the Simulink environment using the SimMechanics Toolbox. The Quanser robot arm system will be modeled using this

More information

Stepper 6 click. PID: MIKROE 3214 Weight: 26 g

Stepper 6 click. PID: MIKROE 3214 Weight: 26 g Stepper 6 click PID: MIKROE 3214 Weight: 26 g Stepper 6 click is the complete integrated bipolar step motor driver solution. It comes with the abundance of features that allow silent operation and optimal

More information

Arduino Smart Robot Car Kit User Guide

Arduino Smart Robot Car Kit User Guide User Guide V1.0 04.2017 UCTRONIC Table of Contents 1. Introduction...3 2. Assembly...4 2.1 Arduino Uno R3...4 2.2 HC-SR04 Ultrasonic Sensor Module with Bracket / Holder...5 2.3 L293D Motor Drive Expansion

More information

micro:bit Lesson 1. Using the Built-in Sensors

micro:bit Lesson 1. Using the Built-in Sensors micro:bit Lesson 1. Using the Built-in Sensors Created by Simon Monk Last updated on 2018-03-02 05:46:13 PM UTC Guide Contents Guide Contents Overview Magnetometer Magnet Detector High-strength 'rare earth'

More information

LV8548MCSLDGEVB. Brush DC Motor Driver Module Solution Kit Quick Start Guide

LV8548MCSLDGEVB. Brush DC Motor Driver Module Solution Kit Quick Start Guide LV8548MCSLDGEVB Brush DC Motor Driver Module Solution Kit Quick Start Guide Overview The LV8548MCSLDGEVB is an ON Semiconductor motor driver module featuring the LV8548MC. This module is capable of easily

More information

ADC to I 2 C. Data Sheet. 10 Channel Analog to Digital Converter. with output via I 2 C

ADC to I 2 C. Data Sheet. 10 Channel Analog to Digital Converter. with output via I 2 C Data Sheet 10 Channel Analog to Digital Converter with output via I 2 C Introduction Many microcontroller projects involve the use of sensors like Accelerometers, Gyroscopes, Temperature, Compass, Barometric,

More information

Grove - I2C Motor Driver

Grove - I2C Motor Driver Grove - I2C Motor Driver Release date: 9/20/2015 Version: 1.0 Wiki: http://www.seeedstudio.com/wiki/grove_-_i2c_motor_driver_v1.3 Bazaar: http://www.seeedstudio.com/depot/grove-i2c-motor-driver-p-907.html

More information

isma-b-mg-ip User Manual Global Control 5 Sp. z o.o. Poland, Warsaw

isma-b-mg-ip User Manual Global Control 5 Sp. z o.o. Poland, Warsaw isma-b-mg-ip User Manual Global Control 5 Sp. z o.o. Poland, Warsaw www.gc5.pl Table of content 1 Introduction... 4 1.1 Revision history... 5 1.2 Safety rules... 5 1.3 Technical specifications... 6 1.4

More information

IME-100 ECE. Lab 4. Electrical and Computer Engineering Department Kettering University. G. Tewolde, IME100-ECE,

IME-100 ECE. Lab 4. Electrical and Computer Engineering Department Kettering University. G. Tewolde, IME100-ECE, IME-100 ECE Lab 4 Electrical and Computer Engineering Department Kettering University 4-1 1. Laboratory Computers Getting Started i. Log-in with User Name: Kettering Student (no password required) ii.

More information

Robotics Adventure Book Scouter manual STEM 1

Robotics Adventure Book Scouter manual STEM 1 Robotics Robotics Adventure Book Scouter Manual Robotics Adventure Book Scouter manual STEM 1 A word with our Scouters: This activity is designed around a space exploration theme. Your Scouts will learn

More information

Input and Output. Arijit Mondal. Dept. of Computer Science & Engineering Indian Institute of Technology Patna

Input and Output. Arijit Mondal. Dept. of Computer Science & Engineering Indian Institute of Technology Patna IIT Patna 1 Input and Output Arijit Mondal Dept. of Computer Science & Engineering Indian Institute of Technology Patna arijit@iitp.ac.in Things to consider IIT Patna 2 Mechanical and electrical properties

More information

Appendix A: Data Registers

Appendix A: Data Registers Appendix A: Data Registers Data registers can be dedicated to a specific purpose, optionally dedicated or continuously available for user data. They can be designated as Read Only or Read & Write. Data

More information

Workbench V Integrated Development Environment for Renesas Capacitive Touch

Workbench V Integrated Development Environment for Renesas Capacitive Touch User s Manual Workbench V1.06.00 Integrated Development Environment for Renesas Capacitive Touch Target Device RX Family User s Manual All information contained in these materials, including products and

More information

DOCUMENT NAME DATE VERSION

DOCUMENT NAME DATE VERSION Programming Manual MP201/MP211 PLC Series DOCUMENT NAME DATE VERSION MIKRODEV_SM_MP211_PM_EN 07 / 2018 1.6 CONTENT 1 LOGIC GATE BLOCKS... 9 1.1 EDGE GATE... 9 1.2 NOT GATE...13 1.3 OR GATE...14 1.4 NOR

More information

Absolute Encoders Multiturn

Absolute Encoders Multiturn The multiturn encoders 6 and 8, with interface and combined optical and magnetic sensor technology, offer a maximum resolution of 5 bits. These encoders are programmable via the Ezturn software. The hollow

More information

EXPERIMENT 7 Please visit https://www.arduino.cc/en/reference/homepage to learn all features of arduino before you start the experiments

EXPERIMENT 7 Please visit https://www.arduino.cc/en/reference/homepage to learn all features of arduino before you start the experiments EXPERIMENT 7 Please visit https://www.arduino.cc/en/reference/homepage to learn all features of arduino before you start the experiments TEMPERATURE MEASUREMENT AND CONTROL USING LM35 Purpose: To measure

More information

Sanguino TSB. Introduction: Features:

Sanguino TSB. Introduction: Features: Sanguino TSB Introduction: Atmega644 is being used as CNC machine driver for a while. In 2012, Kristian Sloth Lauszus from Denmark developed a hardware add-on of Atmega644 for the popular Arduino IDE and

More information

This tutorial will show you how to take temperature readings using the Freetronics temperature sensor and an Arduino Uno.

This tutorial will show you how to take temperature readings using the Freetronics temperature sensor and an Arduino Uno. This tutorial will show you how to take temperature readings using the Freetronics temperature sensor and an Arduino Uno. Note that there are two different module types: the temperature sensor module and

More information

TETRIX DC Motor Expansion Controller Technical Guide

TETRIX DC Motor Expansion Controller Technical Guide TETRIX DC Motor Expansion Controller Technical Guide 44559 Content advising by Paul Uttley. SolidWorks Composer and KeyShot renderings by Tim Lankford, Brian Eckelberry, and Jason Redd. Desktop publishing

More information

LV8548MCSLDGEVB. Stepper Motor Driver Module Solution Kit Quick Start Guide

LV8548MCSLDGEVB. Stepper Motor Driver Module Solution Kit Quick Start Guide LV8548MCSLDGEVB Stepper Motor Driver Module Solution Kit Quick Start Guide Overview The LV8548MCSLDGEVB is an ON Semiconductor motor driver module featuring the LV8548MC. This module is capable of easily

More information

Data sheet CPU 115 (115-6BL02)

Data sheet CPU 115 (115-6BL02) Data sheet CPU 115 (115-6BL02) Technical data Order no. 115-6BL02 Type CPU 115 General information Note - Features 16 (20) inputs 16 (12) outputs from which are 2 PWM 50 khz outputs 16 kb work memory,

More information

FireBeetle ESP8266 IOT Microcontroller SKU: DFR0489

FireBeetle ESP8266 IOT Microcontroller SKU: DFR0489 FireBeetle ESP8266 IOT Microcontroller SKU: DFR0489 Introduction DFRobot FireBeetle is a series of low-power-consumption development hardware designed for Internet of Things (IoT). Firebeetle ESP8266 is

More information

University of Portland EE 271 Electrical Circuits Laboratory. Experiment: Arduino

University of Portland EE 271 Electrical Circuits Laboratory. Experiment: Arduino University of Portland EE 271 Electrical Circuits Laboratory Experiment: Arduino I. Objective The objective of this experiment is to learn how to use the Arduino microcontroller to monitor switches and

More information

Wall-Follower. Xiaodong Fang. EEL5666 Intelligent Machines Design Laboratory University of Florida School of Electrical and Computer Engineering

Wall-Follower. Xiaodong Fang. EEL5666 Intelligent Machines Design Laboratory University of Florida School of Electrical and Computer Engineering Wall-Follower Xiaodong Fang EEL5666 Intelligent Machines Design Laboratory University of Florida School of Electrical and Computer Engineering TAs: Tim Martin Josh Weaver Instructors: Dr. A. Antonio Arroyo

More information

m-block By Wilmer Arellano

m-block By Wilmer Arellano m-block By Wilmer Arellano You are free: to Share to copy, distribute and transmit the work Under the following conditions: Attribution You must attribute the work in the manner specified by the author

More information

Pmod modules are powered by the host via the interface s power and ground pins.

Pmod modules are powered by the host via the interface s power and ground pins. 1300 Henley Court Pullman, WA 99163 509.334.6306 www.store. digilent.com Digilent Pmod Interface Specification 1.2.0 Revised October 5, 2017 1 Introduction The Digilent Pmod interface is used to connect

More information

Programmable Device Interface PDI-1 A Versatile Hardware Controller with USB interface

Programmable Device Interface PDI-1 A Versatile Hardware Controller with USB interface Programmable Device Interface PDI-1 A Versatile Hardware Controller with USB interface Features and Specifications Arduino compatible for simple USB Programming 126 x 64 Graphic LCD 12x Digital IO ports*

More information

NXShield Interface Specifications

NXShield Interface Specifications NXShield Advanced Development Guide v1.0 NXShield Interface Specifications Power Specs: NXShield can be powered from external power supply. Max Power Rating: 10.5 Volts DC Minimum 6.6 Volts DC needed to

More information

Rotary Encoder Basics

Rotary Encoder Basics Rotary Encoder Basics A rotary encoder has a fixed number of positions per revolution. These positions are easily felt as small clicks you turn the encoder. The Keyes module that I have has thirty of these

More information

Data Sheet MEM 16. Absolute Encoder Multiturn

Data Sheet MEM 16. Absolute Encoder Multiturn Absolute Encoder Multiturn Features Resolution: Singleturn: up to 8,192 (13 Bit) steps per revolution Multiturn: up to 4,294,967,296 (32 Bit) revolutions Interface: SSI (synchron serial interface) or BiSS

More information

User manual. Actuator with RS485/SIKONETZ5 interface AG03/1

User manual. Actuator with RS485/SIKONETZ5 interface AG03/1 User manual Actuator with RS485/SIKONETZ5 interface AG03/1 1 General Information... 4 1.1 DOCUMENTATION... 4 2 Block diagram... 4 3 Display and operating elements... 5 3.1 GENERAL INFORMATION... 5 3.2

More information