Edit on GitHub

Programming

Controller Parameters

Remocon TXD

This parameter is used to transmit data via a wireless communication module (IR, zigbee module).

NOTE : Compatiable Controllers : CM-100, CM-5, CM-510, CM-530, CM-700

Example

In the example below, the program waits for data, and when the data arrives, the received data is transmitted wirelessly.

It is commonly used to send a response to the control program on a PC connected using ZIG2Serial.

Remocon TXD

Remocon RXD

This parameter is used to read the received data received via the wireless communication module (IR, zigbee module).

NOTE : Compatiable Controllers : CM-100, CM-5, CM-510, CM-700

Example

The code below shows how to control movement direction using the RC-100.

Remocon RXD

Remocon Arrived

This parameter is used to check whether there are any new data received via the wireless communication module(IR, zigbee module).

This value is either TRUE or FALSE.

NOTE : Compatiable Controllers : CM-100, CM-5, CM-510, CM-530, CM-700

Example

The code below shows how to control movement direction using RC-100.

Normally used to check whether new data has been received to process.

Remocon Arrived

Aux LED

This parameter is either TRUE or FALSE and used to read and set the controller’s Aux LED status.

NOTE : Compatiable Controllers : CM-5, CM-510, CM-530, CM-700

Example

In this example, the Aux LED is turned on and off for 1 second 3 times.

Aux LED

Button

This parameter is used to read the controller’s button status.

NOTE : Compatiable Controllers : CM-5, CM-510, CM-530, CM-700, OpenCM9.04

Button

Example

This example shows how to perform different motions depending on which button is pressed.

Button Example

Timer

This parameter is used read the timer’s current value or to set the timer, which begins to count down automatically. The timer is located in the controller.

You can use “Timer value” constant to set the timer’s value.

Timer

When a decimal number is entered, it will automatically be converted to the corresponding timer value. The actual timer value is between 0 and 255. Each timer value is 0.128 seconds. If you set a value greater than 0 in the timer parameter, the timer will start to count down every 0.128 seconds.

NOTE : Compatiable Controllers : CM-100, CM-5, CM-510, CM-530, CM-700

Example

The code below will print the value from the Center IR sensor every second.

Timer Example

HR Timer

Internally the controller sets a counter; this is the parameter for the high resolution timer. This timer is set for every 1ms, useful for more accurate timing.

HR Timer 01 HR Timer 02

NOTE : Compatiable Controllers : CM-530

Example

While in fast forward motion the timer can help the tires react faster upon detection of a line.

HR Timer Example

Remocon ID

This parameter is used to set or read the currently set remote control ID. Please note that the controller will not receive any data if this parameter does not match the ID of the transmitting remote.

NOTE : Compatiable Controllers : CM-5, CM-510, CM-530, CM-700

Example

This example sets the opponent’s wireless ID to “123”, reads the value, and prints it on the screen.

Remocon ID

My ID

NOTE : Compatiable Controllers : CM-100, CM-5, CM-510, CM-530, CM-700

Example

This example checks whether a ZIG-110 module is installed in the CM-100 controller. If the module is not installed, it sets the RC-100 channel according to the number of times the start button is pressed.

My ID Example 01

This example prints the ZigBee module’s ID. This code can be used with controllers other than CM-100.

My ID Example 02

Controllers usually do not have display devices the way a PC has a monitor, so it is hard to keep track of what goes on in a controller. Therefore, a “terminal” is used to “borrow” the PC’s monitor.

terminal

Open the Program Output Monitor

To see the output of the program, you must open the Program Output Monitor BEFORE executing the program. There are three ways to open the Program Output Monitor.

  1. Click the ‘View Print of Program’ on the Download Program window.

    output-monitor

  2. Click the View Print of Program button in the tool bar.
  3. Press F5 or click on View Print of Program(V) menu under Program(P).

Print/Print with Carriage Return

Use the “Print” parameter in your task code to see desired values on the screen.

task code

Print : Print the value, then move the cursor to next line.

print

Print with New Line: Print out the value, and move the cursor to next line.

newline

Error : Please check the following

  1. Values from the controller
    • A welcome screen is shown when the program starts

      start-message

    • Error messages during program operation([Error Messages])

      error-code

  2. Values from task code : All decimal numbers between -32767 and +32767 can be displayed(Printing characters or custom messages is not possible).

    • To print numbers

      print-num

    • To print values from sensors

      print-sensor

