Introducing the rank-weight method into the basic ant colony optimization (ACO), we use the modified ACO to optimize the weights and thresholds value of neural networks (NN). And when the BPNN is being trained, this method can solve the disadvantages of running into the minimum easily, and enhance the convergence speed. So we get a heuristic method, which is good at time efficiency and derivation efficiency that is ACOrw-BP. Then this method was used to identify the speed of the motor in direct torque control (DTC).The results of the simulation showed that: the modified ACOrw-BP neural network not only has the ability of mapping widely, but also enhancing the operation efficiency obviously. The speed of the motor can be identified accurately by this method, and the result is good. So, it implements the direct torque control of speed sensorless.