WO2021187268A1 - 機械学習装置、数値制御システム、設定装置、数値制御装置、及び機械学習方法 - Google Patents

機械学習装置、数値制御システム、設定装置、数値制御装置、及び機械学習方法 Download PDF

Info

Publication number
WO2021187268A1
WO2021187268A1 PCT/JP2021/009488 JP2021009488W WO2021187268A1 WO 2021187268 A1 WO2021187268 A1 WO 2021187268A1 JP 2021009488 W JP2021009488 W JP 2021009488W WO 2021187268 A1 WO2021187268 A1 WO 2021187268A1
Authority
WO
WIPO (PCT)
Prior art keywords
tool
machine learning
value
information
time
Prior art date
Application number
PCT/JP2021/009488
Other languages
English (en)
French (fr)
Inventor
佳之 鈴木
Original Assignee
ファナック株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ファナック株式会社 filed Critical ファナック株式会社
Priority to DE112021001677.6T priority Critical patent/DE112021001677T5/de
Priority to JP2022508254A priority patent/JP7436632B2/ja
Priority to CN202180021050.6A priority patent/CN115280252A/zh
Priority to US17/802,420 priority patent/US20230083761A1/en
Publication of WO2021187268A1 publication Critical patent/WO2021187268A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/18Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form
    • G05B19/404Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form characterised by control arrangements for compensation, e.g. for backlash, overshoot, tool offset, tool wear, temperature, machine construction errors, load, inertia
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/18Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form
    • G05B19/4155Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form characterised by programme execution, i.e. part programme or machine function execution, e.g. selection of a programme
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/18Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form
    • G05B19/406Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form characterised by monitoring or safety
    • G05B19/4065Monitoring tool breakage, life or condition
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B13/00Adaptive control systems, i.e. systems automatically adjusting themselves to have a performance which is optimum according to some preassigned criterion
    • G05B13/02Adaptive control systems, i.e. systems automatically adjusting themselves to have a performance which is optimum according to some preassigned criterion electric
    • G05B13/0265Adaptive control systems, i.e. systems automatically adjusting themselves to have a performance which is optimum according to some preassigned criterion electric the criterion being a learning criterion
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/30Nc systems
    • G05B2219/37Measurements
    • G05B2219/37346Cutting, chip quality
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/30Nc systems
    • G05B2219/40Robotics, robotics mapping to robotics vision
    • G05B2219/40499Reinforcement learning algorithm
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/30Nc systems
    • G05B2219/49Nc machine tool, till multiple
    • G05B2219/49065Execute learning mode first for determining adaptive control parameters
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/30Nc systems
    • G05B2219/50Machine tool, machine tool null till machine tool work handling
    • G05B2219/50308Estimate wear from machining data and conditions