Clear Screen

You may erase everything on the screen.

clear-screen

IR Left/Center/Right

This parameters are used to read the IR sensors’ values.

NOTE : Compatiable Controllers : CM-100

Example

In this example, specific motions are performed when only the left IR sensor detects an object or when only the right IR sensor detects an object..

Controller IR Sensor

Buzzer Index

This parameter is used to set the musical note or melody to be played or to retrieve the note or melody currently being played using the buzzers in the controller.

NOTE : Compatiable Controllers : CM-100, CM-510, CM-530

Example

Plays melody 3.

Buzzer Example 01

Plays Do, Mi and Sol for 0.3 seconds each.

Buzzer Example 02

Buzzer Time

This parameter is used to set how long the note or melody will be played or to retrieve how much longer it will be played.

NOTE : Compatiable Controllers : CM-100, CM-510, CM-530

Example

Plays melody 3. (Same as the example in “Buzzer Index”)

Buzzer Example 01

Plays Do, Mi and Sol for 0.3 seconds each.(Same as the example in “Buzzer Index”)

Buzzer Example 02

Sound Count

A controller equipped with a microphone has a function to count sounds when the sound is louder than a certain threshold. For example, it is possible to count claps. This parameter is used to retrieve the number of detected sounds.

NOTE : Compatiable Controllers : CM-100, CM-510, CM-530

Example

Detects sounds and repeats a specific motion for as many times as it is detected.

Sound Count

Current Sound Count

A controller equipped with a microphone has a function to count sounds when the sound is louder than a certain threshold. For example, it is possible to count claps. This parameter is used to retrieve the number of detected sounds.

NOTE : Compatiable Controllers : CM-100, CM-510

Example

This code saves the current sound count in the “DetectionCount” variable.

Current Sound Count Example 01

This code pauses the program when no sounds are detected.

Current Sound Count Example 02

This code executes a block of code when 3 sounds are detected.

Current Sound Count Example 03

Button Count

This parameter is used to read how many times the START button was pressed when the controller was first turned on.

“Button Counts” uses numbers between 0 and 255. As a result, only up to 255 button presses can be counted .

NOTE : Compatiable Controllers : CM-100, CM-150

Example

The example executes different motions according to how many times the START button was pressed - once, twice, or more.

Button Example

Powersave Timer

The controller has a hibernate function to conserve battery. If no commands are received for a set period, the controller can turn itself off. This parameter is used to set how long the controller will wait or how much time is left.

NOTE : Compatiable Controllers : CM-100, CM-150

Example

The controller will be turned off if no data is received for 2 minutes. If data is received, the timer is reset to 2 minutes.

Powersave Example

RC-100 Channel

This parameter is used to set up the infrared communication channel or to check the current channel between the controller’s IR receiver and RC-100.

NOTE : Compatiable Controllers : CM-100, CM-510, CM-530

Example

Sets the RC-100 channel according to how many times the START button was pressed.

RC100 Example

Motion Parameters

Motion Page

This parameter executes motions.

NOTE : Compatiable Controllers : CM-5, CM-510, CM-530, CM-700

Example

Executes motion page #3.

Motion Page

Motion Status

This parameter is used to check the status of the motion.

NOTE : Compatiable Controllers : CM-5, CM-510, CM-530, CM-700

Example

Executes motion page #3 and waits until it is completed.

Motion Status

Joint Offset

To apply the joint offset to a robot, a motion must be performed after the “Joint Offset” parameter is set.

This parameter can be applied to each joint separately.

NOTE : Compatiable Controllers : CM-5, CM-510, CM-530, CM-700

Example

Peripheral Devices

Peripheral devices are modules connected directly to the controller. The followings are peripheral devices.

Reduction Motor

This parameter is used to control the reduction motor’s direction and power (Speed). (Please refer to the Geared Motor GM-12A for more information)

The control values are numbers between 0 and 2047.

NOTE : Compatiable Controllers : CM-100

Example

In this example, the reduction motor connected to Port 1 will rotate in the clockwise direction for 1 second at maximum speed, before rotating in the counterclockwise direction for 1 second. These motions will repeat without end.

Reduction Motor Example

Tips

Reduction Motor Tips

Servo Motor

