Problem
Solution
Since HARK itself is software for audition processing, a module describing the control of a motor is not included. However, when performing comparatively simple control, a module can be designed to control a motor. This section describes how a method of implementing this function in the client part of HARK as a module by dividing control of a motor into applications of server and client. The following is an example of the main processing of the client module.
function calculat
if count = 0 then
set_IP_address_and_PORT_number
connect_to_server
endif
obtain_input
generate_control_input
send_control_input
check_motor_state
disconnect_to_server
Discussion
Since Flowdesigner is data flow-oriented, the presence of even one node that requires a long time for processing, makes real-time processing difficult in some cases. Therefore, processing on Flowdesigner consists of generating a command to control a motor, with the load reduced by operating the motor in other server applications. Moreover, dividing into a server and a client enables another motor to be controlled simply by changing the interface.
See Also
For motor control, see “Creation of node” in 12.1. For the combined control of a more complicated motor or other sensors, see “Control of robot” in 12.2.