Definitions

  • the present invention relates to a machine learning device, a numerical control system, a setting device, a numerical control device, and a machine learning method.
  • the cutting amount and cutting speed for one fixed cycle such as rubbing, tapping, boring, turning cycle, etc. are empirically determined by the operator by repeating test machining, etc., with the material and shape of the workpiece and tool as the main factors. decide.
  • using the crust created by cluster analysis based on state variables including machining condition data, cutting condition data, machining result data, and tool data as a trained model, newly input machining conditions, cutting conditions, and machining A technique is known in which an appropriate tool is determined based on the result, and the maximum value of the cutting speed is determined within a range in which a specified good result can be maintained in the determined tool cluster. For example, see Patent Document 1.
  • One aspect of the machine learning device of the present disclosure is a machine learning device that performs machine learning on a numerical control device that operates a machine tool based on a machining program, and has at least one cutting amount and cutting speed.
  • the numerical control device By executing the machining program in which is set, the numerical control device causes the machine tool to perform cutting, thereby acquiring state information including the cutting amount for one time and the cutting speed.
  • the acquisition unit, the action information output unit that outputs the action information including the cutting amount for one time and the adjustment information of the cutting speed included in the state information, at least the strength of the pressure applied to the tool in the cutting process, and the above.
  • Judgment information which is information about the shape of the waveform of the pressure applied to the tool and the time required for machining, is acquired, and based on the acquired judgment information, a reward value in reinforcement learning according to a predetermined condition is output. It is provided with a reward calculation unit 221 for updating the value function, and a value function update unit that updates the value function based on the reward value, the state information, and the action information.
  • One aspect of the setting device of the present disclosure is to select one of the actions acquired from the machine learning device of (1) based on a preset threshold value, and process the selected action. Set in the program.
  • One aspect of the numerical control system of the present disclosure is a machine learning device of (1), a setting device of (2), and a numerical control device for executing the machining program set by the setting device. Be prepared.
  • One aspect of the numerical control device of the present disclosure includes the machine learning device of (1) and the setting device of (2), and executes the machining program set by the setting device.
  • One aspect of the numerical control method of the present disclosure is a machine learning method of a machine learning device that performs machine learning on a numerical control device that operates a machine tool based on a machining program, and cuts at least once.
  • the machine tool is made to perform the cutting, so that the state information including the cutting amount for one time and the cutting speed can be obtained. It acquires and outputs action information including the cutting amount for one time and the adjustment information of the cutting speed included in the state information, and at least the strength of the pressure related to the tool in the cutting process and the pressure related to the tool.
  • Judgment information which is information about the shape of the waveform and the time required for processing, is acquired, and based on the acquired determination information, a reward value in reinforcement learning according to a predetermined condition is output, and the reward value is combined with the reward value.
  • the value function is updated based on the state information and the behavior information.
  • the machining program can be optimized without increasing the labor of the operator.
  • FIG. 3 is a flowchart illustrating a detailed processing content of the reward calculation processing shown in step S16 in FIG. It is a flowchart which shows the operation at the time of generating the optimization action information by the optimization action information output part.
  • FIG. 3 is a flowchart which shows the functional configuration example of the numerical control system which concerns on 2nd Embodiment. It is a functional block diagram which shows the functional configuration example of the machine learning apparatus.
  • FIG. 1 is a functional block diagram showing a functional configuration example of the numerical control system according to the first embodiment.
  • the numerical control system 1 includes a machine tool 10 and a machine learning device 20.
  • the machine tool 10 and the machine learning device 20 may be directly connected to each other via a connection interface (not shown). Further, the machine tool 10 and the machine learning device 20 may be connected to each other via a network (not shown) such as a LAN (Local Area Network) or the Internet. In this case, the machine tool 10 and the machine learning device 20 include a communication unit (not shown) for communicating with each other by such a connection.
  • the numerical control device 101 is included in the machine tool 10, but may be a device different from the machine tool 10. Further, the numerical control device 101 may include a machine learning device 20.
  • the machine tool 10 is a machine tool known to those skilled in the art, and includes a numerical control device 101.
  • the machine tool 10 operates based on an operation command from the numerical control device 101.
  • the numerical control device 101 is a numerical control device known to those skilled in the art, and includes a setting device 111.
  • the numerical control device 101 generates an operation command based on a machining program acquired from an external device (not shown) such as a CAD / CAM device, and transmits the generated operation command to the machine tool 10.
  • the numerical control device 101 controls the operation of the machine tool 10.
  • the rotation speed and the motor current in the motors such as the spindle motor of the spindle (not shown) and the servo motor of the feed shaft (not shown) included in the machine tool 10.
  • Values and torques may be obtained from the machine tool 10 at predetermined time intervals such as preset sampling times.
  • the numerical control device 101 may acquire temperatures such as a motor temperature, a machine temperature, and an ambient temperature measured by a sensor such as a temperature sensor (not shown) included in the machine tool 10 from the machine tool 10. Further, the numerical control device 101 acquires axial and rotational pressures on a tool attached to a spindle (not shown) measured by a sensor such as a pressure sensor (not shown) included in the machine tool 10 from the machine tool 10. May be good. Further, the numerical control device 101 may acquire the time required for the machine tool 10 when the machine tool 10 measured by a cycle counter or the like (not shown) included in the machine tool 10 performs a predetermined cutting process. In this embodiment, as described above, since the machining program includes only one fixed cycle, the time required for machining is equivalent to the cycle time.
  • the numerical control device 101 is, for example, the material of the tool attached to the spindle (not shown) of the machine tool 10, the shape of the tool, the tool diameter, the tool length, the remaining tool life, the material of the work to be machined, and the tool catalog.
  • the cutting conditions and the like may be output to the machine learning device 20 described later.
  • the numerical control device 101 has a spindle rotation speed, a motor current value, a machine temperature, an ambient temperature, a strength of pressure applied to the tool (axial direction and rotation direction) acquired from the machine tool 10, and a waveform of the pressure applied to the tool.
  • Shape (axial direction and rotation direction), strength of torque applied to feed shaft, shape of waveform of torque applied to feed shaft, strength of torque applied to spindle, shape of waveform of torque applied to spindle, and processing The required time may be output to the machine learning device 20 described later.
  • the numerical control device 101 is, for example, a tool for managing all tools attached to the spindle (not shown) of the machine tool 10 in a storage unit (not shown) such as an HDD (Hard Disk Drive) included in the numerical control device 101.
  • a management table (not shown) may be stored.
  • the numerical control device 101 acquires the tool material, the tool shape, the tool diameter, the tool length, and the remaining tool life from the tool management table (not shown) based on the tool number or the like set in the machining program. You may do it.
  • the remaining tool life may be obtained from, for example, the service life obtained from the correspondence table described in the catalog and regarded as the tool life, and may be obtained from the working time for each work.
  • the remaining tool life of the tool management table may be updated with the obtained value.
  • the numerical control device 101 is, for example, a material of a workpiece to be machined, cutting conditions of a tool catalog, etc. by an operator's input operation via an input device (not shown) such as a keyboard or a touch panel included in the numerical control device 101. May be obtained.
  • the shape of the waveform of the pressure applied to the tool is time series data of the pressure applied to the tool.
  • the shape of the waveform of the torque applied to the feed shaft is time series data of the torque applied to the feed shaft.
  • the shape of the torque waveform applied to the spindle is time-series data of the torque applied to the spindle.
  • the setting device 111 selects one of the actions acquired from the machine learning device 20 described later based on a preset threshold value, and sets the selected action in the machining program. Specifically, the setting device 111 compares the remaining tool life of the tool used in the machine tool 10 with a preset threshold value (for example, 10%), so that the remaining tool life is larger than the threshold value. In this case, the action that prioritizes the machining time is selected, and when the remaining tool life is less than the threshold value, the action that prioritizes the tool life is selected. The setting device 111 sets the selected action in the machining program.
  • the setting device 111 can be configured by a computer such as a numerical control device 101 provided with an arithmetic processing device such as a CPU. Further, the setting device 111 may be a device different from the numerical control device 101.
  • the machine learning device 20 is a device that reinforces learning the cutting amount and cutting speed for each work when the machine tool 10 is operated by the numerical control device 101 executing a machining program.
  • reinforcement learning is not limited to Q-learning.
  • the agent (corresponding to the machine learning device 20 in the present embodiment) observes the state of the environment (corresponding to the machine tool 10 and the numerical control device 101 in the present embodiment), selects a certain action, and is based on the selected action.
  • the environment changes. As the environment changes, some rewards are given, and agents learn to choose better behaviors based on the rewards given. Whereas supervised learning gives a complete answer, rewards in reinforcement learning are often fragmentary values based on some changes in the environment. For this reason, the agent learns to maximize the total rewards that will be earned in the future.
  • any learning method can be used as reinforcement learning, but in the following description, the value function Q (s, a) that selects the action a is learned under the state s of a certain environment.
  • Q-learning which is a method, will be described.
  • the purpose of Q-learning is to select the action a having the highest value of the value function Q (s, a) as the optimum action from the actions a that can be taken in a certain state s.
  • the correct value of the value function Q (s, a) is not known at all for the combination of the state s and the action a. Therefore, the agent selects various actions a under a certain state s, and for the action a at that time, selects a better action based on the reward given, so that the correct value function Q ( Learn s, a).
  • s t represents the state of the environment at time t
  • a t represents the action at time t.
  • the state changes to s t + 1.
  • rt + 1 represents the reward obtained by changing the state.
  • the term with max is obtained by multiplying the Q value when the action a having the highest Q value known at that time is selected under the state st + 1 by ⁇ .
  • is a parameter of 0 ⁇ ⁇ 1 and is called a discount rate.
  • is a learning coefficient and is in the range of 0 ⁇ ⁇ 1.
  • Q-learning there is a method of creating a table of Q (s, a) for all state-behavior pairs (s, a) and performing learning.
  • the number of states is too large to obtain the Q (s, a) values of all the state-behavior pairs, and it takes a lot of time for Q-learning to converge.
  • DQN Deep Q-Network
  • the value function Q is constructed by using an appropriate neural network
  • the value function Q (s, a) is approximated by approximating the value function Q with an appropriate neural network by adjusting the parameters of the neural network.
  • the value of may be calculated.
  • DQN it is possible to shorten the time required for Q-learning to converge.
  • DQN for example, there is a detailed description in the following non-patent documents.
  • the machine learning device 20 performs the Q-learning described above. Specifically, the machine learning device 20 works by executing the information about the tool and the work set in the machine tool 10, the cutting amount and the cutting speed for one time set in the fixed cycle, and the machining program. The value Q of selecting the measured value acquired from the machine 10 and the setting and change of the cutting amount and cutting speed for one time set in the fixed cycle related to the state s as the action a for the state s, with the state s as the state s. To learn.
  • the material of the tool, the shape of the tool, the tool diameter, the tool length, the remaining tool life, the material of the work to be machined, the cutting conditions of the tool catalog, etc. are exemplified.
  • the measured values acquired from the machine tool 10 the spindle rotation speed, the motor current value, the machine temperature, the ambient temperature, and the like are exemplified.
  • the machine learning device 20 is acquired from the machine tool 10 by executing the machining program, the information about the tools and workpieces set in the machine tool 10, the cutting amount and the cutting speed for one time set in the fixed cycle, and the machine tool 10.
  • the action a is determined by observing the measured value and the state information (state data) s including the measured value.
  • the machine learning device 20 returns a reward each time the action a is performed.
  • the machine learning device 20 searches for the optimum action a by trial and error so as to maximize the total reward in the future. By doing so, the machine learning device 20 works by executing the information about the tools and workpieces set in the machine tool 10, the cutting amount and cutting speed for one time set in the fixed cycle, and the machining program. It is possible to select the optimum action a (that is, "cutting amount for one time” and “cutting speed”) for the state s including the measured value acquired from the machine 10.
  • FIG. 2 is a functional block diagram showing a functional configuration example of the machine learning device 20.
  • the machine learning device 20 includes a state information acquisition unit 201, a learning unit 202, an action information output unit 203, a value function storage unit 204, and an optimized action information output unit. It includes 205 and a control unit 206.
  • the learning unit 202 includes a reward calculation unit 221, a value function update unit 222, and an action information generation unit 223.
  • the control unit 206 controls the operations of the state information acquisition unit 201, the learning unit 202, the action information output unit 203, and the optimization action information output unit 205.
  • the state information acquisition unit 201 executes the machining program, as the state of the machine tool 10, information on tools and workpieces set in the machine tool 10, a cutting amount and cutting speed for one time set in a fixed cycle.
  • the state data s including the measured value acquired from the machine tool 10 is acquired from the numerical control device 101. This state data s corresponds to the environmental state s in Q-learning.
  • the state information acquisition unit 201 outputs the acquired state data s to the learning unit 202.
  • the state information acquisition unit 201 may store the acquired state data s in a storage unit (not shown) included in the machine learning device 20. In this case, the learning unit 202, which will be described later, may read the state data s from the storage unit (not shown) of the machine learning device 20.
  • the state information acquisition unit 201 also acquires determination information for calculating the reward for performing Q-learning. Specifically, the strength of the pressure applied to the tool (axial direction and rotational direction) and the shape of the waveform of the pressure applied to the tool obtained from the machine tool 10 by executing the machining program related to the state information s (axial direction and rotational direction). (Axial direction and rotation direction), strength of torque applied to feed shaft, shape of waveform of torque applied to feed shaft, strength of torque applied to spindle, shape of waveform of torque applied to spindle, and execution of the machining program The time required for processing at the time of processing is used as judgment information for calculating the reward for performing Q learning.
  • the learning unit 202 is a part that learns the value function Q (s, a) when selecting a certain action a under a certain state data (environmental state) s. Specifically, the learning unit 202 has a reward calculation unit 221, a value function update unit 222, and an action information generation unit 223. The learning unit 202 determines whether or not to continue learning. Whether to continue learning is, for example, whether the number of trials since the start of machine learning has reached the maximum number of trials, or whether the elapsed time since the start of machine learning has exceeded (or is more than) a predetermined time. Can be judged based on.
  • the reward calculation unit 221 calculates the reward when the action a is selected under a certain state s based on the determination information.
  • the reward may be calculated based on a plurality of evaluation items included in the determination information. In this embodiment, for example, (1) the strength of the pressure (torque) applied to the tool, the feed shaft, and the spindle, (2) the shape of the waveform of the pressure (torque) applied to the tool, the feed shaft, and the spindle, and (3).
  • the reward is calculated based on the item of time required for processing.
  • (1) Reward for the item of pressure (torque) strength applied to the tool, feed shaft, and spindle The tool, feed shaft, and spindle in the state s and the state s'when the state s is changed to the state s'by the action a.
  • the reward calculation unit 221 calculates the reward based on the strength of the pressure (torque) applied to the tool, the feed shaft, and the spindle as follows.
  • the reward r p be a positive value. State s'value P t (s'), P f (s'), at least one of P m (s'), the state s of the value P t (s), P f (s), P m (s ), The reward r p is set to a negative value.
  • the negative value and the positive value may be, for example, a predetermined constant value (for example, a first negative value and a first positive value).
  • Waveform shape of pressure (torque) applied to the tool, feed shaft, and spindle At least one of WF t (s'), WF f (s'), and WF m (s') is a waveform that indicates a sign that the tool will be destroyed. Or, if it resembles a waveform in which the life of the tool decreases more rapidly, the reward r w is set to a negative value.
  • Waveform shape of pressure (torque) applied to the tool, feed shaft, and spindle All of WF t (s'), WF f (s'), and WF m (s') are waveforms that indicate a sign that the tool will be destroyed.
  • the reward r w is set to a positive value. Even if the waveform data indicating a sign that the tool is destroyed and the waveform data in which the life of the tool decreases more rapidly are acquired in advance for each tool and stored in a storage unit (not shown) of the machine learning device 20. good. Further, the negative value and the positive value may be, for example, a predetermined constant value (for example, a second negative value and a second positive value).
  • the values of the time required for processing in the state s and the state s'when the state s is changed to the state s'by the action a are the values T (s) and the value T, respectively. Let it be (s').
  • the negative value and the positive value may be, for example, a predetermined constant value (for example, a third negative value and a third positive value).
  • the reward calculation unit 221 uses the equation 2 as a reward in machine learning that prioritizes the time required for machining and machine learning that prioritizes the life of the tool, and the reward r p , calculated for each of the above items.
  • the reward r may be calculated by separately weighting and adding r w and r c for each machine learning that prioritizes the time required for machining and machine learning that prioritizes the life of the tool.
  • the coefficients a w , b w , and c w indicate weighting coefficients.
  • the reward calculation unit 221 calculates the reward r (hereinafter, also referred to as “reward coefficient ”) at the time of machine learning that prioritizes the time required for machining, as compared with machine learning that prioritizes the life of the tool, for example.
  • the reward calculation unit 221 calculates the reward r (hereinafter, also referred to as “reward coefficient ”) at the time of machine learning that prioritizes the life of the tool, as compared with, for example, machine learning that prioritizes the time required for machining.
  • the value of the coefficient b w of the equation 2 may be set to a large value, and the absolute value of the second negative value and the second positive value may be set to a large value.
  • machine learning that prioritizes the time required for machining is also referred to as "machine learning in the machining time priority mode” unless otherwise specified.
  • machine learning that prioritizes tool life is also referred to as “machine learning in tool life priority mode” unless otherwise specified.
  • the value function update unit 222 includes a state s, an action a, a state s'when the action a is applied to the state s, and a reward rcycle calculated as described above.
  • the value function Q cycle stored in the value function storage unit 204 is updated by performing Q learning in the machining time priority mode based on the value of.
  • the value function update unit 222 includes a state s, an action a, a state s'when the action a is applied to the state s, and a reward calculated as described above.
  • the value function Q tool stored in the value function storage unit 204 is updated by performing Q learning in the tool life priority mode based on the value of r tool. Processing time priority mode of value function Q cycle, and update of value function Q tool of the tool life priority mode, may be carried out in online learning, may be carried out in batch learning, it may be carried out in the mini-batch training. Online learning is a learning method in which the value function Q is immediately updated each time the state s transitions to a new state s'by applying a certain action a to the current state s. In addition, batch learning is to collect data for learning by applying a certain action a to the current state s and repeating the transition of the state s to a new state s', and all the collected data. This is a learning method in which the value function Q is updated using the learning data of. Further, the mini-batch learning is a learning method in which the value function Q is updated every time learning data is accumulated to some extent, which is intermediate between online learning and batch learning.
  • the action information generation unit 223 selects the action a in the process of Q-learning for the current state s.
  • the action information generation unit 223 corrects the cutting amount and cutting speed for one time set in the fixed cycle in the process of Q learning according to the machining time priority mode or the tool life priority mode (in action a in Q learning).
  • the action information a is generated, and the generated action information a is output to the action information output unit 203.
  • the action information generation unit 223 acts on the cutting amount and cutting speed for one time set in the fixed cycle included in the state s for each of the machining time priority mode and the tool life priority mode.
  • the cutting amount and cutting speed for one time contained in a may be increased or decreased incrementally.
  • machine learning in the machining time priority mode and machine learning in the tool life priority mode are alternately performed is shown.
  • machine learning may be performed by randomly using a known method such as the greedy method or the ⁇ greedy method, which will be described later, so as not to be biased toward either mode. Further, as will be described later, machine learning in the machining time priority mode and machine learning in the tool life priority mode may be performed separately.
  • the action information generation unit 223 adjusts the cutting amount and cutting speed for one machining program according to the action a by machine learning in the machining time priority mode or the tool life priority mode, and when the state transitions to the state s', the tool , Feed shaft, spindle force (torque) state (whether it decreases), tool, feed shaft, spindle force (torque) waveform shape state (similar or not), and machining time state Depending on (increase / decrease or maintenance), the cutting amount and cutting speed for one time of the machining program of the action a'for the state s'may be selected.
  • the reward rcycle increases due to the increase in the cutting amount and / or the cutting speed for one time, and the force (torque) of all tools, feed shafts, and spindles decreases.
  • the action a'for the state s' is, for example, the cutting amount for one time and the cutting amount for one time.
  • a measure may be taken to select an action a'that shortens the processing time, such as increasing the cutting speed incrementally.
  • the action a'for the state s' is, for example, one cutting.
  • a measure may be taken to select an action a'that shortens the time required for machining, such as returning the amount and / or the cutting speed to the previous one.
  • the reward rtool increases due to the decrease in the cutting amount and / or the cutting speed for one time, and the force (torque) of all tools, feed shafts, and spindles decreases.
  • the action a'for the state s' is, for example, one cut. Measures may be taken to select an action a'that delays the reduction in tool life, such as incrementally reducing the amount and / or cutting speed.
  • the action a'for the state s' is, for example, the cutting amount and / or the cutting speed. It may be possible to take a measure of selecting an action a'that delays the decrease in tool life, such as returning the tool to the previous one.
  • the action information generation unit 223 randomly acts with a certain small probability ⁇ or a greedy method for selecting the action a having the highest value function Q (s, a) among the current estimated values of the action a. You may take a measure to select the action a by a known method such as the ⁇ -greedy method in which a'is selected and the action a having the highest value function Q (s, a) is selected otherwise.
  • the action information output unit 203 outputs the action information a output from the learning unit 202 to the numerical control device 101.
  • the action information output unit 203 may output, for example, the updated one-time cutting amount and cutting speed values as action information to the numerical control device 101.
  • the numerical control device 101 updates the one-time cutting amount and cutting speed set in the fixed cycle based on the received updated one-time cutting amount and cutting speed value.
  • the numerical control device 101 generates an operation command based on the cutting amount and the cutting speed for one time set in the updated fixed cycle, and causes the machine tool 10 to perform cutting based on the generated operation command. ..
  • the action information output unit 203 may output the updated machining program as the action information based on the updated cutting amount and cutting speed value for one time to the numerical control device 101.
  • Value function storage unit 204 Value function storage unit 204, value function Q cycle processing time priority mode, and a storage device for storing the value function Q tool of tool life priority mode.
  • Each of the value functions Q cycle and Q tool may be stored as a table (hereinafter, also referred to as “action value table”) for each state s and action a, for example.
  • the value functions Q cycle and Q tool stored in the value function storage unit 204 are updated by the value function update unit 222.
  • the optimization behavior information output unit 205 performs an operation in which the value of the value function is maximized based on the value function Q cycle or the value function Q tool updated by the value function update unit 222 by performing Q learning. Generates action information a (hereinafter, also referred to as “optimized action information”) to be performed by the user. More specifically, optimizing behavior information output unit 205 acquires the value function Q tool of value function Q cycle and tool life priority mode processing time priority mode value function storage unit 204 has stored. The value functions Q cycle and Q tool are updated by the value function update unit 222 performing Q learning as described above.
  • the optimization action information output unit 205 generates and generates the action information based on the acquired value function Q cycle of the processing time priority mode and the action information based on the acquired value function Q tool of the processing time priority mode. Each action information is output to the numerical control device 101.
  • This optimized action information includes information indicating the updated cut amount and cutting speed value for one time, as well as the action information output by the action information output unit 203 in the process of Q-learning.
  • the machine learning device 20 includes an arithmetic processing unit such as a CPU. Further, the machine learning device 20 is temporarily required for an auxiliary storage device such as an HDD that stores various control programs such as application software and an OS (Operating System), and an arithmetic processing device for executing a program. It also has a main storage device such as a RAM for storing data.
  • an arithmetic processing unit such as a CPU.
  • the machine learning device 20 is temporarily required for an auxiliary storage device such as an HDD that stores various control programs such as application software and an OS (Operating System), and an arithmetic processing device for executing a program. It also has a main storage device such as a RAM for storing data.
  • a main storage device such as a RAM for storing data.
  • the arithmetic processing device reads the application software and the OS from the auxiliary storage device, and while deploying the read application software and the OS to the main storage device, the arithmetic processing based on these application software and the OS is performed. Do it. Further, based on the calculation result, various hardwares included in the machine learning device 20 are controlled. As a result, the functional block of the present embodiment is realized. That is, this embodiment can be realized by the cooperation of hardware and software.
  • a GPU Graphics Processing Units
  • GPGPU General-Purpose computing on Graphics Processing Units
  • FIG. 3 is a flowchart showing the operation of the machine learning device 20 during Q-learning according to the first embodiment.
  • step S11 the control unit 206 instructs the state information acquisition unit 201 to acquire the state information by setting the number of trials to the initial setting, that is, "1".
  • step S12 the state information acquisition unit 201 acquires the first state data from the numerical control device 101.
  • the acquired state data is output to the action information generation unit 223.
  • this state data (state information) is information corresponding to the state s in Q learning, and as of step S12, the cutting amount for one time, the cutting speed, the material of the tool, the shape of the tool, and the tool. Includes diameter, tool length, remaining tool life, material of workpiece to be machined, cutting conditions in tool catalog, spindle speed, motor current value, machine temperature, and ambient temperature.
  • the state data at the time when Q-learning is first started is generated by the operator in advance.
  • step S13 the action information generation unit 223 generates new action information a in the machining time priority mode and the tool life priority mode by machine learning in the machining time priority mode or the tool life priority mode, and the generated machining time priority mode.
  • the new action information a of the tool life priority mode is output to the numerical control device 101 via the action information output unit 203.
  • the numerical control device 101 has a cut amount for one time set in a fixed cycle based on the action information a selected by the setting device 111 among the received action information a in the machining time priority mode and the tool life priority mode. Execute the machining program with the updated cutting speed.
  • the numerical control device 101 generates an operation command based on the updated machining program, and causes the machine tool 10 to perform cutting based on the generated motion command.
  • step S14 the state information acquisition unit 201 acquires state data corresponding to the new state s'from the numerical control device 101.
  • the new state data includes the cutting amount for one time, cutting speed, tool material, tool shape, tool diameter, tool length, remaining tool life, material of the workpiece to be machined, cutting conditions in the tool catalog, and spindle. Includes rotation speed, motor current value, machine temperature, and ambient temperature.
  • the state information acquisition unit 201 outputs the acquired state data to the learning unit 202.
  • the state information acquisition unit 201 acquires the determination information about the new state s'.
  • the determination information includes the strength of the pressure applied to the tool (axial direction and rotational direction) acquired from the machine tool 10 by executing the updated machining program in step S13, and the tool.
  • Shape of pressure waveform (axial direction and rotation direction), strength of torque applied to feed shaft, shape of waveform of torque applied to feed shaft, strength of torque applied to spindle, shape of waveform of torque applied to spindle, And the time required for machining when the updated machining program is executed, including.
  • the acquired determination information is output to the learning unit 202.
  • step S16 compensation calculation unit 221 performs the compensation Sangsang process based on the acquired determination information, calculates processing time priority mode reward r cycle and reward r tool of tool life priority mode, respectively. The detailed flow of the reward calculation process will be described later.
  • step S17 the value function update unit 222 updates the value function Q cycle and the value function Q tool stored in the value function storage unit 204 based on the calculated reward r cycle and reward r tool , respectively.
  • step S18 the control unit 206 determines whether or not the number of trials since the start of machine learning has reached the maximum number of trials.
  • the maximum number of trials is set in advance. If the maximum number of trials has not been reached, the number of trials is counted up in step S19, and the process returns to step S13. The processes from step S13 to step S19 are repeated until the maximum number of trials is reached.
  • step S17 illustrates online update, it may be replaced with batch update or mini-batch update instead of online update.
  • FIG. 4 is a flowchart illustrating a detailed processing content of the reward calculation process shown in step S16 in FIG.
  • step S61 the reward calculation unit 221 sets the values of the pressure (torque) strength applied to the tool, the feed shaft, and the spindle included in the determination information of the state s', P t (s'), P f (s'), and P f (s'). All of P m (s') are the values of the pressure (torque) applied to the tool, feed shaft, and spindle included in the judgment information of the state s. P t (s), P f (s), P m ( s) Determine whether it is smaller, that is, weaker.
  • step S62 At least one of the values P t (s'), P f (s'), and P m (s') of the pressure (torque) applied to the tool, the feed shaft, and the spindle in the state s'is from the state s. If it is strong, the process proceeds to step S63.
  • step S62 the reward calculation unit 221 sets the reward r p to a negative value.
  • step S63 the reward calculation unit 221 sets the reward r p to a positive value.
  • the reward calculation unit 221 has the shapes of the waveforms of the pressure (torque) applied to the tool, the feed shaft, and the spindle included in the determination information of the state s', WF t (s'), WF f (s'), and WF. It is determined whether all of m (s') are similar to a waveform that indicates a sign that the tool is destroyed or a waveform that reduces the life of the tool. If the shape of the waveform of the pressure (torque) applied to the tool, feed shaft, and spindle in the state s', WF t (s'), WF f (s'), and WF m (s') are not all similar, the process is a step. Proceed to S66.
  • step S65 when at least one of the waveform shapes WF t (s'), WF f (s'), and WF m (s') applied to the tool, the feed shaft, and the spindle in the state s'is similar, The process proceeds to step S65.
  • step S65 the reward calculation unit 221 sets the reward r w to a negative value.
  • step S66 the reward calculation unit 221 sets the reward r w to a positive value.
  • step S67 the reward calculation unit 221 has the value T (s') of the time required for processing included in the determination information of the state s', and the value T (s') of the time required for processing included in the determination information of the state s. s) Determine whether it has increased, decreased, or maintained from the above.
  • the process proceeds to step S68.
  • the process proceeds to step S70.
  • the process proceeds to step S69.
  • step S68 compensation calculation unit 221, the reward r c negative.
  • step S69 compensation calculation unit 221, the reward r c to zero.
  • step S70 the compensation calculation unit 221, the reward r c to a positive value.
  • step S71 the compensation calculation unit 221 calculates the reward r p, r w, and r c, using the equation (2), and the reward r tool compensation r cycle and tool life priority mode processing time priority mode Calculate each. As described above, the flow of the reward calculation process is completed, and the process proceeds to step S17.
  • Q cycle and Q tool can be generated.
  • step S21 the optimization behavior information output unit 205, value function value function Q cycle processing time priority mode in the storage unit 204 has stored, and acquires the value function Q tool of tool life priority mode.
  • step S22 the optimization action information output unit 205 generates the optimization action information of the machining time priority mode and the tool life priority mode based on the acquired value function Q cycle and the value function Q tool, respectively, and the generated machining
  • the optimization action information of the time priority mode and the tool life priority mode is output to the numerical control device 101.
  • the cutting amount and the cutting speed for one time set in the fixed cycle are updated according to the action in the machining time priority mode or the tool life priority mode selected by the setting device 111.
  • the machining program can be optimized without increasing the labor of the operator at the site such as variable variable production.
  • the numerical control device 101 can perform machining by giving priority to the time required for machining (that is, cycle time) or machining by giving priority to the tool life.
  • the numerical control device 101 eliminates the need for the operator to set the arguments for the cutting amount and the cutting speed for one time, and can reduce the time and effort for creating the machining program.
  • the first embodiment has been described above.
  • the machine learning device 20A has each fixed cycle (for example, i) for a machining program including two or more (for example, n) fixed cycles in addition to the functions of the first embodiment.
  • the machining program is stopped, and the state s (i), the action a (i), the judgment information (i), the reward r (i), and the state of the i-th fixed cycle are stopped. It further has a function of calculating the action a'(i) with respect to s'(i) and updating the cutting amount and cutting speed for one time in the i-th fixed cycle.
  • n is an integer of 2 or more
  • i is an integer of 1 to n.
  • FIG. 6 is a functional block diagram showing a functional configuration example of the numerical control system according to the second embodiment. Elements having the same functions as the elements of the numerical control system 1 of FIG. 1 are designated by the same reference numerals, and detailed description thereof will be omitted. As shown in FIG. 6, the numerical control system 1 according to the second embodiment includes a machine tool 10 and a machine learning device 20A.
  • the machine tool 10 is a machine tool known to those skilled in the art as in the case of the first embodiment, and includes a numerical control device 101a.
  • the machine tool 10 operates based on an operation command from the numerical control device 101a.
  • the numerical control device 101a is a numerical control device known to those skilled in the art as in the case of the first embodiment, and issues an operation command based on a machining program acquired from an external device (not shown) such as a CAD / CAM device. It is generated and the generated operation command is transmitted to the machine tool 10. As a result, the numerical control device 101a controls the operation of the machine tool 10.
  • the numerical control device 101a for example, when executing a machining program, each time n fixed cycles (i) such as finding and tapping included in the machining program are completed, the machining is performed.
  • the setting device 111 has the same function as the setting device 111 in the first embodiment.
  • FIG. 7 is a functional block diagram showing a functional configuration example of the machine learning device 20A.
  • the machine learning device 20A includes a state information acquisition unit 201a, a learning unit 202a, an action information output unit 203a, a value function storage unit 204a, an optimization action information output unit 205a, and a control unit 206.
  • the learning unit 202a includes a reward calculation unit 221a, a value function update unit 222a, and an action information generation unit 223a.
  • the control unit 206 has the same function as the control unit 206 in the first embodiment.
  • the state information acquisition unit 201a provides information on tools and workpieces set in the machine tool 10 and each fixed cycle (each fixed cycle) every time each of the n fixed cycles included in the machining program is executed as the state of the machine tool 10. i) The state data s including the cutting amount and cutting speed for one time set in (1 ⁇ i ⁇ n) and the measured value acquired from the machine tool 10 by executing the machining program is numerically obtained. Obtained from the control device 101. The state information acquisition unit 201a outputs the state data s (i) acquired for each fixed cycle (i) to the learning unit 202a.
  • the state information acquisition unit 201a may store the state data s (i) acquired for each fixed cycle (i) in a storage unit (not shown) included in the machine learning device 20A.
  • the learning unit 202a which will be described later, may read the state data s (i) for each fixed cycle (i) from the storage unit (not shown) of the machine learning device 20A.
  • the state information acquisition unit 201a also acquires determination information for calculating the reward for performing Q-learning for each fixed cycle (i). Specifically, the strength of the pressure applied to the tool (axial direction and rotation) acquired from the machine tool 10 by executing the fixed cycle (i) included in the machining program related to the state information s (i).
  • shape of waveform of pressure applied to tool axial direction and direction of rotation
  • strength of torque applied to feed shaft shape of waveform of torque applied to feed shaft
  • strength of torque applied to spindle applied to spindle
  • the shape of the torque waveform and the time required for processing when the fixed cycle (i) is executed are used as judgment information for calculating the reward for performing Q learning.
  • the learning unit 202a selects a certain action a (i) under a certain state data (environmental state) s (i), and the value function Q (s (i), This is the part for learning a (i)).
  • the learning unit 202a has a reward calculation unit 221a, a value function update unit 222a, and an action information generation unit 223a.
  • the learning unit 202a determines whether or not to continue learning, as in the learning unit 202 of the first embodiment. Whether to continue learning is determined by, for example, whether the number of trials of the machining program since the start of machine learning has reached the maximum number of trials, or whether the elapsed time since the start of machine learning has exceeded a predetermined time (or more). ) Can be judged based on whether or not.
  • the reward calculation unit 221a calculates the reward when the action a (i) is selected under a certain state s (i) in each fixed cycle (i) based on the determination information of each fixed cycle (i). do.
  • the rewards calculated in each fixed cycle (i) are (1) the strength of the pressure (torque) applied to the tool, the feed shaft, and the spindle, and (2) the tool and the feed, as in the case of the first embodiment. It is calculated based on the items of the waveform shape of the pressure (torque) applied to the shaft and the spindle and (3) the time required for processing.
  • the rewards r p (i), r w (i), and r c (i) of each item in the fixed cycle (i) are the same as the rewards r p , r w , and r c of the first embodiment.
  • the reward calculation unit 221a similarly to the reward calculation unit 221 of the first embodiment, has a reward r cycle (i) in the machining time priority mode in the fixed cycle (i) and a reward r tool (i) in the tool life priority mode. ) May be calculated using the rewards r p (i), r w (i), r c (i) of each item, and the equation 2 equation.
  • the value function update unit 222a has the state s (i) in the fixed cycle (i) and the action a (i) in the case of machine learning in the machining time priority mode. , it is carried out state s'when applying action a (i) to state s (i) and (i), the value of the calculated reward r cycle (i) as described above, the Q-learning based on Therefore , the value function Q cycle_i of the fixed cycle (i) stored in the value function storage unit 204a is updated.
  • the value function update unit 222a sets the state s (i), the action a (i), and the action a (i) in the state s (i) in the fixed cycle (i).
  • the value function stored in the value function storage unit 204a by performing Q-learning based on the state s'(i) when applied to and the value of the reward rtool (i) calculated as described above. Update Q- tool_i.
  • the action information generation unit 223a selects the action a (i) in the Q-learning process with respect to the current state s (i) in the fixed cycle (i), similarly to the action information generation unit 223 of the first embodiment. do.
  • the action information generation unit 223a corrects the cutting amount and cutting speed for one time of the i-th fixed cycle in the process of Q learning according to the machining time priority mode or the tool life priority mode (in the action a in Q learning).
  • the action information a of the i-th fixed cycle is generated, and the generated action information a of the i-th fixed cycle is output to the action information output unit 203a.
  • the action information output unit 203a outputs the action information a (i) for each fixed cycle (i) output from the learning unit 202a to the numerical control device 101a, similarly to the action information output unit 203 of the first embodiment. do.
  • the action information output unit 203a may output, for example, the updated one-time cutting amount and cutting speed values as action information for each fixed cycle (i) to the numerical control device 101a.
  • the numerical control device 101a updates each of the n fixed cycles (i) included in the machining program based on the received updated cutting amount and cutting speed value for one time.
  • the numerical control device 101a generates an operation command based on the machining program including the updated fixed cycle (i), and causes the machine tool 10 to perform cutting based on the generated motion command.
  • the action information output unit 203a provides a machining program in which each fixed cycle (i) is updated based on the updated cutting amount and cutting speed value for one time as action information for each fixed cycle (i). It may be output to the numerical control device 101a.
  • the value function storage unit 204a is a storage device that stores the value function Q cycle_i in the machining time priority mode and the value function Q tool_i in the tool life priority mode for each fixed cycle (i).
  • the relationship between the set of the value function Q cycle_i (1 ⁇ i ⁇ n) and the value function Q cycle, and the relationship between the set of the value function Q tool_i (1 ⁇ i ⁇ n) and the value function Q tool are expressed in Equation 3. It is expressed as.
  • the value functions Q cycle_i and Q tool_i for each fixed cycle (i) stored in the value function storage unit 204a are updated by the value function update unit 222.
  • the optimization behavior information output unit 205a is a value function Q cycle or a tool of the machining time priority mode updated by the value function update unit 222a by performing Q learning. Based on the value function Q tool in the life priority mode, the action information (optimized action information) a in the fixed cycle (i) for causing the numerical control device 101a to perform the operation that maximizes the value of the value function is generated. More specifically, optimizing behavior information output unit 205a acquires the value function Q tool of value function Q cycle and tool life priority mode processing time priority mode value function storage unit 204 has stored.
  • the optimization action information output unit 205a receives the action information in the fixed cycle (i) based on the acquired value function Q cycle of the machining time priority mode and the fixed cycle (i) based on the acquired value function Q tool of the machining time priority mode.
  • the action information in i) is generated, and each action information in the generated fixed cycle (i) is output to the numerical control device 101a.
  • This optimized action information includes information indicating the updated cut amount and cutting speed value for one time, as well as the action information output by the action information output unit 203a in the process of Q-learning.
  • the functional blocks included in the machine learning device 20A have been described above.
  • FIG. 8 is a flowchart showing the operation of the machine learning device 20A at the time of Q learning in the second embodiment.
  • the same step numbers as those of the steps shown in FIG. 3 are assigned the same step numbers, and detailed description thereof will be omitted.
  • step S11a the control unit 206 instructs the state information acquisition unit 201a to acquire the state information by setting the number of trials j of the machining program to the initial setting, that is, "1".
  • step S11b the control unit 206 initializes i to "1".
  • step S12a the state information acquisition unit 201a acquires the state data s (i) of the fixed cycle (i) from the numerical control device 101a.
  • the acquired state data s (i) is output to the action information generation unit 223a.
  • this state data (state information) s (i) is information corresponding to the state s (i) in the fixed cycle (i) in the Q learning, and the cutting amount for one time at the time of step S12a. , Cutting speed, tool material, tool shape, tool diameter, tool length, remaining tool life, material of workpiece to be machined, cutting conditions in tool catalog, spindle rotation speed, motor current value, machine temperature, and ambient temperature, Is included.
  • the state data at the time when Q-learning is first started is generated by the operator in advance.
  • step S13a the action information generation unit 223a obtains new action information a (i) in the fixed cycle (i) of the machining time priority mode and the tool life priority mode by machine learning in the machining time priority mode or the tool life priority mode.
  • the generated new action information a (i) of the generated machining time priority mode and the tool life priority mode is output to the numerical control device 101a via the action information output unit 203a.
  • the numerical control device 101a has a fixed cycle (i) based on the action information a (i) selected by the setting device 111 among the received action information a (i) of the machining time priority mode and the tool life priority mode. Execute the machining program in which the set cutting amount and cutting speed for one time are updated.
  • the numerical control device 101a generates an operation command based on the updated fixed cycle (i), and causes the machine tool 10 to perform cutting based on the generated operation command. Then, the numerical control device 101a stops the machining program when the fixed cycle (i) is completed.
  • step S14 the state information acquisition unit 201a performs the same processing as in step S14 in the first embodiment, and acquires new state data s'(i) in the fixed cycle (i) acquired from the numerical control device 101a. ..
  • step S15 the state information acquisition unit 201a performs the same processing as in step S15 in the first embodiment, and acquires determination information about the new state s'(i) in the fixed cycle (i).
  • the acquired determination information is output to the learning unit 202a.
  • step S16 the reward calculation unit 221a performs the same processing as in step S16 in the first embodiment, performs the reward calculation processing of FIG. 4 based on the acquired determination information, and performs a fixed cycle of the processing time priority mode (a fixed cycle of the processing time priority mode ( The reward r cycle (i) of i) and the reward r tool (i) of the fixed cycle (i) of the tool life priority mode are calculated respectively.
  • step S17 the value function update unit 222a performs the same processing as in step S17 in the first embodiment, and is based on the calculated reward r cycle (i) and reward r tool (i) of the fixed cycle (i). updates processing time priority mode value function Q Cycle_i fixed cycle value function storage unit 204a has stored (i), and the tool life priority mode value function Q Tool_i respectively.
  • step S17a the control unit 206 determines whether or not i is smaller than n. If i is less than n, the process proceeds to step S17b. On the other hand, when i is n or more, the process proceeds to step S18.
  • step S17b the control unit 206 increases i by "1". The process returns to step S12a.
  • step S18 the control unit 206 performs the same processing as in step S18 in the first embodiment, and determines whether or not the number of trials j of the machining program since the start of machine learning has reached the maximum number of trials. If the maximum number of trials has not been reached, the number of trials j is counted up by "1" in step S19, and the process returns to step S11b. The processes from step S11b to step S19 are repeated until the maximum number of trials is reached.
  • step S17 illustrates online update, it may be replaced with batch update or mini-batch update instead of online update.
  • Q- tool can be generated.
  • the operation when the optimization behavior information is generated by the optimization behavior information output unit 205a is the same as the flowchart of FIG. 5 except that the optimization behavior information is generated for each fixed cycle (i). Omit.
  • the numerical control device 101a is set for one time in the fixed cycle (i) according to the action in the machining time priority mode or the tool life priority mode for each fixed cycle (i) selected by the setting device 111.
  • the machining program can be optimized without increasing the labor of the operator at the site such as variable variable production.
  • the numerical control device 101 can perform machining by giving priority to the time required for machining (that is, cycle time) or machining by giving priority to the tool life.
  • the numerical control device 101a eliminates the need for the operator to set the arguments for the cutting amount and the cutting speed for one time, and can reduce the time and effort for creating the machining program.
  • the second embodiment has been described above.
  • the numerical control devices 101 and 101a and the machine learning devices 20 and 20A are not limited to the above-described embodiments and are within a range in which the object can be achieved. Including deformation, improvement, etc.
  • the machine learning devices 20 and 20A alternately perform machine learning in the machining time priority mode and the tool life priority mode, but the present invention is not limited to this.
  • the machine learning devices 20 and 20A may separately perform machine learning in the machining time priority mode and machine learning in the tool life priority mode.
  • the setting device 111 uses the machining time priority mode based on the comparison between the remaining tool life of the tool used in the machine tool 10 and the preset threshold value.
  • the action in, or the action in the tool life priority mode is selected, but is not limited to this. For example, if the remaining tool life of the tool is 5%, the number of remaining machined parts is 3, and the amount of reduction in tool life per machining is 0.1%, after machining a workpiece with 3 remaining machined parts. The remaining tool life is 4.7%, not 0%.
  • the setting device 111 may select the action in the machining time priority mode when the remaining tool life is equal to or less than the threshold value and the machining of the work with the number of remaining machined parts does not reach 0%. As a result, even if the remaining tool life is short, if the remaining tool life remains relative to the number of remaining machined parts, machining can be performed without reducing the time required for machining (cycle time).
  • the machine learning devices 20 and 20A are exemplified as devices different from the numerical control devices 101 and 101a, but some or all of the machine learning devices 20 and 20A are illustrated.
  • the numerical control devices 101 and 101a may be provided with the function.
  • the state information of the machine learning device 20 the state information acquisition unit 201, the learning unit 202, the action information output unit 203, the value function storage unit 204, the optimization action information output unit 205, and the control unit 206, or the machine learning device 20A.
  • a server may include a part or all of the acquisition unit 201a, the learning unit 202a, the action information output unit 203a, the value function storage unit 204a, the optimization action information output unit 205a, and the control unit 206.
  • each function of the machine learning devices 20 and 20A may be realized by using the virtual server function or the like on the cloud.
  • the machine learning devices 20 and 20A may be a distributed processing system in which the functions of the machine learning devices 20 and 20A are appropriately distributed to a plurality of servers.
  • the control system 1 has m machine tools 10A (1) -10A (m) and m machine learning devices 20B (1) -20B (m). It may be (m is an integer of 2 or more).
  • the machine learning device 20B (j) is connected to the machine tool 10A (j) in a one-to-one communication manner via the network 50, and machine learning is performed on the machine tool 10A (j). It may be (j is an integer from 1 to m).
  • the value functions Q cycle and Q tool (Q cycle_i , Q tool_i ) stored in the value function storage unit 204 (204a) of the machine learning device 20B (j) are connected to another machine learning device 20B (k). May be shared by (k is an integer from 1 to m, k ⁇ j).
  • Value function Q cycle, Q tool (Q cycle_i , Q tool_i) if to share the machine learning device 20B (1) -20B (m) , by performing reinforcement learning distributed at each machine learning device 20B It becomes possible to improve the efficiency of reinforcement learning.
  • Each of the machine tools 10A (1) to 10A (m) corresponds to the machine tool 10 of FIG. 1 or FIG.
  • each of the machine learning devices 20B (1) to 20B (m) corresponds to the machine learning device 20 of FIG. 1 or the machine learning device 20A of FIG.
  • the server 60 operates as a machine learning device 20 (20A) and is communicably connected to m machine tools 10A (1) -10A (m) via a network 50. Machine learning may be performed for each of the machine tools 10A (1) -10A (m).
  • the functions included in the numerical control devices 101 and 101a and the machine learning devices 20 and 20A in the first embodiment and the second embodiment can be realized by hardware, software, or a combination thereof, respectively.
  • what is realized by software means that it is realized by a computer reading and executing a program.
  • Each component included in the numerical control devices 101 and 101a and the machine learning devices 20 and 20A can be realized by hardware, software including an electronic circuit or the like, or a combination thereof. If implemented by software, the programs that make up this software are installed on your computer. In addition, these programs may be recorded on removable media and distributed to users, or may be distributed by being downloaded to a user's computer via a network. In addition, when configured with hardware, some or all of the functions of each component included in the above device are, for example, ASIC (Application Specific Integrated Circuit), gate array, FPGA (Field Programmable Gate Array), CPLD ( It can be configured by an integrated circuit (IC) such as a Complex Programmable Logical Device).
  • ASIC Application Specific Integrated Circuit
  • FPGA Field Programmable Gate Array
  • CPLD It can be configured by an integrated circuit (IC) such as a Complex Programmable Logical Device).
  • Non-transitory computer-readable media include various types of tangible recording media (Tangible storage media).
  • Examples of non-temporary computer-readable media include magnetic recording media (eg, flexible disks, magnetic tapes, hard disk drives), magneto-optical recording media (eg, magneto-optical disks), CD-ROMs (Read Only Memory), CD- Includes R, CD-R / W, and semiconductor memory (for example, mask ROM, PROM (Programmable ROM), EPROM (Erasable PROM), flash ROM, RAM).
  • the program may also be supplied to the computer by various types of temporary computer-readable media (Transition computer readable medium). Examples of temporary computer-readable media include electrical, optical, and electromagnetic waves.
  • the temporary computer-readable medium can supply the program to the computer via a wired communication path such as an electric wire and an optical fiber, or a wireless communication path.
  • the step of describing the program recorded on the recording medium is not only the processing performed in chronological order according to the order, but also the processing executed in parallel or individually even if it is not necessarily processed in chronological order. Also includes.
  • machine learning device setting device, numerical control system, numerical control device, and machine learning method of the present disclosure can take various embodiments having the following configurations.
  • the machine learning device 20 of the present disclosure is a machine learning device that performs machine learning on a numerical control device 101 that operates a machine tool 10 based on a machining program, and is a machine learning device that performs machine learning for at least one cutting amount and cutting speed.
  • the state information acquisition unit 201 acquires state information including the cutting amount and cutting speed for one time by causing the machine tool 10 to perform cutting by executing the machining program in which is set.
  • the action information output unit 203 that outputs the action information including the adjustment information of the cutting amount and the cutting speed for one time included in the state information, at least the strength of the pressure applied to the tool in the cutting process, and the waveform of the pressure applied to the tool.
  • the reward calculation unit 221 that acquires the judgment information that is information about the shape of the shape and the time required for processing and outputs the reward value in the strengthening learning according to a predetermined condition based on the acquired judgment information, and the reward. It includes a value function update unit 222 that updates the value function Q based on the value, the state information, and the action information. According to the machine learning device 20, the machining program can be optimized without increasing the labor of the operator.
  • the predetermined condition is either a condition that prioritizes the machining time or a condition that prioritizes the life of the tool
  • the reward calculation unit 221 determines the machining time.
  • the reward r cycle is output under the priority condition
  • the reward r tool is output under the condition that prioritizes the tool life
  • the value function update unit 222 outputs the reward r cycle , the state information, and the action under the condition that the machining time is prioritized. update the value function Q cycle on the basis of the information, and the reward r tool in the preferred conditions the life of the tool, and the state information, it may update the value function Q tool on the basis of the action information.
  • machine learning may be performed every time a machining program is executed or each time each of a plurality of fixed cycles included in the machining program is executed. good. By doing so, the machining program can be optimized for each work machining and each fixed cycle.
  • the machine learning devices 20 and 20A based on the behavior information in which the value of the value function Q cycle updated based on the reward r cycle is maximized, and the reward r tool.
  • the optimized behavior information output units 205 and 205a that output the behavior information that maximizes the value of the updated value function Q tool may be further provided. By doing so, the machine learning devices 20 and 20A can optimize the machining program according to the state of the tool.
  • the machine learning unit 20 according to (5) (1), compensation calculation unit 221, compensation in the case where the time required for processing to be included in the determination information is reduced from the time required for the previous machining r cycle, r tool May be a positive value, and the reward rcycle and rtool may be negative values when the time required for processing increases from the time required for the previous processing.
  • the machine learning device 20 can optimize the machining program according to the time required for machining.
  • the reward calculation unit 221 indicates that the shape of the waveform of the pressure applied to the tool included in the determination information is at least the shape of the waveform indicating a sign that the tool is destroyed and the shape of the tool. If the shape of the waveform does not resemble the shape of the waveform that indicates a sharp decrease in life, the reward rcycle and rtool are set to positive values, and the shape of the waveform of the pressure applied to the tool is at least the shape of the waveform or tool that indicates a sign that the tool will be destroyed.
  • the rewards rcycle and rtool may be set to negative values when they are similar to the shape of the waveform indicating a rapid decrease in the life of the device. By doing so, the machine learning device 20 can optimize the machining program while considering the safety of machining.
  • machine learning may be performed by providing a maximum number of trials for machine learning. By doing so, the machine learning devices 20 and 20A can avoid the machine learning being performed for a long time.
  • the setting device 111 of the present disclosure selects one of the actions acquired from the machine learning device according to any one of (1) to (7) based on a preset threshold value. Set the selected action in the machining program. According to this setting device 111, the same effects as in (1) to (7) can be obtained.
  • the numerical control system 1 of the present disclosure is set by the machine learning devices 20 and 20A according to any one of (1) to (7), the setting device 111 according to (8), and the setting device 111.
  • the numerical control devices 101 and 101a for executing the machining program are provided. According to this numerical control system 1, the same effects as in (1) to (7) can be obtained.
  • the numerical control devices 101 and 101a of the present disclosure include the machine learning devices 20 and 20A according to any one of (1) to (7) and the setting device 111 according to (8) for setting.
  • the machining program set by the apparatus 111 is executed. According to the numerical control devices 101 and 101a, the same effects as in (1) to (7) can be obtained.
  • the numerical control method of the present disclosure is a machine learning method of the machine learning devices 20 and 20A that perform machine learning on the numerical control devices 101 and 101a that operate the machine tool 10 based on the machining program, and at least.
  • the machine tool 10 is made to perform cutting, so that the cutting amount and cutting speed for one time are included.
  • the information is acquired, and the action information including the adjustment information of the cutting amount and the cutting speed for one time included in the state information is output, and at least the strength of the pressure applied to the tool in the cutting process and the shape of the waveform of the pressure applied to the tool.
  • the judgment information which is the information about the time required for processing is acquired, and based on the acquired judgment information, the reward value in the strengthening learning according to a predetermined condition is output, and the reward value, the state information, and The value function Q is updated based on the behavior information. According to this numerical control method, the same effect as in (1) can be obtained.

Landscapes

  • Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Manufacturing & Machinery (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Automation & Control Theory (AREA)
  • Numerical Control (AREA)

Abstract

オペレータの手間を増やすことなく、加工プログラムを最適化すること。 機械学習装置は、加工プログラムで工作機械を動作させる数値制御装置に対して機械学習を行う機械学習装置であって、少なくとも1回分の切り込み量及び切削速度が設定された加工プログラムを実行することで、工作機械に切削加工を行わせることで、1回分の切り込み量及び切削速度を含む状態情報を取得する状態情報取得部と、状態情報に含まれる1回分の切り込み量及び切削速度の調整情報を含む行動情報を出力する行動情報出力部と、少なくとも切削加工における工具にかかる圧力の強さと、工具にかかる圧力の波形の形状と、加工に要した時間との情報である判定情報を取得し、取得した判定情報に基づいて、所定の条件に応じた強化学習における報酬値を出力する報酬計算部と、報酬値と、状態情報と、行動情報とに基づいて価値関数を更新する価値関数更新部と、を備える。

Description

機械学習装置、数値制御システム、設定装置、数値制御装置、及び機械学習方法
 本発明は、機械学習装置、数値制御システム、設定装置、数値制御装置、及び機械学習方法に関する。
 もみつけ、タッピング、ボーリング、旋削サイクル等の固定サイクルにおける1回分の切り込み量及び切削速度は、ワークや工具の材質、形状を主要因とし、試験加工等を繰り返し行うことにより、オペレータが経験的に決定する。
 この点、加工条件データ、切削条件データ、加工結果データ、工具データを含む状態変数に基づくクラスタ分析により作成されたクラストを学習済みモデルとして用い、新たに入力された加工条件、切削条件、及び加工結果に基づいて適切な工具を判定し、判定した工具のクラスタにおける指定された好結果を保てる範囲で切削速度の最大値を判定する技術が知られている。例えば、特許文献1参照。
特開2019-188558号公報
 例えば、変種変量生産の現場では、(1)或る加工プログラムを別の機械に使いまわす、(2)或る加工プログラムの形状を少しだけ修正した別の加工プログラムを作成して加工する、(3)或る加工プログラムをワークの材質を変更して加工する等のような状況が頻繁に発生する。
 このような状況下において、オペレータは1つ1つの加工プログラムを経験に基づいて最適化する時間的余裕がない。よって、加工プログラムや切削条件を十分に最適化せず、加工を行わざるを得ない場合がある。この場合、例えば、どのような変更を行っても安全に加工を行うため、切削速度を過度に落としていることがある。それによりサイクルタイムが落ち、生産効率が下がっているケースが考えられる。
 そこで、オペレータの手間を増やすことなく、加工プログラムを最適化することが望まれている。
 (1)本開示の機械学習装置の一態様は、加工プログラムに基づいて工作機械を動作させる数値制御装置に対して機械学習を行う機械学習装置であって、少なくとも1回分の切り込み量及び切削速度が設定された前記加工プログラムを前記数値制御装置が実行することで、前記工作機械に切削加工を行わせることにより、前記1回分の切り込み量及び前記切削速度を含む状態情報を、取得する状態情報取得部と、前記状態情報に含まれる前記1回分の切り込み量及び前記切削速度の調整情報を含む行動情報を出力する行動情報出力部と、少なくとも前記切削加工における工具にかかる圧力の強さと、前記工具にかかる前記圧力の波形の形状と、加工に要した時間とについての情報である判定情報を取得し、取得した前記判定情報に基づいて、所定の条件に応じた強化学習における報酬値を出力する報酬計算部221と、前記報酬値と、前記状態情報と、前記行動情報とに基づいて価値関数を更新する価値関数更新部と、を備える。
 (2)本開示の設定装置の一態様は、(1)の機械学習装置から取得した行動のうち予め設定された閾値に基づいていずれかの行動を選択して、選択した前記行動を前記加工プログラムに設定する。
 (3)本開示の数値制御システムの一態様は、(1)の機械学習装置と、(2)の設定装置と、前記設定装置によって設定された前記加工プログラムを実行する数値制御装置と、を備える。
 (3)本開示の数値制御装置の一態様は、(1)の機械学習装置と、(2)の設定装置と、を含み、前記設定装置によって設定された前記加工プログラムを実行する。
 (4)本開示の数値制御方法の一態様は、加工プログラムに基づいて工作機械を動作させる数値制御装置に対して機械学習を行う機械学習装置の機械学習方法であって、少なくとも1回分の切り込み量及び切削速度が設定された前記加工プログラムを前記数値制御装置が実行することで、前記工作機械に切削加工を行わせることにより、前記1回分の切り込み量及び前記切削速度を含む状態情報を、取得し、前記状態情報に含まれる前記1回分の切り込み量及び前記切削速度の調整情報を含む行動情報を出力し、少なくとも前記切削加工における工具に係る圧力の強さと、前記工具に係る前記圧力の波形の形状と、加工に要した時間とについての情報である判定情報を取得し、取得した前記判定情報に基づいて、所定の条件に応じた強化学習における報酬値を出力し、前記報酬値と、前記状態情報と、前記行動情報とに基づいて価値関数を更新する。
 一態様によれば、オペレータの手間を増やすことなく、加工プログラムを最適化することができる。
第1実施形態に係る数値制御システムの機能的構成例を示す機能ブロック図である。 機械学習装置の機能的構成例を示す機能ブロック図である。 第1実施形態におけるQ学習時の機械学習装置の動作を示すフローチャートである。 図3においてステップS16で示した報酬計算処理の詳細な処理内容を説明するフローチャートである。 最適化行動情報出力部による最適化行動情報の生成時の動作を示すフローチャートである。 第2実施形態に係る数値制御システムの機能的構成例を示す機能ブロック図である。 機械学習装置の機能的構成例を示す機能ブロック図である。 第2実施形態におけるQ学習時の機械学習装置の動作を示すフローチャートである。 数値制御システムの構成の一例を示す図である。 数値制御システムの構成の一例を示す図である。
 以下、本開示の第1実施形態について、図面を用いて説明する。ここでは、加工プログラムとして、もみつけやタッピング等の1つの固定サイクルを含み、加工プログラム毎、すなわち1ワーク加工毎に学習する場合を例示する。
 こうすることで、当該固定サイクルで設定された、1回分の切り込み量及び切削速度を当該加工プログラムに対する行動として特定することができる。
<第1実施形態>
 図1は、第1実施形態に係る数値制御システムの機能的構成例を示す機能ブロック図である。
 図1に示すように、数値制御システム1は、工作機械10、及び機械学習装置20を有する。
 工作機械10、及び機械学習装置20は、図示しない接続インタフェースを介して互いに直接接続されてもよい。また、工作機械10、及び機械学習装置20は、LAN(Local Area Network)やインターネット等の図示しないネットワークを介して相互に接続されていてもよい。この場合、工作機械10、及び機械学習装置20は、かかる接続によって相互に通信を行うための図示しない通信部を備えている。なお、後述するように、数値制御装置101は、工作機械10に含まれるが、工作機械10と異なる装置でもよい。また、数値制御装置101は、機械学習装置20を含んでもよい。
 工作機械10は、当業者にとって公知の工作機械であり、数値制御装置101を含む。工作機械10は、数値制御装置101からの動作指令に基づいて動作する。
 数値制御装置101は、当業者にとって公知の数値制御装置であり、設定装置111を含む。数値制御装置101は、CAD/CAM装置等の外部装置(図示しない)から取得した加工プログラムに基づいて動作指令を生成し、生成した動作指令を工作機械10に送信する。これにより、数値制御装置101は、工作機械10の動作を制御する。そして、数値制御装置101は、工作機械10の動作を制御している間、工作機械10に含まれる図示しない主軸のスピンドルモータ、及び図示しない送り軸のサーボモータ等のモータにおける回転数、モータ電流値、及びトルクを、予め設定されたサンプリング時間等の所定の時間間隔で工作機械10から取得してもよい。
 また、数値制御装置101は、工作機械10に含まれる図示しない温度センサ等のセンサにより測定されたモータ温度、機械温度、及び周囲温度等の温度を工作機械10から取得してもよい。また、数値制御装置101は、工作機械10に含まれる図示しない圧力センサ等のセンサにより測定された図示しない主軸に取付けられた工具にかかる軸方向及び回転方向の圧力を工作機械10から取得してもよい。また、数値制御装置101は、工作機械10に含まれる図示しないサイクルカウンタ等により測定された工作機械10が所定の切削加工を行った際の当該加工に要した時間を取得してもよい。
 なお、本実施形態では、上述したように、加工プログラムが1つの固定サイクルしか含まないため、加工に要した時間はサイクルタイムと同等である。
 また、数値制御装置101は、例えば、工作機械10の主軸(図示しない)に取付けられた工具の材質、工具の形状、工具径、工具長、残り工具寿命、加工対象のワークの材質、工具カタログの切削条件等を、後述する機械学習装置20に出力してもよい。また、数値制御装置101は、工作機械10から取得した主軸回転数、モータ電流値、機械温度、周囲温度、工具にかかる圧力の強さ(軸方向、及び回転方向)、工具にかかる圧力の波形の形状(軸方向、及び回転方向)、送り軸にかかるトルクの強さ、送り軸にかかるトルクの波形の形状、主軸にかかるトルクの強さ、主軸にかかるトルクの波形の形状、及び加工に要した時間を、後述する機械学習装置20に出力してもよい。
 なお、数値制御装置101は、例えば、数値制御装置101に含まれるHDD(Hard Disk Drive)等の図示しない記憶部に、工作機械10の主軸(図示しない)に取付けられるすべての工具を管理する工具管理テーブル(図示しない)を記憶してもよい。そして、数値制御装置101は、加工プログラムに設定された工具番号等に基づいて、工具の材質、工具の形状、工具径、工具長、残り工具寿命を工具管理テーブル(図示しない)から取得するようにしてもよい。ここで、残り工具寿命は、例えば、カタログに記載の対応表から求めた耐用時間から得て工具の寿命と見なし、1ワーク毎の加工の使用時間から求められてもよい。そして、工具管理テーブル(図示しない)の残り工具寿命は、求められた値で更新されてもよい。
 また、数値制御装置101は、例えば、数値制御装置101に含まれるキーボードやタッチパネル等の入力装置(図示しない)を介してオペレータの入力操作により、加工対象のワークの材質、工具カタログの切削条件等を取得するようにしてもよい。
 また、工具にかかる圧力の波形の形状は、工具にかかる圧力の時系列データである。また、送り軸にかかるトルクの波形の形状は、送り軸にかかるトルクの時系列データである。また、主軸にかかるトルクの波形の形状は、主軸に係るトルクの時系列データである。
 設定装置111は、後述する機械学習装置20から取得する行動のうち予め設定された閾値に基づいていずれかの行動を選択して、選択した行動を加工プログラムに設定する。
 具体的には、設定装置111は、例えば、工作機械10で使用中の工具の残り工具寿命と予め設定された閾値(例えば、10%)とを比較することにより、残り工具寿命が閾値より大きい場合に加工時間を優先する行動を選択し、残り工具寿命が閾値以下の場合に工具寿命を優先する行動を選択する。設定装置111は、選択した行動を加工プログラムに設定する。
 なお、設定装置111は、CPU等の演算処理装置を備える数値制御装置101等のコンピュータで構成することができる。
 また、設定装置111は、数値制御装置101と異なる装置でもよい。
<機械学習装置20>
 機械学習装置20は、数値制御装置101が加工プログラムを実行することで、工作機械10を動作させたときの、ワーク毎の1回分の切り込み量及び切削速度を強化学習する装置である。
 機械学習装置20に含まれる各機能ブロックの説明に先立って、まず強化学習として例示するQ学習の基本的な仕組みについて説明する。ただし、強化学習はQ学習に限定されない。エージェント(本実施形態における機械学習装置20に相当)は、環境(本実施形態における工作機械10及び数値制御装置101に相当)の状態を観測し、或る行動を選択し、選択した行動に基づいて環境が変化する。環境の変化に伴って、何らかの報酬が与えられ、与えられた報酬に基づいて、エージェントはより良い行動を選択できるよう、学習する。
 教師あり学習が、完全な正解を示すのに対して、強化学習における報酬は、環境の一部の変化に基づく断片的な値であることが多い。このため、エージェントは、将来にわたっての得られる報酬の合計を最大にするように学習する。
 このように、強化学習では、行動を学習することにより、環境に行動が与える相互作用を踏まえて適切な行動を学習、すなわち将来的に得られる報酬を最大にするための学習する方法を学ぶ。これは、本実施形態において、例えば、変種変量生産の現場において、オペレータの手間を増やすことなく、加工プログラムの固定サイクルを最適化するという、未来に影響をおよぼすような行動を獲得できることを表している。
 ここで、強化学習としては、任意の学習方法を用いることができるが、以下の説明では、或る環境の状態sの下で、行動aを選択する価値関数Q(s,a)を学習する方法であるQ学習(Q-learning)を用いる場合を例にとって説明をする。
 Q学習では、或る状態sのとき、取り得る行動aのなかから、価値関数Q(s,a)の値が最も高い行動aを最適な行動として選択することを目的とする。
 しかしながら、Q学習を最初に開始する時点では、状態sと行動aとの組合せについて、価値関数Q(s,a)の正しい値は全く分かっていない。そこで、エージェントは、或る状態sの下で様々な行動aを選択し、その時の行動aに対して、与えられる報酬に基づいて、より良い行動の選択をすることにより、正しい価値関数Q(s,a)を学習していく。
 また、将来にわたって得られる報酬の合計を最大化したいので、最終的にQ(s,a)=E[Σ(γ)r]となるようにすることを目指す。ここでE[]は期待値を表し、tは時刻、γは後述する割引率と呼ばれるパラメータ、rは時刻tにおける報酬、Σは時刻tによる合計である。この式における期待値は、最適な行動に従って状態変化した場合の期待値である。しかしQ学習の過程において最適な行動が何であるのかは不明であるので、様々な行動を行うことにより、探索しながら強化学習をする。このような価値関数Q(s,a)の更新式は、例えば、次の数1式により表すことができる。
Figure JPOXMLDOC01-appb-M000001
 上記の数1式において、sは、時刻tにおける環境の状態を表し、aは、時刻tにおける行動を表す。行動aにより、状態はst+1に変化する。rt+1は、その状態の変化により得られる報酬を表している。また、maxの付いた項は、状態st+1の下で、その時に分かっている最もQ値の高い行動aを選択した場合のQ値にγを乗じたものになる。ここで、γは、0<γ≦1のパラメータで、割引率と呼ばれる。また、αは、学習係数で、0<α≦1の範囲とする。
 上述した数1式は、試行aの結果、返ってきた報酬rt+1を元に、状態sにおける行動aの価値関数Q(s,a)を更新する方法を表している。
 この更新式は、状態sにおける行動aの価値関数Q(s,a)よりも、行動aによる次の状態st+1における最良の行動の価値max Q(st+1,a)の方が大きければ、Q(s,a)を大きくし、逆に小さければ、Q(s,a)を小さくすることを示している。つまり、或る状態における或る行動の価値を、それによる次の状態における最良の行動の価値に近づける。ただし、その差は、割引率γと報酬rt+1のあり方により変わってくるが、基本的には、ある状態における最良の行動の価値が、それに至る1つ前の状態における行動の価値に伝播していく仕組みになっている。
 ここで、Q学習では、すべての状態行動ペア(s,a)についてのQ(s,a)のテーブルを作成して、学習を行う方法がある。しかし、すべての状態行動ペアのQ(s,a)の値を求めるには状態数が多すぎて、Q学習が収束するのに多くの時間を要してしまう場合がある。
 そこで、公知のDQN(Deep Q-Network)と呼ばれる技術を利用するようにしてもよい。具体的には、価値関数Qを適当なニューラルネットワークを用いて構成し、ニューラルネットワークのパラメータを調整することにより、価値関数Qを適当なニューラルネットワークで近似することにより価値関数Q(s,a)の値を算出するようにしてもよい。DQNを利用することにより、Q学習が収束するのに要する時間を短くすることが可能となる。なお、DQNについては、例えば、以下の非特許文献に詳細な記載がある。
<非特許文献>
「Human-level control through deep reinforcement learning」、Volodymyr Mnih1著[online]、[平成29年1月17日検索]、インターネット〈URL:http://files.davidqiu.com/research/nature14236.pdf〉
 以上説明をしたQ学習を機械学習装置20が行う。具体的には、機械学習装置20は、工作機械10において設定された工具及びワークに関する情報と、固定サイクルで設定された1回分の切り込み量及び切削速度と、当該加工プログラムを実行することで工作機械10から取得された測定値と、を状態sとして、当該状態sに係る当該固定サイクルで設定された1回分の切り込み量及び切削速度の設定、変更を状態sに対する行動aとして選択する価値Qを学習する。ここでは、工具及びワークに関する情報として、工具の材質、工具の形状、工具径、工具長、残り工具寿命、加工対象のワークの材質、工具カタログの切削条件等を例示する。また、工作機械10から取得された測定値として、主軸回転数、モータ電流値、機械温度、周囲温度等を例示する。
 機械学習装置20は、工作機械10において設定された工具及びワークに関する情報と、固定サイクルで設定された1回分の切り込み量及び切削速度と、当該加工プログラムを実行することで工作機械10から取得された測定値と、を含む状態情報(状態データ)sを観測して、行動aを決定する。機械学習装置20は、行動aをするたびに報酬が返ってくる。機械学習装置20は、将来にわたっての報酬の合計が最大になるように最適な行動aを試行錯誤的に探索する。そうすることで、機械学習装置20は、工作機械10において設定された工具及びワークに関する情報と、固定サイクルで設定された1回分の切り込み量及び切削速度と、当該加工プログラムを実行することで工作機械10から取得された測定値と、を含む状態sに対して、最適な行動a(すなわち「1回分の切り込み量」及び「切削速度」)を選択することが可能となる。
 図2は、機械学習装置20の機能的構成例を示す機能ブロック図である。
 上述した強化学習を行うために、図2に示すように、機械学習装置20は、状態情報取得部201、学習部202、行動情報出力部203、価値関数記憶部204、最適化行動情報出力部205、及び制御部206を備える。学習部202は、報酬計算部221、価値関数更新部222、及び行動情報生成部223を備える。制御部206は、状態情報取得部201、学習部202、行動情報出力部203、及び最適化行動情報出力部205の動作を制御する。
 状態情報取得部201は、工作機械10の状態として、工作機械10において設定された工具及びワークに関する情報と、固定サイクルで設定された1回分の切り込み量及び切削速度と、当該加工プログラムを実行することで工作機械10から取得された測定値と、を含む状態データsを、数値制御装置101から取得する。この状態データsは、Q学習における、環境状態sに相当する。
 状態情報取得部201は、取得した状態データsを学習部202に出力する。
 なお、状態情報取得部201は、取得した状態データsを機械学習装置20に含まれる図示しない記憶部に記憶してもよい。この場合、後述する学習部202は、状態データsを機械学習装置20の記憶部(図示しない)から読み込んでもよい。
 また、状態情報取得部201は、Q学習を行うための報酬を算出するための判定情報も取得する。具体的には、状態情報sに係る加工プログラムを実行することにより工作機械10から取得された、工具にかかる圧力の強さ(軸方向、及び回転方向)、工具にかかる圧力の波形の形状(軸方向、及び回転方向)、送り軸にかかるトルクの強さ、送り軸にかかるトルクの波形の形状、主軸にかかるトルクの強さ、主軸にかかるトルクの波形の形状、及び当該加工プログラムを実行したときの加工に要した時間を、Q学習を行うための報酬を算出するための判定情報とする。
 学習部202は、或る状態データ(環境状態)sの下で、或る行動aを選択する場合の価値関数Q(s,a)を学習する部分である。具体的には、学習部202は、報酬計算部221、価値関数更新部222、及び行動情報生成部223を有する。
 なお、学習部202は、学習を継続するかどうかを判断する。学習を継続するかどうかは、例えば、機械学習を始めてからの試行回数が最大試行回数に達したかどうか、又は、機械学習を始めてからの経過時間が所定時間を超えた(又は以上)かどうかに基づいて判断することができる。
 報酬計算部221は、或る状態sの下で、行動aを選択した場合の報酬を判定情報に基づいて算出する。報酬は、判定情報に含まれる複数の評価項目に基づいて算出してもよい。本実施形態では、例えば、(1)工具、送り軸、主軸にかかる圧力(トルク)の強さと、(2)工具、送り軸、主軸にかかる圧力(トルク)の波形の形状と、(3)加工に要した時間との項目に基づいて報酬を算出する。
 そこで、(1)工具、送り軸、主軸にかかる圧力(トルク)の強さの項目、(2)工具、送り軸、主軸にかかる圧力(トルク)の波形の形状の項目、及び(3)加工に要した時間の項目における報酬の算出について説明する。
(1)工具、送り軸、主軸にかかる圧力(トルク)の強さの項目の報酬について
 行動aにより状態sから状態s´に遷移した場合の状態s及び状態s´における工具、送り軸、主軸にかかる圧力(トルク)の強さの値をそれぞれ値P(s)、P(s)、P(s)、及び値P(s´)、P(s´)、P(s´)とする。
 報酬計算部221は、以下のように工具、送り軸、主軸にかかる圧力(トルク)の強さに基づく報酬を算出する。
 値P(s´)<値P(s)、且つ値P(s´)<値P(s)、且つ値P(s´)<値P(s)の場合は、報酬rを正の値とする。
 状態s´の値P(s´)、P(s´)、P(s´)の少なくとも1つが、状態sの値P(s)、P(s)、P(s)より大きい場合、報酬rを負の値とする。
 なお、負の値及び正の値については、例えば、予め設定した一定の値(例えば、第1の負の値及び第1の正の値)でもよい。
(2)工具、送り軸、主軸にかかる圧力(トルク)の波形の形状の項目の報酬について
 行動aにより状態sから状態s´に遷移した場合の状態s´における工具、送り軸、主軸にかかる圧力(トルク)の波形の形状をWF(s´)、WF(s´)、WF(s´)とする。
 報酬計算部221は、以下のように工具、送り軸、主軸にかかる圧力(トルク)の波形の形状に基づく報酬を算出する。
 工具、送り軸、主軸にかかる圧力(トルク)の波形の形状WF(s´)、WF(s´)、WF(s´)の少なくとも1つが、工具が破壊される予兆を示す波形、又は工具の寿命がより急激に減少する波形と相似する場合は、報酬rを負の値とする。
 工具、送り軸、主軸にかかる圧力(トルク)の波形の形状WF(s´)、WF(s´)、WF(s´)のすべてが、工具が破壊される予兆を示す波形、及び工具の寿命がより急激に減少する波形と相似しない場合は、報酬rを正の値とする。
 なお、工具が破壊される予兆を示す波形、及び工具の寿命がより急激に減少する波形のデータは、工具毎に予め取得され、機械学習装置20の記憶部(図示しない)に記憶されてもよい。
 また、負の値及び正の値については、例えば、予め設定した一定の値(例えば、第2の負の値及び第2の正の値)でもよい。
(3)加工に要した時間の報酬について
 行動aにより状態sから状態s´に遷移した場合の状態s及び状態s´における加工に要した時間の値をそれぞれ値T(s)、及び値T(s´)とする。
 報酬計算部221は、以下のように加工に要した時間に基づく報酬を算出する。
 値T(s´)>値T(s)の場合は、報酬rを負の値とする。
 値T(s´)=値T(s)の場合は、報酬rをゼロとする。
 値T(s´)<値T(s)の場合は、報酬rを正の値とする。
 なお、負の値及び正の値については、例えば、予め設定した一定の値(例えば、第3の負の値及び第3の正の値でもよい。
 報酬計算部221は、加工に要する時間を優先する機械学習と、工具の寿命を優先する機械学習と、における報酬として、数2式を用いて、上述の項目毎に算出された報酬r、r、rを加工に要する時間を優先する機械学習及び工具の寿命を優先する機械学習毎に別々に重み付け加算した報酬rをそれぞれ算出してもよい。
Figure JPOXMLDOC01-appb-M000002
 なお、係数a、b、cは、重み係数を示す。
 また、報酬計算部221は、加工に要する時間を優先する機械学習時の報酬r(以下、「報酬rcycle」ともいう)の計算において、例えば、工具の寿命を優先する機械学習と比べて、数2式の係数cの値を大きな値してもよく、第3の負の値及び第3の正の値の絶対値を大きな値にしてもよい。
 また、報酬計算部221は、工具の寿命を優先する機械学習時の報酬r(以下、「報酬rtool」ともいう)の計算において、例えば、加工に要する時間を優先する機械学習と比べて、数2式の係数bの値を大きな値してもよく、第2の負の値及び第2の正の値の絶対値を大きな値にしてもよい。
 以下、加工に要する時間を優先する機械学習は、特に断らない限り、「加工時間優先モードにおける機械学習」ともいう。また、工具の寿命を優先する機械学習は、特に断らない限り、「工具寿命優先モードにおける機械学習」ともいう。
 価値関数更新部222は、加工時間優先モードにおける機械学習の場合、状態sと、行動aと、行動aを状態sに適用した場合の状態s´と、上述のように算出された報酬rcycleの値と、に基づいて加工時間優先モードにおけるQ学習を行うことにより、価値関数記憶部204が記憶する価値関数Qcycleを更新する。また、価値関数更新部222は、工具寿命優先モードにおける機械学習の場合、状態sと、行動aと、行動aを状態sに適用した場合の状態s´と、上述のように算出された報酬rtoolの値と、に基づいて工具寿命優先モードにおけるQ学習を行うことにより、価値関数記憶部204が記憶する価値関数Qtoolを更新する。
 加工時間優先モードの価値関数Qcycle、及び工具寿命優先モードの価値関数Qtoolの更新は、オンライン学習で行ってもよく、バッチ学習で行ってもよく、ミニバッチ学習で行ってもよい。
 オンライン学習とは、或る行動aを現在の状態sに適用することにより、状態sが新たな状態s´に遷移する都度、即座に価値関数Qの更新を行うという学習方法である。また、バッチ学習とは、或る行動aを現在の状態sに適用することにより、状態sが新たな状態s´に遷移することを繰り返すことにより、学習用のデータを収集し、収集した全ての学習用データを用いて、価値関数Qの更新を行うという学習方法である。更に、ミニバッチ学習とは、オンライン学習と、バッチ学習の中間的な、ある程度学習用データが溜まるたびに価値関数Qの更新を行うという学習方法である。
 行動情報生成部223は、現在の状態sに対して、Q学習の過程における行動aを選択する。行動情報生成部223は、加工時間優先モード又は工具寿命優先モードに応じたQ学習の過程において、固定サイクルで設定された1回分の切り込み量及び切削速度を修正する動作(Q学習における行動aに相当)を行わせるために、行動情報aを生成し、生成した行動情報aを行動情報出力部203に対して出力する。
 より具体的には、行動情報生成部223は、加工時間優先モード及び工具寿命優先モード毎に、状態sに含まれる、固定サイクルで設定された1回分の切り込み量及び切削速度に対して、行動aに含まれる1回分の切り込み量及び切削速度をインクレメンタルに増加又は減少させるようにしてもよい。
 本実施形態では、例えば、加工時間優先モードにおける機械学習と、工具寿命優先モードにおける機械学習とを交互に行う場合を示す。なお、この場合、どちらか一方のモードに偏らないように、後述するグリーディ法やεグリーディ法等の公知の方法をランダムに用いて機械学習を行うようにしてもよい。また、後述するように、加工時間優先モードにおける機械学習と、工具寿命優先モードにおける機械学習とを別々に行うようにしてもよい。
 行動情報生成部223は、加工時間優先モード又は工具寿命優先モードにおける機械学習により、行動aにより加工プログラムの1回分の切り込み量及び切削速度を調整して、状態s´に遷移した場合に、工具、送り軸、主軸の力(トルク)の状態(減少するか否か)、工具、送り軸、主軸の力(トルク)の波形の形状の状態(相似するか否か)、及び加工時間の状態(増減又は維持)によって状態s´に対する行動a´の加工プログラムの1回分の切り込み量及び切削速度を選択してもよい。
 例えば、加工時間優先モードにおける機械学習の場合、1回分の切り込み量及び/又は切削速度の増加により報酬rcycleが増加し、且つすべての工具、送り軸、主軸の力(トルク)が減少し、全ての工具、送り軸、主軸の力(トルク)の波形の形状が相似せず、及び加工の要する時間が減少する場合、状態s´に対する行動a´としては、例えば、1回分の切り込み量及び/又は切削速度をインクレメンタルに増加させる等、加工に要する時間の短縮となるような行動a´を選択する方策を取るようにしてもよい。
 あるいは、加工時間優先モードにおける機械学習の場合に、1回分の切り込み量及び/又は切削速度の増加により報酬rcycleが減少する場合、状態s´に対する行動a´としては、例えば、1回分の切り込み量及び/又は切削速度を1つ前に戻す等、加工に要する時間の短縮となるような行動a´を選択する方策を取るようにしてもよい。
 また、工具寿命優先モードにおける機械学習の場合、1回分の切り込み量及び/又は切削速度の減少により報酬rtoolが増加し、且つすべての工具、送り軸、主軸の力(トルク)が減少し、すべての工具、送り軸、主軸の力(トルク)の波形の形状が相似せず、及び加工に要する時間が増減又は維持する場合、状態s´に対する行動a´としては、例えば、1回分の切り込み量及び/又は切削速度をインクレメンタルに減少させる等、工具寿命の減少を遅らせるような行動a´を選択する方策を取るようにしてもよい。
 あるいは、工具寿命優先モードにおける機械学習の場合に、切り込み量及び/又は切削速度の減少により報酬rtoolが減少する場合、状態s´に対する行動a´としては、例えば、切り込み量及び/又は切削速度を1つ前に戻す等、工具寿命の減少を遅らせるような行動a´を選択する方策を取るようにしてもよい。
 また、行動情報生成部223は、現在の推定される行動aの価値の中で、最も価値関数Q(s,a)の高い行動aを選択するグリーディ法や、ある小さな確率εでランダムに行動a´選択し、それ以外では最も価値関数Q(s,a)の高い行動aを選択するεグリーディ法といった公知の方法により、行動aを選択する方策を取るようにしてもよい。
 行動情報出力部203は、学習部202から出力される行動情報aを数値制御装置101に対して出力する。行動情報出力部203は、例えば行動情報としての、更新された一回分の切り込み量及び切削速度の値を、数値制御装置101に出力するようにしてもよい。これにより、数値制御装置101は、受信した更新された1回分の切り込み量及び切削速度の値に基づいて、固定サイクルで設定された1回分の切り込み量及び切削速度を更新する。そして、数値制御装置101は、更新された固定サイクルで設定された1回分の切り込み量及び切削速度に基づいて動作指令を生成し、生成した動作指令に基づいて工作機械10に切削加工を行わせる。
 なお、行動情報出力部203は、行動情報としての、更新された1回分の切り込み量及び切削速度の値に基づいて更新した加工プログラムを、数値制御装置101に出力してもよい。
 価値関数記憶部204は、加工時間優先モードの価値関数Qcycle、及び工具寿命優先モードの価値関数Qtoolを記憶する記憶装置である。価値関数Qcycle、Qtoolそれぞれは、例えば状態s、行動a毎にテーブル(以下、「行動価値テーブル」ともいう)として格納してもよい。価値関数記憶部204に記憶された価値関数Qcycle、Qtoolは、価値関数更新部222により更新される。
 最適化行動情報出力部205は、価値関数更新部222がQ学習を行うことにより更新した価値関数Qcycle又は価値関数Qtoolに基づいて、価値関数の値が最大となる動作を数値制御装置101に行わせるための行動情報a(以下、「最適化行動情報」ともいう)を生成する。
 より具体的には、最適化行動情報出力部205は、価値関数記憶部204が記憶している加工時間優先モードの価値関数Qcycle及び工具寿命優先モードの価値関数Qtoolを取得する。この価値関数Qcycle、Qtoolは、上述したように価値関数更新部222がQ学習を行うことにより更新したものである。そして、最適化行動情報出力部205は、取得した加工時間優先モードの価値関数Qcycleに基づく行動情報と、取得した加工時間優先モードの価値関数Qtoolに基づく行動情報と、を生成し、生成した各行動情報を数値制御装置101に対して出力する。この最適化行動情報には、行動情報出力部203がQ学習の過程において出力する行動情報と同様に、更新された1回分の切り込み量及び切削速度の値を示す情報が含まれる。
 以上、機械学習装置20に含まれる機能ブロックについて説明した。
 これらの機能ブロックを実現するために、機械学習装置20は、CPU等の演算処理装置を備える。また、機械学習装置20は、アプリケーションソフトウェアやOS(Operating System)等の各種の制御用プログラムを格納したHDD等の補助記憶装置や、演算処理装置がプログラムを実行する上で一時的に必要とされるデータを格納するためのRAMといった主記憶装置も備える。
 そして、機械学習装置20において、演算処理装置が補助記憶装置からアプリケーションソフトウェアやOSを読み込み、読み込んだアプリケーションソフトウェアやOSを主記憶装置に展開させながら、これらのアプリケーションソフトウェアやOSに基づいた演算処理を行なう。また、この演算結果に基づいて、機械学習装置20が備える各種のハードウェアを制御する。これにより、本実施形態の機能ブロックは実現される。つまり、本実施形態は、ハードウェアとソフトウェアが協働することにより実現することができる。
 機械学習装置20については機械学習に伴う演算量が多いため、例えば、パーソナルコンピュータにGPU(Graphics Processing Units)を搭載し、GPGPU(General-Purpose computing on Graphics Processing Units)と呼ばれる技術により、GPUを機械学習に伴う演算処理に利用するようにすると高速処理できるようになるのでよい。さらには、より高速な処理を行うために、このようなGPUを搭載したコンピュータを複数台用いてコンピュータ・クラスターを構築し、このコンピュータ・クラスターに含まれる複数のコンピュータにて並列処理を行うようにしてもよい。
 次に、図3のフローチャートを参照して本実施形態におけるQ学習時の機械学習装置20の動作について説明をする。
 図3は、第1実施形態におけるQ学習時の機械学習装置20の動作を示すフローチャートである。
 ステップS11において、制御部206は、試行回数を初期設定、すなわち「1」として状態情報取得部201に状態情報の取得を指示する。
 ステップS12において、状態情報取得部201は、数値制御装置101から最初の状態データを取得する。取得した状態データは、行動情報生成部223に対して出力される。上述したように、この状態データ(状態情報)は、Q学習における状態sに相当する情報であり、ステップS12時点での、1回分の切り込み量、切削速度、工具の材質、工具の形状、工具径、工具長、残り工具寿命、加工対象のワークの材質、工具カタログの切削条件、主軸回転数、モータ電流値、機械温度、及び周囲温度、が含まれる。なお、最初にQ学習を開始する時点での状態データは、予めオペレータが生成するようにする。
 ステップS13において、行動情報生成部223は、加工時間優先モード又は工具寿命優先モードにおける機械学習により、加工時間優先モード及び工具寿命優先モードの新たな行動情報aを生成し、生成した加工時間優先モード及び工具寿命優先モードの新たな行動情報aを、行動情報出力部203を介して数値制御装置101に対して出力する。数値制御装置101は、受信した加工時間優先モード及び工具寿命優先モードの行動情報aのうち、設定装置111により選択された行動情報aに基づいて、固定サイクルで設定された1回分の切り込み量及び切削速度が更新された加工プログラムを実行する。数値制御装置101は、更新された加工プログラムに基づいて動作指令を生成し、生成した動作指令に基づいて工作機械10に切削加工を行わせる。
 ステップS14において、状態情報取得部201は、数値制御装置101から新たな状態s´に相当する状態データを取得する。ここで、新たな状態データは、1回分の切り込み量、切削速度、工具の材質、工具の形状、工具径、工具長、残り工具寿命、加工対象のワークの材質、工具カタログの切削条件、主軸回転数、モータ電流値、機械温度、及び周囲温度、を含む。状態情報取得部201は、学習部202に対して取得した状態データを出力する。
 ステップS15において、状態情報取得部201は、新たな状態s´についての判定情報を取得する。ここで、判定情報には、ステップS13において、更新された加工プログラムが実行されることにより工作機械10から取得された、工具にかかる圧力の強さ(軸方向、及び回転方向)、工具にかかる圧力の波形の形状(軸方向、及び回転方向)、送り軸にかかるトルクの強さ、送り軸にかかるトルクの波形の形状、主軸にかかるトルクの強さ、主軸にかかるトルクの波形の形状、及び更新された加工プログラムを実行したときの加工に要した時間を、を含む。取得した判定情報は、学習部202に出力される。
 ステップS16において、報酬計算部221は、取得された判定情報に基づいて報酬算算処理を行い、加工時間優先モードの報酬rcycle及び工具寿命優先モードの報酬rtoolをそれぞれ算出する。なお、報酬計算処理の詳細なフローについては、後述する。
 ステップS17において、価値関数更新部222は、計算された報酬rcycle及び報酬rtoolに基づいて、価値関数記憶部204が記憶している価値関数Qcycle及び価値関数Qtoolをそれぞれ更新する。
 ステップS18において、制御部206は、機械学習を始めてからの試行回数が最大試行回数に到達したかどうかを判断する。最大試行回数は予め設定しておく。最大試行回数に到達していなければ、ステップS19で試行回数をカウントアップして、ステップS13に戻る。ステップS13からステップS19までの処理は最大試行回数に到達するまで繰り返し行われる。
 なお、図3のフローは、試行回数が最大試行回数に到達したときに処理を終了させているが、ステップS13からステップS19の処理に係る時間を、機械学習を始めてから累積した時間が、予め設定された最大経過時間を超えた(又は以上になった)ことを条件として処理を終了するようにしてもよい。
 また、ステップS17はオンライン更新を例示しているが、オンライン更新に替えてバッチ更新又はミニバッチ更新に置き換えてもよい。
 図4は、図3においてステップS16で示した報酬計算処理の詳細な処理内容を説明するフローチャートである。
 ステップS61において、報酬計算部221は、状態s´の判定情報に含まれる工具、送り軸、主軸にかかる圧力(トルク)の強さの値P(s´)、P(s´)、P(s´)のすべてが、状態sの判定情報に含まれる工具、送り軸、主軸にかかる圧力(トルク)の強さの値P(s)、P(s)、P(s)より小さい、すなわち弱いか否かを判定する。状態s´の工具、送り軸、主軸にかかる圧力(トルク)の強さの値P(s´)、P(s´)、P(s´)のすべてが状態sより弱い場合、処理はステップS62に進む。また、状態s´の工具、送り軸、主軸にかかる圧力(トルク)の強さの値P(s´)、P(s´)、P(s´)の少なくとも1つが状態sより強い場合、処理はステップS63に進む。
 ステップS62において、報酬計算部221は、報酬rを負の値にする。
 ステップS63において、報酬計算部221は、報酬rを正の値にする。
 ステップS64において、報酬計算部221は、状態s´の判定情報に含まれる工具、送り軸、主軸にかかる圧力(トルク)の波形の形状WF(s´)、WF(s´)、WF(s´)のすべてが、工具が破壊される予兆を示す波形、又は工具の寿命がより減少する波形と相似するか否かを判定する。状態s´の工具、送り軸、主軸にかかる圧力(トルク)の波形の形状WF(s´)、WF(s´)、WF(s´)のすべてが相似しない場合、処理はステップS66に進む。また、状態s´の工具、送り軸、主軸にかかる圧力(トルク)の波形の形状WF(s´)、WF(s´)、WF(s´)の少なくとも1つが相似する場合、処理はステップS65に進む。
 ステップS65において、報酬計算部221は、報酬rを負の値にする。
 ステップS66において、報酬計算部221は、報酬rを正の値にする。
 ステップS67において、報酬計算部221は、状態s´の判定情報に含まれる加工に要した時間の値T(s´)が、状態sの判定情報に含まれる加工に要した時間の値T(s)より増加、減少、又は維持したかを判定する。状態s´の加工に要した時間の値T(s´)が状態sより増加した場合、処理はステップS68に進む。また、状態s´の加工に要した時間の値T(s´)が状態sより減少した場合、処理はステップS70に進む。また、状態s´の加工に要した時間の値T(s´)が維持された場合、処理はステップS69に進む。
 ステップS68において、報酬計算部221は、報酬rを負の値にする。
 ステップS69において、報酬計算部221は、報酬rをゼロにする。
 ステップS70において、報酬計算部221は、報酬rを正の値にする。
 ステップS71において、報酬計算部221は、算出した報酬r、r、rと、数2式と、を用いて、加工時間優先モードの報酬rcycle及び工具寿命優先モードの報酬rtoolをそれぞれ算出する。以上により、報酬計算処理のフローは終了し、処理はステップS17に進む。
 以上、図3及び図4を参照して説明した動作により、本実施形態では、変種変量生産等の現場において、オペレータの手間を増やすことなく、加工プログラムの固定サイクルを最適化するための価値関数Qcycle、Qtoolを生成することができる。
 次に、図5のフローチャートを参照して、最適化行動情報出力部205による最適化行動情報の生成時の動作について説明をする。
 ステップS21において、最適化行動情報出力部205は、価値関数記憶部204が記憶している加工時間優先モードの価値関数Qcycle、及び工具寿命優先モードの価値関数Qtoolを取得する。
 ステップS22において、最適化行動情報出力部205は、取得した価値関数Qcycle及び価値関数Qtoolに基づいて、加工時間優先モード及び工具寿命優先モードの最適化行動情報をそれぞれ生成し、生成した加工時間優先モード及び工具寿命優先モードの最適化行動情報を数値制御装置101に対して出力する。
 以上のように、数値制御装置101は、設定装置111で選択された加工時間優先モード又は工具寿命優先モードにおける行動に応じて固定サイクルで設定された1回分の切り込み量及び切削速度が更新された加工プログラムを実行することにより、変種変量生産等の現場において、オペレータの手間を増やすことなく、加工プログラムを最適化することができる。これにより、数値制御装置101は、加工に要する時間(すなわち、サイクルタイム)を優先して加工したり、工具寿命を優先して加工したりすることができる。
 また、数値制御装置101は、オペレータにより1回分の切り込み量及び切削速度の引数の設定が不要になり、加工プログラムの作成の手間を削減することができる。
 以上、第1実施形態について説明した。
<第2実施形態>
 次に、第2実施形態について説明する。第2実施形態では、機械学習装置20Aは、第1実施形態の機能に加えて、2以上の複数(例えば、n個)の固定サイクルを含む加工プログラムに対して、各固定サイクル(例えば、i番目の固定サイクル)を実行する毎に、加工プログラムをストップして、i番目の固定サイクルの状態s(i)、行動a(i)、判定情報(i)、報酬r(i)、及び状態s´(i)に対する行動a´(i)を算出し、i番目の固定サイクルにおける1回分の切り込み量及び切削速度を更新する機能をさらに備える。なお、nは2以上の整数であり、iは1からnの整数である。
 こうすることで、i番目の固定サイクルで設定された、1回分の切り込み量及び切削速度をi番目の固定サイクルに対する行動として特定することができる。以下、i番目の固定サイクルを「固定サイクル(i)」(1≦i≦n)ともいう。
 以下に、第2実施形態について説明する。
<第2実施形態>
 図6は、第2実施形態に係る数値制御システムの機能的構成例を示す機能ブロック図である。なお、図1の数値制御システム1の要素と同様の機能を有する要素については、同じ符号を付し、詳細な説明は省略する。
 図6に示すように、第2実施形態に係る数値制御システム1は、工作機械10、及び機械学習装置20Aを有する。
 工作機械10は、第1実施形態の場合と同様に、当業者にとって公知の工作機械であり、数値制御装置101aを含む。工作機械10は、数値制御装置101aからの動作指令に基づいて動作する。
 数値制御装置101aは、第1実施形態の場合と同様に、当業者にとって公知の数値制御装置であり、CAD/CAM装置等の外部装置(図示しない)から取得した加工プログラムに基づいて動作指令を生成し、生成した動作指令を工作機械10に送信する。これにより、数値制御装置101aは、工作機械10の動作を制御する。
 なお、第2実施形態に係る数値制御装置101aは、例えば、加工プログラムを実行する場合、加工プログラムに含まれるもみつけ、タッピング等のn個の固定サイクル(i)それぞれが完了する毎に、加工プログラムをストップして、当該固定サイクルにおいて工作機械10に設定された工具及びワークに関する情報と、当該固定サイクル(i)に設定された1回分の切り込み量及び切削速度と、加工プログラムを実行することで工作機械10から取得された測定値を、機械学習装置20Aに出力してもよい。
 なお、設定装置111は、第1実施形態における設定装置111と同等の機能を有する。
<機械学習装置20A>
 機械学習装置20Aは、数値制御装置101aが加工プログラムを実行することで、工作機械10を動作させたときの、加工プログラムに含まれるn個の固定サイクル毎の1回分の切り込み量及び切削速度を強化学習する装置である。
 図7は、機械学習装置20Aの機能的構成例を示す機能ブロック図である。
 図7に示すように、機械学習装置20Aは、状態情報取得部201a、学習部202a、行動情報出力部203a、価値関数記憶部204a、最適化行動情報出力部205a、及び制御部206を備える。学習部202aは、報酬計算部221a、価値関数更新部222a、及び行動情報生成部223aを備える。
 なお、制御部206は、第1実施形態における制御部206と同等の機能を有する。
 状態情報取得部201aは、工作機械10の状態として、加工プログラムに含まれるn個の固定サイクルそれぞれが実行される毎に、工作機械10において設定された工具及びワークに関する情報と、各固定サイクル(i)(1≦i≦n)に設定された1回分の切り込み量及び切削速度と、当該加工プログラムを実行することで工作機械10から取得された測定値と、を含む状態データsを、数値制御装置101から取得する。
 状態情報取得部201aは、固定サイクル(i)毎に取得した状態データs(i)を学習部202aに出力する。
 なお、状態情報取得部201aは、固定サイクル(i)毎に取得した状態データs(i)を機械学習装置20Aに含まれる図示しない記憶部に記憶してもよい。この場合、後述する学習部202aは、固定サイクル(i)毎の状態データs(i)を機械学習装置20Aの記憶部(図示しない)から読み込んでもよい。
 また、状態情報取得部201aは、Q学習を行うための報酬を算出するための判定情報も固定サイクル(i)毎に取得する。具体的には、状態情報s(i)に係る加工プログラムに含まれる固定サイクル(i)をそれぞれ実行することにより工作機械10から取得された、工具にかかる圧力の強さ(軸方向、及び回転方向)、工具にかかる圧力の波形の形状(軸方向、及び回転方向)、送り軸にかかるトルクの強さ、送り軸にかかるトルクの波形の形状、主軸にかかるトルクの強さ、主軸にかかるトルクの波形の形状、及び当該固定サイクル(i)を実行したときの加工に要した時間を、Q学習を行うための報酬を算出するための判定情報とする。
 学習部202aは、各固定サイクル(i)において、或る状態データ(環境状態)s(i)の下で、或る行動a(i)を選択する場合の価値関数Q(s(i),a(i))を学習する部分である。具体的には、学習部202aは、報酬計算部221a、価値関数更新部222a、及び行動情報生成部223aを有する。
 なお、学習部202aは、第1実施形態の学習部202と同様に、学習を継続するかどうかを判断する。学習を継続するかどうかは、例えば、機械学習を始めてからの加工プログラムの試行回数が最大試行回数に達したかどうか、又は、機械学習を始めてからの経過時間が所定時間を超えた(又は以上)かどうかに基づいて判断することができる。
 報酬計算部221aは、各固定サイクル(i)において、或る状態s(i)の下で、行動a(i)を選択した場合の報酬を各固定サイクル(i)の判定情報に基づいて算出する。なお、各固定サイクル(i)において算出される報酬は、第1実施形態の場合と同様に、(1)工具、送り軸、主軸にかかる圧力(トルク)の強さと、(2)工具、送り軸、主軸にかかる圧力(トルク)の波形の形状と、(3)加工に要した時間との項目に基づいて算出される。すなわち、例えば、固定サイクル(i)における各項目の報酬r(i)、r(i)、r(i)は、第1実施形態の報酬r、r、rと同様に算出される。
 そして、報酬計算部221aは、第1実施形態の報酬計算部221と同様に、固定サイクル(i)における加工時間優先モードの報酬rcycle(i)、及び工具寿命優先モードの報酬rtool(i)を、各項目の報酬r(i)、r(i)、r(i)と、数2式と、を用いて算出してもよい。
 価値関数更新部222aは、第1実施形態の価値関数更新部222と同様に、加工時間優先モードにおける機械学習の場合、固定サイクル(i)における状態s(i)と、行動a(i)と、行動a(i)を状態s(i)に適用した場合の状態s´(i)と、上述のように算出された報酬rcycle(i)の値と、に基づいてQ学習を行うことにより、価値関数記憶部204aが記憶する固定サイクル(i)の価値関数Qcycle_iを更新する。また、価値関数更新部222aは、工具寿命優先モードにおける機械学習の場合、固定サイクル(i)における状態s(i)と、行動a(i)と、行動a(i)を状態s(i)に適用した場合の状態s´(i)と、上述のように算出された報酬rtool(i)の値と、に基づいてQ学習を行うことにより、価値関数記憶部204aが記憶する価値関数Qtool_iを更新する。
 行動情報生成部223aは、第1実施形態の行動情報生成部223と同様に、固定サイクル(i)における現在の状態s(i)に対して、Q学習の過程における行動a(i)を選択する。行動情報生成部223aは、加工時間優先モード又は工具寿命優先モードに応じたQ学習の過程において、i番目の固定サイクルの1回分の切り込み量及び切削速度を修正する動作(Q学習における行動aに相当)を行わせるために、i番目の固定サイクルの行動情報aを生成し、生成したi番目の固定サイクルの行動情報aを行動情報出力部203aに対して出力する。
 行動情報出力部203aは、第1実施形態の行動情報出力部203と同様に、学習部202aから出力される固定サイクル(i)毎の行動情報a(i)を数値制御装置101aに対して出力する。行動情報出力部203aは、例えば固定サイクル(i)毎の行動情報としての、更新された1回分の切り込み量及び切削速度の値を、数値制御装置101aに出力するようにしてもよい。これにより、数値制御装置101aは、受信した更新された1回分の切り込み量及び切削速度の値に基づいて、加工プログラムに含まれるn個の固定サイクル(i)それぞれを更新する。そして、数値制御装置101aは、更新された固定サイクル(i)を含む加工プログラムに基づいて動作指令を生成し、生成した動作指令に基づいて工作機械10に切削加工を行わせる。
 なお、行動情報出力部203aは、固定サイクル(i)毎の行動情報としての、更新された1回分の切り込み量及び切削速度の値に基づいて各固定サイクル(i)を更新した加工プログラムを、数値制御装置101aに出力してもよい。
 価値関数記憶部204aは、固定サイクル(i)毎の加工時間優先モードの価値関数Qcycle_i、及び工具寿命優先モードの価値関数Qtool_iを記憶する記憶装置である。なお、価値関数Qcycle_i(1≦i≦n)の集合と価値関数Qcycleとの関係、及び価値関数Qtool_i(1≦i≦n)の集合と価値関数Qtoolとの関係は数3式のように表される。
Figure JPOXMLDOC01-appb-M000003
 価値関数記憶部204aに記憶された固定サイクル(i)毎の価値関数Qcycle_i、Qtool_iは、価値関数更新部222により更新される。
 最適化行動情報出力部205aは、第1実施形態の最適化行動情報出力部205と同様に、価値関数更新部222aがQ学習を行うことにより更新した加工時間優先モードの価値関数Qcycle又は工具寿命優先モードの価値関数Qtoolに基づいて、価値関数の値が最大となる動作を数値制御装置101aに行わせるための固定サイクル(i)における行動情報(最適化行動情報)aを生成する。
 より具体的には、最適化行動情報出力部205aは、価値関数記憶部204が記憶している加工時間優先モードの価値関数Qcycle及び工具寿命優先モードの価値関数Qtoolを取得する。そして、最適化行動情報出力部205aは、取得した加工時間優先モードの価値関数Qcycleに基づく固定サイクル(i)における行動情報と、取得した加工時間優先モードの価値関数Qtoolに基づく固定サイクル(i)における行動情報とを生成し、生成した固定サイクル(i)における各行動情報を数値制御装置101aに対して出力する。この最適化行動情報には、行動情報出力部203aがQ学習の過程において出力する行動情報と同様に、更新された1回分の切り込み量及び切削速度の値を示す情報が含まれる。
 以上、機械学習装置20Aに含まれる機能ブロックについて説明した。
 次に、図8のフローチャートを参照して本実施形態におけるQ学習時の機械学習装置20Aの動作について説明をする。
 図8は、第2実施形態におけるQ学習時の機械学習装置20Aの動作を示すフローチャートである。なお、図8のフローチャートのうち、図3に示したステップと同様の処理については、同じステップ番号を付し、詳細な説明は省略する。
 ステップS11aにおいて、制御部206は、加工プログラムの試行回数jを初期設定、すなわち「1」として状態情報取得部201aに状態情報の取得を指示する。
 ステップS11bにおいて、制御部206は、iを「1」に初期化する。
 ステップS12aにおいて、状態情報取得部201aは、数値制御装置101aから固定サイクル(i)の状態データs(i)を取得する。取得した状態データs(i)は、行動情報生成部223aに対して出力される。上述したように、この状態データ(状態情報)s(i)は、Q学習における固定サイクル(i)における状態s(i)に相当する情報であり、ステップS12a時点での、1回分の切り込み量、切削速度、工具の材質、工具の形状、工具径、工具長、残り工具寿命、加工対象のワークの材質、工具カタログの切削条件、主軸回転数、モータ電流値、機械温度、及び周囲温度、が含まれる。なお、最初にQ学習を開始する時点での状態データは、予めオペレータが生成するようにする。
 ステップS13aにおいて、行動情報生成部223aは、加工時間優先モード又は工具寿命優先モードにおける機械学習により、加工時間優先モード及び工具寿命優先モードの固定サイクル(i)における新たな行動情報a(i)を生成し、生成した加工時間優先モード及び工具寿命優先モードの新たな行動情報a(i)を、行動情報出力部203aを介して数値制御装置101aに対して出力する。数値制御装置101aは、受信した加工時間優先モード及び工具寿命優先モードの行動情報a(i)のうち、設定装置111により選択された行動情報a(i)に基づいて、固定サイクル(i)で設定された1回分の切り込み量及び切削速度が更新された加工プログラムを実行する。数値制御装置101aは、更新された固定サイクル(i)に基づいて動作指令を生成し、生成した動作指令に基づいて工作機械10に切削加工を行わせる。そして、数値制御装置101aは、固定サイクル(i)が完了した場合、加工プログラムをストップする。
 ステップS14において、状態情報取得部201aは、第1実施形態におけるステップS14と同様の処理を行い、数値制御装置101aから取得した固定サイクル(i)における新たな状態データs´(i)を取得する。
 ステップS15において、状態情報取得部201aは、第1実施形態におけるステップS15と同様の処理を行い、固定サイクル(i)における新たな状態s´(i)についての判定情報を取得する。取得した判定情報は、学習部202aに出力される。
 ステップS16において、報酬計算部221aは、第1実施形態におけるステップS16と同様の処理を行い、取得された判定情報に基づいて図4の報酬算算処理を行い、加工時間優先モードの固定サイクル(i)の報酬rcycle(i)、及び工具寿命優先モードの固定サイクル(i)の報酬rtool(i)をそれぞれ算出する。
 ステップS17において、価値関数更新部222aは、第1実施形態におけるステップS17と同様の処理を行い、計算された固定サイクル(i)の報酬rcycle(i)及び報酬rtool(i)に基づいて、価値関数記憶部204aが記憶している固定サイクル(i)の加工時間優先モードの価値関数Qcycle_i、及び工具寿命優先モードの価値関数Qtool_iをそれぞれ更新する。
 ステップS17aにおいて、制御部206は、iがnより小さいか否かを判定する。iがnより小さい場合、処理はステップS17bに進む。一方、iがn以上の場合、処理はステップS18に進む。
 ステップS17bにおいて、制御部206は、iを「1」増加させる。処理はステップS12aに戻る。
 ステップS18において、制御部206は、第1実施形態におけるステップS18と同様の処理を行い、機械学習を始めてからの加工プログラムの試行回数jが最大試行回数に到達したかどうかを判断する。最大試行回数に到達していなければ、ステップS19で試行回数jを「1」カウントアップして、ステップS11bに戻る。ステップS11bからステップS19までの処理は最大試行回数に到達するまで繰り返し行われる。
 なお、図8のフローは、加工プログラムの試行回数jが最大試行回数に到達したときに処理を終了させているが、ステップS11bからステップS19の処理に係る時間を、機械学習を始めてから累積した時間が、予め設定された最大経過時間を超えた(又は以上になった)ことを条件として処理を終了するようにしてもよい。
 また、ステップS17はオンライン更新を例示しているが、オンライン更新に替えてバッチ更新又はミニバッチ更新に置き換えてもよい。
 以上、図8を参照して説明した動作により、本実施形態では、変種変量生産等の現場において、オペレータの手間を増やすことなく、加工プログラムの固定サイクルを最適化するための価値関数Qcycle、Qtoolを生成することができる。
 なお、最適化行動情報出力部205aによる最適化行動情報の生成時の動作については、固定サイクル(i)毎に最適化行動情報を生成する点を除き、図5のフローチャートと同様であり説明を省略する。
 以上のように、数値制御装置101aは、設定装置111で選択された固定サイクル(i)毎の加工時間優先モード又は工具寿命優先モードにおける行動に応じて固定サイクル(i)で設定された1回分の切り込み量及び切削速度が更新された加工プログラムを実行することにより、変種変量生産等の現場において、オペレータの手間を増やすことなく、加工プログラムを最適化することができる。これにより、数値制御装置101は、加工に要する時間(すなわち、サイクルタイム)を優先して加工したり、工具寿命を優先して加工したりすることができる。
 また、数値制御装置101aは、オペレータにより1回分の切り込み量及び切削速度の引数の設定が不要になり、加工プログラムの作成の手間を削減することができる。
 以上、第2実施形態について説明した。
 以上、第1実施形態及び第2実施形態について説明したが、数値制御装置101、101a、及び機械学習装置20、20Aは、上述の実施形態に限定されるものではなく、目的を達成できる範囲での変形、改良等を含む。
<変形例1>
 上述の第1実施形態及び第2実施形態では、機械学習装置20、20Aは、加工時間優先モードと工具寿命優先モードとにおける機械学習を交互に行っているが、これに限定されない。例えば、機械学習装置20、20Aは、加工時間優先モードにおける機械学習と、工具寿命優先モードにおける機械学習とを別々に行うようにしてもよい。
<変形例2>
 また例えば、上述の第1実施形態及び第2実施形態では、設定装置111は、工作機械10で使用中の工具の残り工具寿命と予め設定された閾値との比較に基づいて、加工時間優先モードにおける行動、又は工具寿命優先モードにおける行動を選択したが、これに限定されない。
 例えば、工具の残り工具寿命が5%、残り加工部品数が3個、及び加工一回当たりの工具寿命減少量が0.1%の場合、残り加工部品数が3個のワークを加工した後の残り工具寿命は4.7%で、0%にならない。そこで、設定装置111は、残り工具寿命が閾値以下でも残り加工部品数のワークを加工しても0%にならない場合、加工時間優先モードにおける行動を選択してもよい。
 これにより、残り工具寿命が少ない場合でも、残り加工部品数に対して残り工具寿命が残っていれば、加工に要する時間(サイクルタイム)を落とさずに加工することができる。
<変形例3>
 また例えば、上述の第1実施形態及び第2実施形態では、機械学習装置20、20Aは、数値制御装置101、101aと異なる装置として例示したが、機械学習装置20、20Aの一部又は全部の機能を、数値制御装置101、101aが備えるようにしてもよい。
 あるいは、機械学習装置20の状態情報取得部201、学習部202、行動情報出力部203、価値関数記憶部204、最適化行動情報出力部205、及び制御部206、又は機械学習装置20Aの状態情報取得部201a、学習部202a、行動情報出力部203a、価値関数記憶部204a、最適化行動情報出力部205a、及び制御部206の一部又は全部を、例えば、サーバが備えるようにしてもよい。また、クラウド上で仮想サーバ機能等を利用して、機械学習装置20、20Aの各機能を実現してもよい。
 さらに、機械学習装置20、20Aは、機械学習装置20、20Aの各機能を適宜複数のサーバに分散される、分散処理システムとしてもよい。
<変形例4>
 また例えば、上述の第1実施形態及び第2実施形態では、制御システム1において、1つの工作機械10と、1つの機械学習装置20、20Aと、が通信可能に接続されたが、これに限定されない。例えば、図9に示すように、制御システム1は、m個の工作機械10A(1)-10A(m)と、m個の機械学習装置20B(1)-20B(m)とを有してもよい(mは2以上の整数)。この場合、機械学習装置20B(j)は、ネットワーク50を介して工作機械10A(j)と1対1に通信可能に接続され、工作機械10A(j)に対して機械学習を実施するようにしてもよい(jは1からmの整数)。
 なお、機械学習装置20B(j)の価値関数記憶部204(204a)に記憶された価値関数Qcycle、Qtool(Qcycle_i、Qtool_i)は、他の機械学習装置20B(k)との間で共有されるようにしてもよい(kは1からmの整数であり、k≠j)。価値関数Qcycle、Qtool(Qcycle_i、Qtool_i)を機械学習装置20B(1)-20B(m)で共有するようにすれば、各機械学習装置20Bにて分散して強化学習を行うことが可能となり、強化学習の効率を向上させることが可能となる。
 なお、工作機械10A(1)-10A(m)の各々は、図1又は図6の工作機械10に対応する。また、機械学習装置20B(1)-20B(m)の各々は、図1の機械学習装置20又は図6の機械学習装置20Aに対応する。
 また、図10に示すように、サーバ60は、機械学習装置20(20A)として動作し、ネットワーク50を介してm個の工作機械10A(1)-10A(m)と通信可能に接続され、工作機械10A(1)-10A(m)の各々に対して機械学習を実施するようにしてもよい。
 なお、第1実施形態及び第2実施形態における、数値制御装置101、101a、及び機械学習装置20、20Aに含まれる各機能は、ハードウェア、ソフトウェア又はこれらの組み合わせによりそれぞれ実現することができる。ここで、ソフトウェアによって実現されるとは、コンピュータがプログラムを読み込んで実行することにより実現されることを意味する。
 数値制御装置101、101a、及び機械学習装置20、20Aに含まれる各構成部は、電子回路等を含むハードウェア、ソフトウェア又はこれらの組み合わせにより実現することができる。ソフトウェアによって実現される場合には、このソフトウェアを構成するプログラムが、コンピュータにインストールされる。また、これらのプログラムは、リムーバブルメディアに記録されてユーザに配布されてもよいし、ネットワークを介してユーザのコンピュータにダウンロードされることにより配布されてもよい。また、ハードウェアで構成する場合、上記の装置に含まれる各構成部の機能の一部又は全部を、例えば、ASIC(Application Specific Integrated Circuit)、ゲートアレイ、FPGA(Field Programmable Gate Array)、CPLD(Complex Programmable Logic Device)等の集積回路(IC)で構成することができる。
 プログラムは、様々なタイプの非一時的なコンピュータ可読媒体(Non-transitory computer readable medium)を用いて格納され、コンピュータに供給することができる。非一時的なコンピュータ可読媒体は、様々なタイプの実体のある記録媒体(Tangible storage medium)を含む。非一時的なコンピュータ可読媒体の例は、磁気記録媒体(例えば、フレキシブルディスク、磁気テープ、ハードディスクドライブ)、光磁気記録媒体(例えば、光磁気ディスク)、CD-ROM(Read Only Memory)、CD-R、CD-R/W、半導体メモリ(例えば、マスクROM、PROM(Programmable ROM)、EPROM(Erasable PROM)、フラッシュROM、RAM)を含む。また、プログラムは、様々なタイプの一時的なコンピュータ可読媒体(Transitory computer readable medium)によってコンピュータに供給されてもよい。一時的なコンピュータ可読媒体の例は、電気信号、光信号、及び電磁波を含む。一時的なコンピュータ可読媒体は、電線及び光ファイバ等の有線通信路、又は、無線通信路を介して、プログラムをコンピュータに供給できる。
 なお、記録媒体に記録されるプログラムを記述するステップは、その順序に沿って時系列的に行われる処理はもちろん、必ずしも時系列的に処理されなくとも、並列的あるいは個別に実行される処理をも含むものである。
 以上を換言すると、本開示の機械学習装置、設定装置、数値制御システム、数値制御装置、及び機械学習方法は、次のような構成を有する各種各様の実施形態を取ることができる。
 (1)本開示の機械学習装置20は、加工プログラムに基づいて工作機械10を動作させる数値制御装置101に対して機械学習を行う機械学習装置であって、少なくとも1回分の切り込み量及び切削速度が設定された加工プログラムを数値制御装置101が実行することで、工作機械10に切削加工を行わせることにより、1回分の切り込み量及び切削速度を含む状態情報を、取得する状態情報取得部201と、状態情報に含まれる1回分の切り込み量及び切削速度の調整情報を含む行動情報を出力する行動情報出力部203と、少なくとも切削加工における工具にかかる圧力の強さと、工具にかかる圧力の波形の形状と、加工に要した時間とについての情報である判定情報を取得し、取得した判定情報に基づいて、所定の条件に応じた強化学習における報酬値を出力する報酬計算部221と、報酬値と、状態情報と、行動情報とに基づいて価値関数Qを更新する価値関数更新部222と、を備える。
 この機械学習装置20によれば、オペレータの手間を増やすことなく、加工プログラムを最適化することができる。
 (2) (1)に記載の機械学習装置20において、所定の条件は、加工時間を優先する条件、及び工具の寿命を優先する条件のいずれかであり、報酬計算部221は、加工時間を優先する条件では報酬rcycleを出力し、工具の寿命を優先する条件では報酬rtoolを出力し、価値関数更新部222は、加工時間を優先する条件では報酬rcycleと、状態情報と、行動情報とに基づいて価値関数Qcycleを更新し、工具の寿命を優先する条件では報酬rtoolと、状態情報と、行動情報とに基づいて価値関数Qtoolを更新してもよい。
 そうすることで、オペレータの手間を増やすことなく、加工プログラムの固定サイクルを最適化するための価値関数Qcycle、Qtoolを生成することができる。
 (3) (2)に記載の機械学習装置20、20Aにおいて、機械学習は、加工プログラムが実行される毎、又は加工プログラムに含まれる複数の固定サイクルそれぞれが実行される毎に行われてもよい。
 そうすることで、ワーク加工毎、固定サイクル毎に加工プログラムを最適化することができる。
 (4) (2)又は(3)に記載の機械学習装置20、20Aにおいて、報酬rcycleに基づいて更新された価値関数Qcycleの値が最大となる行動情報、及び報酬rtoolに基づいて更新された価値関数Qtoolの値が最大となる行動情報を出力する最適化行動情報出力部205、205aをさらに備えてもよい。
 そうすることで、機械学習装置20、20Aは、工具の状態に応じて加工プログラムを最適化することができる。
 (5) (1)に記載の機械学習装置20において、報酬計算部221は、判定情報に含まれる加工に要した時間が前回の加工に要した時間より減少した場合に報酬rcycle、rtoolを正の値とし、加工に要した時間が前回の加工に要した時間より増加した場合に報酬rcycle、rtoolを負の値としてもよい。
 そうすることで、機械学習装置20は、加工に要した時間に応じて加工プログラムを最適化することができる。
 (6) (1)に記載の機械学習装置20において、報酬計算部221は、判定情報に含まれる工具にかかる圧力の波形の形状が少なくとも工具が破壊される予兆を示す波形の形状及び工具の寿命の急激な減少を示す波形の形状と相似しない場合に報酬rcycle、rtoolを正の値とし、工具にかかる圧力の波形の形状が少なくとも工具が破壊される予兆を示す波形の形状又は工具の寿命の急激な減少を示す波形の形状と相似する場合に報酬rcycle、rtoolを負の値としてもよい。
 そうすることで、機械学習装置20は、加工の安全を考慮しつつ加工プログラムを最適化することができる。
 (7) (1)から(6)のいずれかに記載の機械学習装置20、20Aにおいて、機械学習の最大試行回数を設けて、機械学習を行ってもよい。
 そうすることで、機械学習装置20、20Aは、機械学習が長時間に亘って行われることを回避することができる。
 (8)本開示の設定装置111は、(1)から(7)のいずれかに記載の機械学習装置から取得した行動のうち予め設定された閾値に基づいていずれかの行動を選択して、選択した行動を加工プログラムに設定する。
 この設定装置111によれば、(1)から(7)と同様の効果を奏することができる。
 (9)本開示の数値制御システム1は、(1)から(7)のいずれかに記載の機械学習装置20、20Aと、(8)に記載の設定装置111と、設定装置111によって設定された加工プログラムを実行する数値制御装置101、101aと、を備える。
 この数値制御システム1によれば、(1)から(7)と同様の効果を奏することができる。
 (10)本開示の数値制御装置101、101aは、(1)から(7)のいずれかに記載の機械学習装置20、20Aと、(8)に記載の設定装置111と、を含み、設定装置111によって設定された加工プログラムを実行する。
 この数値制御装置101、101aによれば、(1)から(7)と同様の効果を奏することができる。
 (11)本開示の数値制御方法は、加工プログラムに基づいて工作機械10を動作させる数値制御装置101、101aに対して機械学習を行う機械学習装置20、20Aの機械学習方法であって、少なくとも1回分の切り込み量及び切削速度が設定された加工プログラムを数値制御装置101、101aが実行することで、工作機械10に切削加工を行わせることにより、1回分の切り込み量及び切削速度を含む状態情報を、取得し、状態情報に含まれる1回分の切り込み量及び切削速度の調整情報を含む行動情報を出力し、少なくとも切削加工における工具にかかる圧力の強さと、工具にかかる圧力の波形の形状と、加工に要した時間とについての情報である判定情報を取得し、取得した判定情報に基づいて、所定の条件に応じた強化学習における報酬値を出力し、報酬値と、状態情報と、行動情報とに基づいて価値関数Qを更新する。
 この数値制御方法によれば、(1)と同様の効果を奏することができる。
 1 数値制御システム
 10 工作機械
 101、101a 数値制御装置
 111 設定装置
 20、20A 機械学習装置
 201、201a 状態情報取得部
 202、202a 学習部
 221、221a 報酬計算部
 222、222a 価値関数更新部
 223、223a 行動情報生成部
 203、203a 行動情報出力部
 204、204a 価値関数記憶部
 205、205a 最適化行動情報出力部
 206 制御部

Claims (11)

  1.  加工プログラムに基づいて工作機械を動作させる数値制御装置に対して機械学習を行う機械学習装置であって、
     少なくとも1回分の切り込み量及び切削速度が設定された前記加工プログラムを前記数値制御装置が実行することで、前記工作機械に切削加工を行わせることにより、前記1回分の切り込み量及び前記切削速度を含む状態情報を、取得する状態情報取得部と、
     前記状態情報に含まれる前記1回分の切り込み量及び前記切削速度の調整情報を含む行動情報を出力する行動情報出力部と、
     少なくとも前記切削加工における工具にかかる圧力の強さと、前記工具にかかる前記圧力の波形の形状と、加工に要した時間とについての情報である判定情報を取得し、取得した前記判定情報に基づいて、所定の条件に応じた強化学習における報酬値を出力する報酬計算部と、
     前記報酬値と、前記状態情報と、前記行動情報とに基づいて価値関数を更新する価値関数更新部と、
     を備える機械学習装置。
  2.  前記所定の条件は、加工時間を優先する条件、及び前記工具の寿命を優先する条件のいずれかであり、
     前記報酬計算部は、前記加工時間を優先する条件では第1報酬値を出力し、前記工具の寿命を優先する条件では第2報酬値を出力し、
     前記価値関数更新部は、前記加工時間を優先する条件では前記第1報酬値と、前記状態情報と、前記行動情報とに基づいて第1価値関数を更新し、前記工具の寿命を優先する条件では前記第2報酬値と、前記状態情報と、前記行動情報とに基づいて第2価値関数を更新する、請求項1に記載の機械学習装置。
  3.  前記機械学習は、前記加工プログラムが実行される毎、又は前記加工プログラムに含まれる複数の固定サイクルそれぞれが実行される毎に行われる、請求項2に記載の機械学習装置。
  4.  前記第1報酬値に基づいて更新された前記第1価値関数の値が最大となる第1行動情報、及び前記第2報酬値に基づいて更新された前記第2価値関数の値が最大となる第2行動情報を出力する最適化行動情報出力部をさらに備える、請求項2又は請求項3に記載の機械学習装置。
  5.  前記報酬計算部は、前記判定情報に含まれる前記加工に要した時間が前回の加工に要した時間より減少した場合に前記報酬値を正の値とし、前記加工に要した時間が前回の加工に要した時間より増加した場合に前記報酬値を負の値とする、請求項1に記載の機械学習装置。
  6.  前記報酬計算部は、前記判定情報に含まれる前記工具にかかる圧力の波形の形状が少なくとも前記工具が破壊される予兆を示す波形の形状及び前記工具の寿命の急激な減少を示す波形の形状と相似しない場合に前記報酬値を正の値とし、前記工具にかかる圧力の波形の形状が少なくとも前記工具が破壊される予兆を示す波形の形状又は前記工具の寿命の急激な減少を示す波形の形状と相似する場合に前記報酬値を負の値とする、請求項1に記載の機械学習装置。
  7.  前記機械学習の最大試行回数を設けて、前記機械学習を行う、請求項1から請求項6のいずれか1項に記載の機械学習装置。
  8.  請求項1から請求項7のいずれか1項に記載の機械学習装置から取得した行動のうち予め設定された閾値に基づいていずれかの行動を選択して、選択した前記行動を前記加工プログラムに設定する設定装置。
  9.  請求項1から請求項7のいずれか1項に記載の機械学習装置と、
     請求項8に記載の設定装置と、
     前記設定装置によって設定された前記加工プログラムを実行する数値制御装置と、
     を備える数値制御システム。
  10.  請求項1から請求項7のいずれか1項に記載の機械学習装置と、請求項8に記載の設定装置と、を含み、前記設定装置によって設定された前記加工プログラムを実行する数値制御装置。
  11.  加工プログラムに基づいて工作機械を動作させる数値制御装置に対して機械学習を行う機械学習装置の機械学習方法であって、
     少なくとも1回分の切り込み量及び切削速度が設定された前記加工プログラムを前記数値制御装置が実行することで、前記工作機械に切削加工を行わせることにより、前記1回分の切り込み量及び前記切削速度を含む状態情報を、取得し、
     前記状態情報に含まれる前記1回分の切り込み量及び前記切削速度の調整情報を含む行動情報を出力し、
     少なくとも前記切削加工における工具に係る圧力の強さと、前記工具に係る前記圧力の波形の形状と、加工に要した時間とについての情報である判定情報を取得し、取得した前記判定情報に基づいて、所定の条件に応じた強化学習における報酬値を出力し、
     前記報酬値と、前記状態情報と、前記行動情報とに基づいて価値関数を更新する、
     機械学習方法。
PCT/JP2021/009488 2020-03-17 2021-03-10 機械学習装置、数値制御システム、設定装置、数値制御装置、及び機械学習方法 WO2021187268A1 (ja)

Priority Applications (4)

Application Number Priority Date Filing Date Title
DE112021001677.6T DE112021001677T5 (de) 2020-03-17 2021-03-10 Maschinenlernvorrichtung, Numerik-Steuersystem, Einstellvorrichtung, Numeriksteuervorrichtung und Maschinenlernverfahren
JP2022508254A JP7436632B2 (ja) 2020-03-17 2021-03-10 機械学習装置、数値制御システム、設定装置、数値制御装置、及び機械学習方法
CN202180021050.6A CN115280252A (zh) 2020-03-17 2021-03-10 机器学习装置、数值控制系统、设定装置、数值控制装置以及机器学习方法
US17/802,420 US20230083761A1 (en) 2020-03-17 2021-03-10 Machine learning device, numerical control system, setting device, numerical control device, and machine learning method

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2020046070 2020-03-17
JP2020-046070 2020-03-17

Publications (1)

Publication Number Publication Date
WO2021187268A1 true WO2021187268A1 (ja) 2021-09-23

Family

ID=77771271

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2021/009488 WO2021187268A1 (ja) 2020-03-17 2021-03-10 機械学習装置、数値制御システム、設定装置、数値制御装置、及び機械学習方法

Country Status (5)

Country Link
US (1) US20230083761A1 (ja)
JP (1) JP7436632B2 (ja)
CN (1) CN115280252A (ja)
DE (1) DE112021001677T5 (ja)
WO (1) WO2021187268A1 (ja)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07164199A (ja) * 1993-12-10 1995-06-27 Japan Automat Mach Co Ltd プレス加工機の品質管理方法及びその装置
JP2019021235A (ja) * 2017-07-21 2019-02-07 ファナック株式会社 機械学習装置、数値制御装置、数値制御システム、及び機械学習方法

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6802213B2 (ja) 2018-04-26 2020-12-16 ファナック株式会社 工具選定装置及び機械学習装置
JP6975679B2 (ja) 2018-05-18 2021-12-01 株式会社日立製作所 回転機診断システム、情報処理装置及び回転機診断方法

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07164199A (ja) * 1993-12-10 1995-06-27 Japan Automat Mach Co Ltd プレス加工機の品質管理方法及びその装置
JP2019021235A (ja) * 2017-07-21 2019-02-07 ファナック株式会社 機械学習装置、数値制御装置、数値制御システム、及び機械学習方法

Also Published As

Publication number Publication date
JPWO2021187268A1 (ja) 2021-09-23
DE112021001677T5 (de) 2023-01-05
CN115280252A (zh) 2022-11-01
JP7436632B2 (ja) 2024-02-21
US20230083761A1 (en) 2023-03-16

Similar Documents

Publication Publication Date Title
JP6608879B2 (ja) 機械学習装置、数値制御装置、数値制御システム、及び機械学習方法
JP7010877B2 (ja) 機械学習装置、数値制御システム及び機械学習方法
JP6219897B2 (ja) 最適な加減速を生成する工作機械
JP6235543B2 (ja) 加工機のサイクル加工時間を最適化する機械学習装置、モータ制御装置、加工機、および機械学習方法
CN109116811B (zh) 机器学习装置和方法、伺服控制装置、伺服控制系统
JP6077617B1 (ja) 最適な速度分布を生成する工作機械
JP6453919B2 (ja) 行動情報学習装置、行動情報最適化システム及び行動情報学習プログラム
JP6564432B2 (ja) 機械学習装置、制御システム、制御装置、及び機械学習方法
JP2018152012A (ja) 機械学習装置、サーボ制御装置、サーボ制御システム、及び機械学習方法
CN110286645B (zh) 机器学习装置、伺服控制装置、伺服控制系统以及机器学习方法
JP2017030067A (ja) 加工時間測定機能とオンマシン測定機能を有する制御装置付き加工装置
CN108388205B (zh) 学习模型构建装置以及控制信息最优化装置
CN110083080A (zh) 机器学习装置及方法、伺服电动机控制装置及系统
JP6784722B2 (ja) 出力装置、制御装置、及び評価関数値の出力方法
JP6841852B2 (ja) 制御装置及び制御方法
JP6978452B2 (ja) 機械学習装置、制御装置、及び機械学習の探索範囲の設定方法
WO2021187268A1 (ja) 機械学習装置、数値制御システム、設定装置、数値制御装置、及び機械学習方法
JP7101091B2 (ja) モータ制御装置のフィードフォワード制御器導出装置、モータ制御装置、制御装置、及びフィードフォワード制御器導出方法
WO2022153936A1 (ja) 機械学習装置
CN110138296A (zh) 机器学习装置和方法、伺服电动机控制装置和系统
JP6836540B2 (ja) 情報処理装置及び情報処理方法
JP7492080B2 (ja) 加工条件推定装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21770648

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2022508254

Country of ref document: JP

Kind code of ref document: A

122 Ep: pct application non-entry in european phase

Ref document number: 21770648

Country of ref document: EP

Kind code of ref document: A1