This parameter is used to set the movements of servo motors. This parameter consists of 3 sub-parameters (move mode, speed, location), it helps to set up the movement of servo motor in more detailed way. (Please refer to the Servo Motor SM-10A for more information)

For detailed information about controllable angles, refer to the Servo Motor SM-10A.

NOTE : Compatiable Controllers : CM-100

Example

Set the servo motor at Port 3 in rotation mode and turn it clockwise with 600 outputs.

SM-10A Example_01

Set the servo motor at Port 3 in joint mode and move it to location 500 with maximum speed.

SM-10A Example_02

Tips

WARNING : If a program that controls LED modules is executed while another module (servo motor, IR module, etc.) is connected to the port, the module may be damaged.

Touch Sensor

This parameter is used to read the status of touch sensor (whether is was touched or not) (Please refer to the Touch Sensor TS-10 for more information)

While the sensor being touched, the returned value will be TRUE(1). However, if you take off your hands from touch sensor, the returned value will be reset as False(0).

NOTE : Compatiable Controllers : CM-100, CM-510, CM-700

Example

This example executes a block of code when the touch sensor at Port 3 is touched.

TS-10 Example

LED Module

This parameter is used to turn on the LED or to read its current status. (Please refer to the LED Module LM-10 for more information)

NOTE : Compatiable Controllers : CM-100

Example

Turn on both LEDs connected to Port 3.

LED Module Example

WARNING : If a program that controls LED modules is executed while another module (servo motor, IR module, etc.) is connected to the port, the module may be damaged.

IR Sensor

This parameter is used to read the value of the IR sensor module. (Please refer to the IR Sensor IRSS-10 for more information)

NOTE : Compatiable Controllers : CM-100, CM-510, CM-700

Example

This example executes a block of code if the value of the IR sensor connected to Port 3 is less than 500.

IR Sensor

WARNING : If a program that controls IR modules is executed while another module (servo motor, LED module, etc.) is connected to the port, the module may be damaged.

DMS Sensor

This parameter is used to read the value of the DMS sensor. (Please refer to the Distance Measurement Sensor DMS-80 for more information)

NOTE : Compatiable Controllers : CM-510, CM-700

Example

This example executes a block of code if the value of the DMS sensor connected to Port 3 is less than 500.

DMS Example

User Devices

This parameter is used to set or read the values of user’s devices. (Please refer to the Custom Device for more information)

NOTE : Compatiable Controllers : CM-510, CM-700

Example

After setting the user’s device at Port 3 as 1 (high), if the value read value from Port 3 is less than 500, the output port is set as 0 (low).

User Device Example

DYNAMIXEL Parameters

Torque Enable

This parameter is used to turn the motor’s torque on or off. It can also be used to determine whether the motor’s torque is currently on or off.

The value is either TRUE or FALSE.

Example

When the R button of the controller is pressed, the actuator with ID 1 will turn on. When the L button is pressed, it will turn off.

Torque Enable

LED

This parameter is used to set or read DYNAMIXEL LED status.

The value is either TRUE or FALSE.

Example

Turns the LED on for 1 second and turns it off.

LED

CW/CCW Margin

These parameters are NOT available for MX Series. These parameters are used to set or read the actuator’s margin value.

Example

Set both margins as 1.

CWCCW Margin

CW/CCW Slope

These parameters are NOT available for MX Series.

These parameters are used to set or read the actuator’s slope value.

Level Real Data Value Representative Data Value
1 0 (0x00) ~ 3(0x03) 2 (0x02)
2 4(0x04) ~ 7(0x07) 4 (0x04)
3 8(0x08)~15(0x0F) 8 (0x08)
4 16(0x10)~31(0x1F) 16 (0x10)
5 32(0x20)~63(0x3F) 32 (0x20)
6 64(0x40)~127(0x7F) 64 (0x40)
7 128(0x80)~254(0xFE) 128 (0x80)

NOTE : Compatiable Controllers : CM-5, CM-510, CM-700

Example

Sets both slope values as 32. Binary numbers are used to set the parameter.

CWCCW Slope

PID Gain

These parameters are NOT available for AX, DX, RX and EX Series. Parameters for the actuator’s set PID values.

Example

Set the P and I value 32

PID Gain

Goal Position

This parameters is used to set or read the actuator’s goal position.

Goal Position

Example

When the R button of the controller is pressed, the goal position of the actuator with ID 1 will be set as 1. When the L button is pressed, the goal position will be set as 1023.

Goal Position Example

Moving Speed

This parameter is used to set or read the speed of actuator.

Example

When the R button of the controller is pressed, the speed of the actuator with ID1 will be set as 0. When the L button is pressed, the speed will be set as 500. (If the actuator is in joint mode, the speed of 0 equates to maximum output. )

Moving Speed Example

Torque Limit

This parameter is used to set or read the power status of actuator.

Example

Set the maximum torque of the actuator with ID 1 as 500.

Torque Limit Example

Present Position

This parameter is used to read the actuator’s current position.

Example

Prints the present position of the actuator with ID 1 on the screen.

Present Position Example

Present Speed

This parameter is used to read the actuator’s current speed.

Example

Prints the present speed of the actuator ID 1 on the screen.

Present Speed Example

Present Load

This parameter is used to read the actuator’s current load.

Example

Prints the present load of the actuator with ID 1 on the screen.

Present Load Example

Voltage

This parameter is used to read DYNAMIXEL current voltage.

Example

Prints the current voltage of DYNAMIXEL with ID 1 on the screen.

Voltage Example

Temperature

This parameter is used to read DYNAMIXEL current temperature.

Example

Prints the present temperature of DYNAMIXEL with ID 1 on the screen.

Temperature Example

Moving

This parameter is used to determine whether the actuator is currently moving or not.

Example

Sets the goal position of the actuator with ID 1 as 0, and waits for it to stop moving.

Moving Example

Sensed Current

This parameter is NOT available for AX, DX and RX Series. This parameter is used to check the current being consumed. You can read EX Series motor’s current with this parameter.

Example

If the current of the EX motor with ID 1 is larger than 1A and flowing in the clockwise direction, the LED will turn on. Otherwise, If it is larger than 2A, the motor will be turned off.

Sensed Current Example

Universal Sensor S1

IR Left/Center/Right

These parameters are used to read the current IR sensor value from the universal sensor(AX-S1).

Example

In this example, specific motions are performed when only the left IR sensor detects an object or when only the right IR sensor detects an object.

IR LCR

Tip

Light Left/Center/Right

This parameter is used to read the current light brightness from the universal sensor(S1).

Example

A block of code is executed when the left sensor detects brightness over 200.

Light LCR

Object Detected

This parameter is used to determine whether an object is detected within a certain distance from an IR sensor (Left/Center/Right) of the universal sensor(S1).

Object Detected

Binary value Decimal value   Meaning in Object Detected Commands
000 0 Not detected  
001 1 Detected by left sensor  
010 2 Detected by center sensor  
011 3 Detected by left and center sensors  
100 4 Detected by right sensor  
101 5 Detected by right and left sensors  
110 6 Detected by right and center sensors  
111 7 Detected by every sensor  

Example

The object detection threshold is set as 50, and a block of code will be executed when an object is detected within the threshold.

Object Detected Ex

Light Detected

This parameter is used to determine whether a light is detected within a certain distance from an IR sensor (Left/Center/Right) of the universal sensor(S1). Compatible Controller

Binary value Decimal value Meaning in Light Detection Commands
000 0 Not detected
001 1 Detected by left sensor
010 2 Detected by center sensor
011 3 Detected by left and center sensors
100 4 Detected by right sensor
101 5 Detected by right and left sensors
110 6 Detected by right and center sensors
111 7 Detected by every sensor

Example

The light detection threshold is set as 50, and a block of code will be executed when a light is detected within the threshold.

Light Detected Ex

Sound Max Data

This parameter is used to set or read the maximum sound data of the universal sensor(S1).

NOTE : Compatiable Controllers : CM-5, CM-510, CM-700

Example

Initialize “Sound max data” as 0 and execute a block of code when it exceeds 200.

Sound Max

Sound Data

This parameter is used to read the current sound level of the universal sensor (S1).

NOTE : Compatiable Controllers : CM-5, CM-510, CM-700

Example

Prints the current sound volume on the screen.

Sound Data

Sound Count

This parameter is used to read or initialize the number of sounds detected by the universal sensor(S1).

Example

Initializes “Sound count” as 0 and wait for a sound to be detected. Then, call the “Play” function.

Sound Count

Sound Time

This parameter is used to set or read how long the sound will be played.

Example

The following example uses two AX-S1 sensors to determine the direction of the detected sound.

Sound Time

Buzzer Index

This parameter is used to set or read the musical note played by the buzzer of the universal sensor (S1).

Example

Plays melody #3.

Buzzer Index Ex01

Plays Do, Mi, and Sol for 0.3 seconds each.

Buzzer Index Ex02

Buzzer Time

This parameter is used to set or read how long the sound is played by the buzzer of the universal sensor (S1).

NOTE : Compatiable Controllers : CM-5, CM-510, CM-700

Example

Plays melody #3 .

Buzzer Time Ex01

Plays Do, Mi and Sol for 0.3 seconds each. (Same as the example in “Buzzer Index”)

Buzzer Time Ex02

IR COM Arrived

This parameter is used to check whether there are any new data received via the wireless communication module.

Example

Waits for new data to arrive and executes a block of code when the received data is 100.

IR COM Arrived

IR COM RXD

This parameter is used to read the data received via the wireless communication module.

NOTE : Compatiable Controllers : CM-5, CM-510, CM-700

Example

Waits for new data to arrive and executes a block of code when the received data is 100.

IR COM RXD

IR COM TXD

This parameter is used to transmit data via a wireless communication module.

NOTE : Compatiable Controllers : CM-5, CM-510, CM-700

Example

Waits for new data to arrive, and when the data arrives, the received data is transmitted wirelessly.

IR COM TXD

Object Detection Threshold

This parameter is used to set or read the object detection threshold.

NOTE : Compatiable Controllers : CM-5, CM-510, CM-700

Example

The object detection threshold is set as 50, and a block of code will be executed when an object is detected within the threshold.

Object Detection Threshold

Light Detection Threshold

This parameter is used to set or read the light detection threshold of the universal sensor (S1).

NOTE : Compatiable Controllers : CM-5, CM-510, CM-700

Example

The light detection threshold is set as 50, and a block of code will be executed when a light is detected within the threshold.

Light Detection Threshold

IR Sensor Array

IR Sensor Value

These parameters are used to read the current IR sensor value from the IR Sensor Array.

Example

Detected values can emit different sounds as following the array’s values.

IR Sensor Value

Tip

IR Array Buzzer Index

This parameter is used to set or read the musical note played by the buzzer of the ir sensor array

Example

Plays melody #3.

Buzzer Index 03

Plays Do, Mi, and Sol for 0.3 seconds each.

Buzzer Index 04

IR Array Buzzer Time

This parameter is used to set or read how long the sound is played by the buzzer of the ir sensor array.

Example

Plays melody #3.

Buzzer Index 03

Plays Do, Mi, and Sol for 0.3 seconds each.

Buzzer Index 04

Auto Threshold Mode

Parameters for set black values and automatic detection start/set.

Example

During a ‘1’ the LED will turn on, detecting a white or black then the array automatically sets values.

Auto Thresh

IR Obstacle Detected

Paramenters to determine IR array obstacle values

Binary value Decimal Value Black Detection
0000001 1 Black detection for IR sensor #1
0000010 2 Black detection for IR sensor #2
0000100 4 Black detection for IR sensor #3
0001000 8 Black detection for IR sensor #4
0010000 16 Black detection for IR sensor #5
0100000 32 Black detection for IR sensor #6
1000000 64 Black detection for IR sensor #7

Example

Set sensor #1 to 100; when sensor #1 detects black do a specified action.

IR Obstacle Ex

IR Threshold

Reference black/white for the IR array

  Black Detection LED
Sensor value <= set value BIT 1 ON
Sensor value > set value BIT 0 OFF

Example

Set sensor #1 to 100; when sensor #1 detects black do a specified action.

IR Thresh EX

Direct Access

The address of peripheral devices such as DYNAMIXEL’s can be accessed directly and read from or written to.

NOTE : Compatiable Controllers : CM-5, CM-510, CM-700

Example

Write 0 at word address 25 of DYNAMIXEL with ID 105.

Direct Access 01

Print the value stored in the word address 25 of DYNAMIXEL with ID 105.

Direct Access 02

Variables

This is a storage place inside a program capable of saving, editing, and reading data.

Example

Variables may be used for many purposes. Existing Variables are listed in the “Set Device or Number” window.

Variables

Tip

Variables are useful when a number to be remembered, when a value must be changed depending on the situation, or when multiple values must be changed at once.