WO2021103254A1 - 位移控制方法、***、伺服电机及存储介质 - Google Patents

位移控制方法、***、伺服电机及存储介质 Download PDF

Info

Publication number
WO2021103254A1
WO2021103254A1 PCT/CN2019/129085 CN2019129085W WO2021103254A1 WO 2021103254 A1 WO2021103254 A1 WO 2021103254A1 CN 2019129085 W CN2019129085 W CN 2019129085W WO 2021103254 A1 WO2021103254 A1 WO 2021103254A1
Authority
WO
WIPO (PCT)
Prior art keywords
displacement
motor
block
encoder
motion block
Prior art date
Application number
PCT/CN2019/129085
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 歌尔股份有限公司
Publication of WO2021103254A1 publication Critical patent/WO2021103254A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05DSYSTEMS FOR CONTROLLING OR REGULATING NON-ELECTRIC VARIABLES
    • G05D13/00Control of linear speed; Control of angular speed; Control of acceleration or deceleration, e.g. of a prime mover
    • G05D13/62Control of linear speed; Control of angular speed; Control of acceleration or deceleration, e.g. of a prime mover characterised by the use of electric means, e.g. use of a tachometric dynamo, use of a transducer converting an electric value into a displacement

Definitions

  • the invention relates to the technical field of motor control, in particular to a displacement control method, system, servo motor and storage medium.
  • servo motors In many areas of modern industrial production, position motions with high-precision errors of microns are required. This function is mainly realized by servo motors.
  • servo motors usually use high-precision absolute encoders or incremental encoders. Among them, incremental encoders have become the mainstream due to their moderate cost and convenient operation. However, the accuracy of servo motors using incremental encoders is lower. low.
  • the servo motor In order to improve the accuracy of the servo motor, it is usually necessary to accurately control the movement displacement of the motor.
  • Most of the prior art uses external positioning sensors, such as Hall sensors, photoelectric switches and other position sensors.
  • the sensor is placed near the zero point as a positioning reference for the zero return point of the servo motor, and then the movement displacement of the servo motor is determined according to the zero return point.
  • the moving block is moved in a certain direction at a constant speed. If the position sensor detects the moving block during traveling, the servo motor controls the moving block to decelerate and stop. When the moving block is completely stopped, the position of the moving block is Set it to the zero point, and then control the motion block to move to the desired position based on the zero point.
  • the above displacement control method when detecting that the position sensor starts to decelerate and stop, is affected by the motor speed control error, the sensor response error and the mechanical transmission structure (such as machining and assembly errors, structural running-in degree, etc.), the stop position error is relatively large , Resulting in inaccurate zero point positioning and inaccurate displacement control.
  • the main purpose of the present invention is to provide a displacement control method, system, servo motor and storage medium, aiming to solve the technical problem of inaccurate displacement control when the motor is running in the prior art.
  • the present invention provides a displacement control method, which includes the following steps:
  • control the motor movement block When the collision is successful, control the motor movement block to run away from the limit block, and detect in real time whether the Z signal sent by the encoder is received;
  • the operating displacement of the motor moving block is determined according to the zero point position.
  • the step of determining the operating displacement of the motor moving block according to the zero point position includes:
  • the displacement compensation value corresponding to each displacement coordinate is used as the correction value to correspondingly correct the displacement of each displacement coordinate to obtain the running displacement of the motor motion block.
  • the method before the step of compensating the displacement coordinate system according to a preset position compensation table, the method further includes:
  • the training step includes: reading the displacement coordinates from the training displacement coordinate system, and when the motor motion block reaches the displacement coordinates, controlling the motor motion block to run with the displacement command value , And measure the actual displacement value of the motor moving block;
  • the step of determining the zero point position according to the first encoder value and the second encoder value based on a preset algorithm includes:
  • the actual position is taken as the zero position.
  • the step of compensating the parking distance based on a sinusoidal S-curve algorithm to obtain the actual position of the motor moving block when it stops includes:
  • the current position of the motor motion block is recorded, and the current position is taken as the actual position when the motor motion block stops.
  • the sine S-curve algorithm is:
  • V p is a preset target speed
  • S p is the stopping distance
  • t is the running time
  • j (t) is a jerk of the motor motion block.
  • the step of performing collision detection on the motor moving block includes:
  • the collision time is not less than the first preset time, and the collision position is not greater than the preset displacement, it is determined that the collision is successful.
  • the present invention also provides a displacement control system, the displacement control system including:
  • the collision detection module is used to control the motor moving block to run toward the limit block, and to perform collision detection on the motor moving block;
  • the signal detection module is used to control the motor movement block to run away from the limit block when the collision is successful, and to detect in real time whether the Z signal sent by the encoder is received;
  • the encoder reading module is used to read the first encoder value from the encoder when the Z signal is detected, and control the motor motion block to decelerate, so as to read the motor motion block when the motor motion block stops.
  • Second encoder value Second encoder value
  • a zero point determination module configured to determine a zero point position according to the first encoder value and the second encoder value based on a preset algorithm
  • the displacement compensation module is used to determine the operating displacement of the motor moving block according to the zero point position.
  • the present invention also provides a servo motor, the servo motor includes: a memory, a processor, and a displacement control program stored in the memory and running on the processor, the displacement The control program is configured to implement the steps of the displacement control method as described above.
  • the present invention also provides a storage medium with a displacement control program stored on the storage medium, and when the displacement control program is executed by a processor, the steps of the above-mentioned displacement control method are realized.
  • the invention controls the movement of the motor movement block towards the limit block and performs collision detection on the motor movement block; when the collision is successful, the motor movement block is controlled to run away from the limit block, and it is detected in real time whether the Z signal sent by the encoder is received; Read the first encoder value from the encoder when the Z signal is detected, and control the motor motion block to decelerate to read the second encoder value when the motor motion block stops; based on the preset algorithm according to the first encoder value And the second encoder value to determine the zero point position; according to the zero point position to determine the running displacement of the motor movement block.
  • the Z signal detection and the distance compensation for the decelerating operation of the motor movement block realize the precise positioning of the zero point, thereby realizing the precise control of the displacement of the motor movement block, reducing the displacement control error, and improving the servo using the incremental encoder.
  • the accuracy of the motor is the accuracy of the motor.
  • FIG. 1 is a schematic diagram of the structure of a servo motor in a hardware operating environment involved in a solution of an embodiment of the present invention
  • FIG. 3 is a schematic flowchart of a second embodiment of a displacement control method according to the present invention.
  • FIG. 4 is a schematic flowchart of a third embodiment of a displacement control method according to the present invention.
  • Fig. 5 is a functional block diagram of the first embodiment of the displacement control system of the present invention.
  • FIG. 1 is a schematic structural diagram of a servo motor in a hardware operating environment involved in a solution of an embodiment of the present invention.
  • the servo motor may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005.
  • the communication bus 1002 is used to realize the connection and communication between these components.
  • the user interface 1003 may include a display screen (Display) and an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface.
  • the network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).
  • the memory 1005 may be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as a magnetic disk memory.
  • the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
  • FIG. 1 does not constitute a limitation on the servo motor, and may include more or less components than those shown in the figure, or combine certain components, or arrange different components.
  • a memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a displacement control program.
  • the network interface 1004 is mainly used for data communication with an external network;
  • the user interface 1003 is mainly used for receiving user input instructions;
  • the servo motor uses the processor 1001 to call the displacement stored in the memory 1005 Control the program and perform the following operations:
  • control the motor movement block When the collision is successful, control the motor movement block to run away from the limit block, and detect in real time whether the Z signal sent by the encoder is received;
  • the operating displacement of the motor moving block is determined according to the zero point position.
  • processor 1001 may call the displacement control program stored in the memory 1005, and also perform the following operations:
  • the displacement compensation value corresponding to each displacement coordinate is used as the correction value to correspondingly correct the displacement of each displacement coordinate to obtain the running displacement of the motor motion block.
  • processor 1001 may call the displacement control program stored in the memory 1005, and also perform the following operations:
  • the training step includes: reading the displacement coordinates from the training displacement coordinate system, and when the motor motion block reaches the displacement coordinates, controlling the motor motion block to run with the displacement command value , And measure the actual displacement value of the motor moving block;
  • processor 1001 may call the displacement control program stored in the memory 1005, and also perform the following operations:
  • the actual position is taken as the zero position.
  • processor 1001 may call the displacement control program stored in the memory 1005, and also perform the following operations:
  • the current position of the motor motion block is recorded, and the current position is taken as the actual position when the motor motion block stops.
  • processor 1001 may call the displacement control program stored in the memory 1005, and also perform the following operations:
  • the collision time is not less than the first preset time, and the collision position is not greater than the preset displacement, it is determined that the collision is successful.
  • the motor motion block is controlled to run toward the limit block, and collision detection is performed on the motor motion block; when the collision is successful, the motor motion block is controlled to run away from the limit block, and real-time detection of whether the Z signal sent by the encoder is received ;
  • the Z signal is detected, read the first encoder value from the encoder, and control the motor motion block to decelerate to read the second encoder value when the motor motion block stops; based on the preset algorithm according to the first encoder Value and the second encoder value to determine the zero position; according to the zero position to determine the running displacement of the motor movement block.
  • the Z signal detection and the distance compensation for the decelerating operation of the motor movement block realize the precise positioning of the zero point, thereby realizing the precise control of the displacement of the motor movement block, reducing the displacement control error, and improving the servo using the incremental encoder.
  • the accuracy of the motor is the accuracy of the motor.
  • FIG. 2 is a schematic flowchart of a first embodiment of a displacement control method according to the present invention.
  • the displacement control method includes the following steps:
  • S10 Control the motor motion block to run toward the limit block, and perform collision detection on the motor motion block;
  • the traditional zero-point positioning method is to place the sensor near the zero point and move the motor motion block to a fixed direction at a constant speed.
  • the sensor When the sensor is detected, it will decelerate and stop, and set the position when the motor motion block is completely stopped. Is zero.
  • the true zero point is not the same as the position where the motor motion block completely stops. This results in a large error in the zero point positioning, which affects the accuracy of displacement control.
  • the sensor is eliminated, and the limit block, the encoder and the corresponding program control in the servo motor are used to achieve precise zero point positioning, and finally the precise control of the movement and displacement of the servo motor is realized.
  • the collision detection is to detect whether the motor moving block collides with the limit block, and there are many detection methods.
  • the collision current, collision time, and collision displacement of the motor moving block are respectively detected during collision detection; only when three conditions are met at the same time, that is, when the collision current is not less than the preset current, the collision When the time is not less than the first preset time and the collision position is not greater than the preset displacement, it is determined that the collision is successful, so as to ensure that the collision is sufficient.
  • the three-phase inverter module is the drive hardware of the motor and is used to drive the motor to run.
  • the collision current is not less than the preset current and the collision time is not less than the first preset time, it means that the current is too large and the duration is long. At this time, it is necessary to control the three-phase inverter module to shut down to stop the three-phase inverter module from driving.
  • the motor movement block can effectively protect the three-phase inverter module.
  • the encoder may use an incremental encoder, such as an ABZ signal incremental encoder.
  • Incremental encoders directly use the principle of photoelectric conversion to output three sets of square wave pulses A, B and Z phases. The phase difference between the two sets of pulses A and B is 90, so that the direction of rotation can be easily judged, and the Z phase is one per revolution. Pulse, used for zero point positioning.
  • the Nth Z signal when the Nth Z signal is detected, it is determined whether the time for detecting the Nth Z signal is greater than the second preset time; where N is a preset positive integer; if so, the three-phase inverse is controlled The variable module is closed; if not, the first encoder value is read from the encoder.
  • the position of the Z signal in a circle is the zero position.
  • the counting error caused by the loss of pulses of the incremental signal can be corrected in a circle.
  • the engineer can select the value of the encoder at the Nth Z signal as the first encoder value according to the specific hardware conditions of the servo motor.
  • the encoder fails, the signal cannot be found or the time to find the Nth Z signal is too long, in order to protect the drive hardware, the three-phase inverter module needs to be turned off as well.
  • the decelerating operation of the motor motion block at this time means that the motor motion block decelerates from the limit block.
  • the incremental encoder converts the displacement into a periodic electrical signal, and then converts this electrical signal into a count pulse, the number of pulses is used to indicate the magnitude of the displacement, so the value of the first encoder is And the second encoder value can calculate the displacement of the motor motion block in different time periods.
  • S40 Determine a zero point position according to the first encoder value and the second encoder value based on a preset algorithm
  • the preset algorithm is used to compensate for the parking distance through a reverse compensation method to eliminate the parking error of the motor moving block, thereby reducing the positioning error and completing precise positioning.
  • S50 Determine the operating displacement of the motor moving block according to the zero point position.
  • the displacement coordinate system is established based on the precise zero position to cover all the displacements of the motor movement block. Controlling the motor movement block according to the displacement coordinate system can effectively improve the accuracy of the displacement control.
  • the motor motion block is controlled to run toward the limit block, and collision detection is performed on the motor motion block; when the collision is successful, the motor motion block is controlled to run away from the limit block, and real-time detection of whether the Z signal sent by the encoder is received ;
  • the Z signal is detected, read the first encoder value from the encoder, and control the motor motion block to decelerate to read the second encoder value when the motor motion block stops; based on the preset algorithm according to the first encoder Value and the second encoder value to determine the zero position; according to the zero position to determine the running displacement of the motor movement block.
  • the Z signal detection and the distance compensation for the decelerating operation of the motor movement block realize the precise positioning of the zero point, thereby realizing the precise control of the displacement of the motor movement block, reducing the displacement control error, and improving the servo using the incremental encoder.
  • the accuracy of the motor is the accuracy of the motor.
  • step S50 specifically includes the following steps:
  • the vertical motion system is generally composed of a load, an encoder, a driver and a motor body, and the motor and the above-mentioned equipment are controlled by a motion control card or PLC using a cable connection.
  • the motor body structure includes a moving block and a limit block.
  • the displacement coordinate system established thereby covers the zero position to the stroke of the motor motion block For all displacements, and in actual movement, the compensation method of the transmission structure error is adopted to ensure the accuracy of the running displacement.
  • the training step includes: reading the displacement coordinates from the training displacement coordinate system, and controlling the movement of the motor when the motor movement block reaches the displacement coordinates
  • the block runs with the displacement command value, and the actual displacement value of the motor motion block is measured; it is detected whether all the displacement coordinates in the training displacement coordinate system have been read; if so, the corresponding displacements in the training displacement coordinate system
  • the coordinates, the displacement command value and the actual displacement value are stored in the preset position compensation table.
  • the training displacement coordinate system is established according to actual application scenarios.
  • the method of establishing the training displacement coordinate system may be to divide the entire stroke into several sections, and select a point in each section as the displacement coordinate.
  • this embodiment does not impose restrictions on this.
  • the motor motion block After the training displacement coordinate system is established, by sending the displacement command value, the motor motion block is made to run in the full stroke, and the displacement command value corresponding to each displacement coordinate and the measured actual displacement value are obtained in real time, and the command value is compared with the actual For the difference of the measured values, these values are formed into a preset position compensation table and imported into the driver program, and the corresponding compensation is added through the program to finally ensure the accuracy of the displacement.
  • step S40 specifically includes the following steps:
  • S41 Determine the parking distance according to the difference between the second encoder value and the first encoder value
  • the second encoder value can be used to calculate the displacement of the motor motion block when it runs to deceleration.
  • the difference between the value and the first encoder value can determine the stopping distance of the motor moving block during deceleration.
  • S42 Compensate the parking distance based on a sinusoidal S-curve algorithm to obtain the actual position of the motor moving block when it stops;
  • the jerk of the motor motion block is obtained based on the sine S-curve algorithm according to the parking distance and the preset target speed; the motor motion block is controlled to run with the jerk toward the limit block; when the motor moves When the running distance of the block is the parking distance, the current position of the motor motion block is recorded, and the current position is taken as the actual position when the motor motion block stops.
  • sine S-curve algorithm is:
  • V p is a preset target speed
  • S p is the stopping distance
  • t is the running time
  • j (t) is a jerk of the motor motion block.
  • the jerk of the trapezoidal and parabolic acceleration curves is a step function, and there is a step transformation, which makes the speed change of the motor not stable enough.
  • the jerk of the sine acceleration curve is a sine function, which can be continuously derived, so sine The curve can better conform to the characteristic that the torque of the stepper motor decreases with the increase of speed, make full use of the effective torque of the motor, and at the same time can reduce the mechanical shock.
  • the acceleration and deceleration operation of the moving block of the motion path control motor is planned by the sinusoidal S-curve algorithm, while accurately and backwardly compensating the parking distance, the accuracy of the position is ensured, and precise positioning is realized.
  • the present invention further provides a displacement control system.
  • Fig. 5 is a functional block diagram of the first embodiment of the displacement control system of the present invention.
  • the displacement control system includes:
  • the collision detection module 10 is used to control the motor motion block to run toward the limit block, and perform collision detection on the motor motion block;
  • the traditional displacement control method is to place the sensor near the zero point, and move the motor motion block to a fixed direction at a constant speed. When the sensor is detected, it will decelerate and stop, and set the position when the motor motion block is completely stopped. Is zero. However, because the motor motion block needs time to stop and will run for a certain distance, the true zero point is not the same as the position where the motor motion block completely stops, resulting in a large error in the displacement control.
  • the sensor is eliminated, and the limit block, the encoder and the corresponding program control in the servo motor are used to achieve precise displacement control.
  • the collision detection is to detect whether the motor moving block collides with the limit block, and there are many detection methods.
  • the collision current, collision time, and collision displacement of the motor moving block are respectively detected during collision detection; only when three conditions are met at the same time, that is, when the collision current is not less than the preset current, the collision When the time is not less than the first preset time and the collision position is not greater than the preset displacement, it is determined that the collision is successful, so as to ensure that the collision is sufficient.
  • the three-phase inverter module is the drive hardware of the motor and is used to drive the motor to run.
  • the collision current is not less than the preset current and the collision time is not less than the first preset time, it means that the current is too large and the duration is long. At this time, it is necessary to control the three-phase inverter module to shut down to stop the three-phase inverter module from driving.
  • the motor movement block can effectively protect the three-phase inverter module.
  • the signal detection module 20 is used to control the motor movement block to run away from the limit block when the collision is successful, and to detect in real time whether the Z signal sent by the encoder is received;
  • the encoder may use an incremental encoder.
  • Incremental encoders directly use the principle of photoelectric conversion to output three sets of square wave pulses A, B and Z phases.
  • the phase difference between the two sets of pulses A and B is 90, so that the direction of rotation can be easily judged, and the Z phase is one per revolution. Pulse, used for zero point positioning.
  • the encoder reading module 30 is used to read the first encoder value from the encoder when the Z signal is detected, and control the motor motion block to decelerate to run, so as to read when the motor motion block stops The second encoder value;
  • the Nth Z signal when the Nth Z signal is detected, it is determined whether the time for detecting the Nth Z signal is greater than the second preset time; where N is a preset positive integer; if so, the three-phase inverse is controlled The variable module is closed; if not, the first encoder value is read from the encoder.
  • the position of the Z signal in a circle is the zero position.
  • the counting error caused by the loss of pulses of the incremental signal can be corrected in a circle.
  • the engineer can select the value of the encoder at the Nth Z signal as the first encoder value according to the specific hardware conditions of the servo motor.
  • the encoder fails, the signal cannot be found or the time to find the Nth Z signal is too long, in order to protect the drive hardware, the three-phase inverter module needs to be turned off as well.
  • the decelerating operation of the motor motion block at this time means that the motor motion block decelerates from the limit block.
  • the incremental encoder converts the displacement into a periodic electrical signal, and then converts this electrical signal into a count pulse, the number of pulses is used to indicate the magnitude of the displacement, so the value of the first encoder is And the second encoder value can calculate the displacement of the motor motion block in different time periods.
  • the distance compensation module 40 is configured to determine a zero point position according to the first encoder value and the second encoder value based on a preset algorithm
  • the preset algorithm is used to compensate for the parking distance through a reverse compensation method to eliminate the parking error of the motor moving block, thereby reducing the positioning error and completing precise positioning.
  • the displacement determining module 50 is configured to determine the operating displacement of the motor moving block according to the zero point position.
  • the displacement coordinate system is established according to the precise zero position to cover all the displacements of the motor movement block, and the motor movement block is controlled according to the displacement coordinate system, which can effectively improve the accuracy of the displacement control.
  • the motor motion block is controlled to run toward the limit block, and collision detection is performed on the motor motion block; when the collision is successful, the motor motion block is controlled to run away from the limit block, and real-time detection of whether the Z signal sent by the encoder is received ;
  • the Z signal is detected, read the first encoder value from the encoder, and control the motor motion block to decelerate to read the second encoder value when the motor motion block stops; based on the preset algorithm according to the first encoder Value and the second encoder value to determine the zero position; according to the zero position to determine the running displacement of the motor movement block.
  • the Z signal detection and the distance compensation for the decelerating operation of the motor movement block realize the precise positioning of the zero point, thereby realizing the precise control of the displacement of the motor movement block, reducing the displacement control error, and improving the servo using the incremental encoder.
  • the accuracy of the motor is the accuracy of the motor.
  • the embodiment of the present invention also provides a storage medium, the storage medium stores a displacement control program, and the following operations are implemented when the displacement control program is executed by a processor:
  • control the motor movement block When the collision is successful, control the motor movement block to run away from the limit block, and detect in real time whether the Z signal sent by the encoder is received;
  • the operating displacement of the motor moving block is determined according to the zero point position.
  • the displacement compensation value corresponding to each displacement coordinate is used as the correction value to correspondingly correct the displacement of each displacement coordinate to obtain the running displacement of the motor motion block.
  • the training step includes: reading the displacement coordinates from the training displacement coordinate system, and when the motor motion block reaches the displacement coordinates, controlling the motor motion block to run with the displacement command value , And measure the actual displacement value of the motor moving block;
  • the actual position is taken as the zero position.
  • the current position of the motor motion block is recorded, and the current position is taken as the actual position when the motor motion block stops.
  • the collision time is not less than the first preset time, and the collision position is not greater than the preset displacement, it is determined that the collision is successful.
  • the technical solution of the present invention can be embodied in the form of a software product in essence or a part that contributes to the existing technology.
  • the computer software product is stored in a storage medium (such as ROM/RAM) as described above. , Magnetic disks, optical disks), including several instructions to make a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the method described in each embodiment of the present invention.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Control Of Electric Motors In General (AREA)
  • Control Of Position Or Direction (AREA)

Abstract

一种位移控制方法、***、伺服电机及存储介质,该方法包括:通过控制电机运动块朝向限位块运行,并对电机运动块进行碰撞检测(S10);当碰撞成功时,控制电机运动块背离限位块运行,并实时检测是否接收到编码器发送的Z信号(S20);在检测到Z信号时从编码器读取第一编码器值,并控制电机运动块减速运行,以读取电机运动块停止时的第二编码器值(S30);基于预设算法根据第一编码器值及第二编码器值确定零点位置(S40);根据零点位置确定电机运动块的运行位移(S50)。该方法通过Z信号检测及对电机运动块减速运行的距离补偿实现对零点的精确定位,进而实现对电机运动块位移的精确控制,降低了位移控制误差,提高了使用增量式编码器的伺服电机的精度。

Description

位移控制方法、***、伺服电机及存储介质 技术领域
本发明涉及电机控制技术领域,尤其涉及一种位移控制方法、***、伺服电机及存储介质。
背景技术
在现代工业生产的很多领域中,都需要高精度误差为微米的位置动作,该功能主要依靠伺服电机实现。目前伺服电机通常使用高精度绝对式编码器或增量式编码器,其中,增量式编码器因其成本适中,操作方便等优势成为主流,但是使用增量式编码器的伺服电机的精度较低。
为了提高伺服电机的精度,通常需要精确地对电机的运动位移进行控制。现有技术中大部分使用外接的定位传感器,如霍尔传感器、光电开关等位置传感器,将传感器放置在零点附近作为伺服电机回零点的定位基准,再根据回零点确定伺服电机的运动位移。具体地为,将运动块以某一恒定速度向着某方向运行,行进过程中如果位置传感器检测到运动块,伺服电机就控制运动块减速停止,当运动块完全停止时,运动块所处的位置就设定为零点,然后以零点为基础控制运动块运行至需要的位置。
上述位移控制方法,在检测到位置传感器开始减速停止时,受到电机转速控制误差、传感器响应误差以及机械传动结构几大因素的影响(如加工装配误差,结构磨合程度等),停止位置误差较大,导致零点定位不准确,进而导致位移控制不准确。
发明内容
本发明的主要目的在于提供一种位移控制方法、***、伺服电机及存储介质,旨在解决现有技术中电机运行时位移控制不准确的技术问题。
为实现上述目的,本发明提供一种位移控制方法,所述方法包括以下步骤:
控制电机运动块朝向限位块运行,并对所述电机运动块进行碰撞检测;
当碰撞成功时,控制所述电机运动块背离所述限位块运行,并实时检测是否接收到编码器发送的Z信号;
在检测到所述Z信号时从所述编码器读取第一编码器值,并控制所述电机运动块减速运行,以读取所述电机运动块停止时的第二编码器值;
基于预设算法根据所述第一编码器值及所述第二编码器值确定零点位置;
根据所述零点位置确定所述电机运动块的运行位移。
优选地,所述根据所述零点位置确定所述电机运动块的运行位移的步骤,包括:
根据所述零点位置建立电机运动块的位移坐标系;
根据预设位置补偿表获得各位移坐标对应的位移补偿值;
将所述各位移坐标对应的位移补偿值作为校正值对应校正各位移坐标的位移,获得电机运动块的运行位移。
优选地,所述根据预设位置补偿表对所述位移坐标系进行补偿的步骤之前,所述方法还包括:
建立训练位移坐标系;
重复执行训练步骤;其中,所述训练步骤包括:从所述训练位移坐标系中读取位移坐标,在所述电机运动块到达所述位移坐标时,控制所述电机运动块以位移指令值运行,并测量所述电机运动块的实际位移值;
检测所述训练位移坐标系中所有的位移坐标是否读取完毕;
若是,对应将所述训练位移坐标系中的各位移坐标、位移指令值和实际位移值保存至所述预设位置补偿表中。
优选地,所述基于预设算法根据所述第一编码器值及所述第二编码器值确定零点位置的步骤,包括:
根据所述第二编码器值与所述第一编码器值的差值确定停车距离;
基于正弦S曲线算法对所述停车距离进行补偿,获得所述电机运动块停止时的实际位置;
将所述实际位置作为零点位置。
优选地,所述基于正弦S曲线算法对所述停车距离进行补偿,获得所述电机运动块停止时的实际位置的步骤,包括:
基于正弦S曲线算法根据所述停车距离及预设目标速度获取所述电机运动块的加加速度;
控制所述电机运动块以所述加加速度朝向限位块运行;
当所述电机运动块的运行距离为所述停车距离时,记录所述电机运动块的当前位置,并将所述当前位置作为所述电机运动块停止时的实际位置。
优选地,所述正弦S曲线算法为:
Figure PCTCN2019129085-appb-000001
其中,V p为预设目标速度,S p为所述停车距离,t为运行时间,j(t)为所述电机运动块的加加速度。
优选地,所述对所述电机运动块进行碰撞检测的步骤,包括:
分别对所述电机运动块的碰撞电流、碰撞时间及碰撞位移进行检测;
当所述碰撞电流不小于预设电流,所述碰撞时间不小于第一预设时间且所述碰撞位置不大于预设位移时判定碰撞成功。
此外,为实现上述目的,本发明还提供一种位移控制***,所述位移控制***包括:
碰撞检测模块,用于控制电机运动块朝向限位块运行,并对所述电机运动块进行碰撞检测;
信号检测模块,用于当碰撞成功时,控制所述电机运动块背离所述限位块运行,并实时检测是否接收到编码器发送的Z信号;
编码器读取模块,用于在检测到所述Z信号时从所述编码器读取第一编码器值,并控制所述电机运动块减速运行,以读取所述电机运动块停止时的第二编码器值;
零点确定模块,用于基于预设算法根据所述第一编码器值及所述第二编码器值确定零点位置;
位移补偿模块,用于根据所述零点位置确定所述电机运动块的运行位移。
此外,为实现上述目的,本发明还提供一种伺服电机,所述伺服电机包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的位移控制程序,所述位移控制程序配置为实现如上所述的位移控制方法的步骤。
此外,为实现上述目的,本发明还提供一种存储介质,所述存储介质上存储有位移控制程序,所述位移控制程序被处理器执行时实现如上所述的位移控制方法的步骤。
本发明通过控制电机运动块朝向限位块运行,并对电机运动块进行碰撞检测;当碰撞成功时,控制电机运动块背离限位块运行,并实时检测是否接收到编码器发送的Z信号;在检测到Z信号时从编码器读取第一编码器值,并控制电机运动块减速运行,以读取电机运动块停止时的第二编码器值;基于预设算法根据第一编码器值及第二编码器值确定零点位置;根据零点位置确定电机运动块的运行位移。其中,通过Z信号检测及对电机运动块减速运行的距离补偿实现对零点的精确定位,进而实现对电机运动块位移的精确控制,降低了位移控制误差,提高了使用增量式编码器的伺服电机的精度。
附图说明
图1是本发明实施例方案涉及的硬件运行环境的伺服电机结构示意图;
图2为本发明位移控制方法第一实施例的流程示意图;
图3为本发明位移控制方法第二实施例的流程示意图;
图4为本发明位移控制方法第三实施例的流程示意图;
图5为本发明位移控制***第一实施例的功能模块图。
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
参照图1,图1为本发明实施例方案涉及的硬件运行环境的伺服电机结构示意图。
如图1所示,该伺服电机可以包括:处理器1001,例如CPU,通信总线1002、用户接口1003,网络接口1004,存储器1005。其中,通信总线1002用于实现 这些组件之间的连接通信。用户接口1003可以包括显示屏(Display)、输入单元比如键盘(Keyboard),可选用户接口1003还可以包括标准的有线接口、无线接口。网络接口1004可选的可以包括标准的有线接口、无线接口(如WI-FI接口)。存储器1005可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器。存储器1005可选的还可以是独立于前述处理器1001的存储装置。
本领域技术人员可以理解,图1中示出的结构并不构成对伺服电机的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
如图1所示,作为一种计算机存储介质的存储器1005中可以包括操作***、网络通信模块、用户接口模块以及位移控制程序。
在图1所示的伺服电机中,网络接口1004主要用于与外部网络进行数据通信;用户接口1003主要用于接收用户的输入指令;所述伺服电机通过处理器1001调用存储器1005中存储的位移控制程序,并执行以下操作:
控制电机运动块朝向限位块运行,并对所述电机运动块进行碰撞检测;
当碰撞成功时,控制所述电机运动块背离所述限位块运行,并实时检测是否接收到编码器发送的Z信号;
在检测到所述Z信号时从所述编码器读取第一编码器值,并控制所述电机运动块减速运行,以读取所述电机运动块停止时的第二编码器值;
基于预设算法根据所述第一编码器值及所述第二编码器值确定零点位置;
根据所述零点位置确定所述电机运动块的运行位移。
进一步地,处理器1001可以调用存储器1005中存储的位移控制程序,还执行以下操作:
根据所述零点位置建立电机运动块的位移坐标系;
根据预设位置补偿表获得各位移坐标对应的位移补偿值;
将所述各位移坐标对应的位移补偿值作为校正值对应校正各位移坐标的位移,获得电机运动块的运行位移。
进一步地,处理器1001可以调用存储器1005中存储的位移控制程序,还执行以下操作:
建立训练位移坐标系;
重复执行训练步骤;其中,所述训练步骤包括:从所述训练位移坐标系中读取位移坐标,在所述电机运动块到达所述位移坐标时,控制所述电机运动块以位移指令值运行,并测量所述电机运动块的实际位移值;
检测所述训练位移坐标系中所有的位移坐标是否读取完毕;
若是,对应将所述训练位移坐标系中的各位移坐标、位移指令值和实际位移值保存至所述预设位置补偿表中。
进一步地,处理器1001可以调用存储器1005中存储的位移控制程序,还执行以下操作:
根据所述第二编码器值与所述第一编码器值的差值确定停车距离;
基于正弦S曲线算法对所述停车距离进行补偿,获得所述电机运动块停止时的实际位置;
将所述实际位置作为零点位置。
进一步地,处理器1001可以调用存储器1005中存储的位移控制程序,还执行以下操作:
基于正弦S曲线算法根据所述停车距离及预设目标速度获取所述电机运动块的加加速度;
控制所述电机运动块以所述加加速度朝向限位块运行;
当所述电机运动块的运行距离为所述停车距离时,记录所述电机运动块的当前位置,并将所述当前位置作为所述电机运动块停止时的实际位置。
进一步地,处理器1001可以调用存储器1005中存储的位移控制程序,还执行以下操作:
分别对所述电机运动块的碰撞电流、碰撞时间及碰撞位移进行检测;
当所述碰撞电流不小于预设电流,所述碰撞时间不小于第一预设时间且所述碰撞位置不大于预设位移时判定碰撞成功。
本实施例通过控制电机运动块朝向限位块运行,并对电机运动块进行碰撞检测;当碰撞成功时,控制电机运动块背离限位块运行,并实时检测是否接收到编码器发送的Z信号;在检测到Z信号时从编码器读取第一编码器值,并控制电机运动块减速运行,以读取电机运动块停止时的第二编码器值;基于预设算法根据第一编码器值及第二编码器值确定零点位置;根据零点位置 确定电机运动块的运行位移。其中,通过Z信号检测及对电机运动块减速运行的距离补偿实现对零点的精确定位,进而实现对电机运动块位移的精确控制,降低了位移控制误差,提高了使用增量式编码器的伺服电机的精度。
基于上述硬件结构,提出本发明位移控制方法实施例。
参照图2,图2为本发明位移控制方法第一实施例的流程示意图。
在第一实施例中,所述位移控制方法包括以下步骤:
S10:控制电机运动块朝向限位块运行,并对所述电机运动块进行碰撞检测;
可以理解的是,传统的零点定位方法是将传感器放置在零点附近,将电机运动块以某一恒定速度向着固定方向运动,当检测到传感器就减速停止,将电机运动块完全停止时的位置设置为零点。但是由于电机运动块停止需要时间,并会运行一段距离,因此,真正的零点与电机运动块完全停止的位置并不相同,导致零点定位存在较大误差,进而影响位移控制的准确性。本实施例取消了传感器,利用伺服电机中的限位块、编码器及相应的程序控制实现精确的零点定位,最终实现伺服电机运动位移的精确控制。
应理解的是,所述朝向限位块运行指向限位块的方向运行,本实施例中不限定具体运行路径。
需要说明的是,所述碰撞检测是对电机运动块是否碰撞到限位块进行检测,其检测方式有很多种。作为一优选实施例,在进行碰撞检测时分别对电机运动块的碰撞电流、碰撞时间及碰撞位移进行检测;只有同时满足三个条件,即当所述碰撞电流不小于预设电流,所述碰撞时间不小于第一预设时间且所述碰撞位置不大于预设位移时才判定碰撞成功,以保证碰撞充分。
在具体实现中,三相逆变模块是电机的驱动硬件,用于驱动电机运行。当碰撞电流不小于预设电流且碰撞时间不小于第一预设时间时,说明电流过大并且持续时间较长,此时需要控制三相逆变模块关闭,以使三相逆变模块停止驱动电机运动块,如此可以有效保护三相逆变模块。
S20:当碰撞成功时,控制所述电机运动块背离所述限位块运行,并实时检测是否接收到编码器发送的Z信号;
应理解的是,所述背离限位块运行指向限位块的方向的反方向运行,本 实施例中不限定具体运行路径。
需要说明的是,为了控制产品成本及方便用户操作,所述编码器可以使用增量式编码器,如ABZ信号的增量式编码器。增量式编码器是直接利用光电转换原理输出三组方波脉冲A、B和Z相,A、B两组脉冲相位差90,从而可方便的判断出旋转方向,而Z相为每转一个脉冲,用于零点定位。
S30:在检测到所述Z信号时从所述编码器读取第一编码器值,并控制所述电机运动块减速运行,以读取所述电机运动块停止时的第二编码器值;
具体地,在检测到第N个Z信号时判断检测到所述第N个Z信号的时间是否大于第二预设时间;其中,N为预设正整数;若是,则控制所述三相逆变模块关闭;若否,从所述编码器读取第一编码器值。
需要说明的是,Z信号在一圈内位置是零位,通过读取Z信号,可以在一圈内修正增量信号因脉冲丢失而产生的计数误差。本实施例中,工程人员可以根据伺服电机的具体硬件情况选取第N个Z信号时编码器的值作为第一编码器值。
当然,如果编码器出现故障,找不到信号或者找到第N个Z信号的时间过长时,为了保护驱动硬件,同样需要关闭三相逆变模块。
应当理解的是,此时电机运动块减速运行,是指电机运动块背离限位块减速运行。
在具体实现中,由于增量式编码器是将位移转换成周期性的电信号,再把这个电信号转变成计数脉冲,用脉冲的个数表示位移的大小,因此,通过第一编码器值及第二编码器值可以计算电机运动块在不同时间段的位移。
S40:基于预设算法根据所述第一编码器值及所述第二编码器值确定零点位置;
需要说明的是,从接收到第N个Z信号开始停车,到电机运动块完全停止,这期间存在一段停车距离。所述预设算法用于通过反向补偿方式对停车距离进行回补,消除电机运动块的停车误差,从而减少定位误差,完成精确定位。
S50:根据所述零点位置确定所述电机运动块的运行位移。
应当理解的是,根据该精确的零点位置建立位移坐标系,覆盖电机运动块行程的所有位移,根据该位移坐标系对电机运动块进行控制,可以有效提 高位移控制的准确性。
本实施例通过控制电机运动块朝向限位块运行,并对电机运动块进行碰撞检测;当碰撞成功时,控制电机运动块背离限位块运行,并实时检测是否接收到编码器发送的Z信号;在检测到Z信号时从编码器读取第一编码器值,并控制电机运动块减速运行,以读取电机运动块停止时的第二编码器值;基于预设算法根据第一编码器值及第二编码器值确定零点位置;根据零点位置确定电机运动块的运行位移。其中,通过Z信号检测及对电机运动块减速运行的距离补偿实现对零点的精确定位,进而实现对电机运动块位移的精确控制,降低了位移控制误差,提高了使用增量式编码器的伺服电机的精度。
进一步地,如图3所示,基于第一实施例提出本发明位移控制方法第二实施例,在本实施例中,步骤S50具体包括以下步骤:
S51:根据所述零点位置建立电机运动块的位移坐标系;
需要说明的是,垂直运动***一般由负载、编码器、驱动器与电机本体组成,电机与上述设备之间通过运动控制卡或PLC利用线缆连接来控制。其中,电机本体结构包含运动块以及限位块。本实施例在电机运动块行程范围内的任意位置,接收到命令后,可以自动寻找零点位置,并确保回零点的精度高,由此建立的位移坐标系,覆盖零点位置到电机运动块行程的所有位移,且在实际运动中,采用对传动结构误差的补偿方式,来保证运行位移的准确性。
S52:根据预设位置补偿表获得各位移坐标对应的位移补偿值;
应当理解的是,由于电机运行时通过传动结构传递给负载的运动存在结构误差(如背隙),这会导致命令位置与实际位置存在误差,所以,为有效消除此类误差,采用一个电机自学习的软件流程来加以克服。具体流程如下:
建立训练位移坐标系;重复执行训练步骤;其中,所述训练步骤包括:从所述训练位移坐标系中读取位移坐标,在所述电机运动块到达所述位移坐标时,控制所述电机运动块以位移指令值运行,并测量所述电机运动块的实际位移值;检测所述训练位移坐标系中所有的位移坐标是否读取完毕;若是,对应将所述训练位移坐标系中的各位移坐标、位移指令值和实际位移值保存至所述预设位置补偿表中。
其中,训练位移坐标系根据实际应用场景的需要建立,建立训练位移坐标系的方法可以是将整个行程分成若干段,每段选取一个点作为位移坐标,当然,本实施例对此不加以限制。
建立完训练位移坐标系后,通过发送位移指令值的方式,令电机运动块在全行程中运行,实时获取各位移坐标对应的位移指令值及测量到的实际位移值值,比较命令值与实际测量值的差异,将这些数值形成预设位置补偿表导入到驱动器程序中,通过程序来添加相应补偿,最终保证位移精准。
S53:将所述各位移坐标对应的位移补偿值作为校正值对应校正各位移坐标的位移,获得电机运动块的运行位移。
应当理解的是,当启动正常业务运行电机运动块时,在位移坐标系中实时比较预设位置补偿表中的数值,并进行位置补偿,将补偿的数据作为校正值发送电机,完成运行动作。
本实施例通过建立覆盖电机运动块行程所有位移的位移坐标系,并根据传动机构的误差对位移进行补偿,保障了电机运动块的运行位移的准确性。
进一步地,如图4所示,基于第一实施例提出本发明位移控制方法第三实施例,在本实施例中,步骤S40具体包括以下步骤:
S41:根据所述第二编码器值与所述第一编码器值的差值确定停车距离;
具体地,由于通过第一编码器值可以计算出找到第N个Z信号时电机运动块的位移,通过第二编码器值可以计算出电机运动块运行至减速时的位移,通过第二编码器值与所述第一编码器值的差值可以确定电机运动块减速过程中的停车距离。
S42:基于正弦S曲线算法对所述停车距离进行补偿,获得所述电机运动块停止时的实际位置;
具体地,基于正弦S曲线算法根据所述停车距离及预设目标速度获取所述电机运动块的加加速度;控制所述电机运动块以所述加加速度朝向限位块运行;当所述电机运动块的运行距离为所述停车距离时,记录所述电机运动块的当前位置,并将所述当前位置作为所述电机运动块停止时的实际位置。
其中,所述正弦S曲线算法为:
Figure PCTCN2019129085-appb-000002
其中,V p为预设目标速度,S p为所述停车距离,t为运行时间,j(t)为所述电机运动块的加加速度。
需要说明的是,梯形、抛物线形加速曲线其加加速度为阶跃函数,存在阶跃变换,使得电机速度变化不够平稳,而正弦加速曲线,其加加速度为正弦函数,可连续求导,因此正弦曲线能更好地符合步进电机力矩随速度升高而减小的特点,充分地利用电机的有效转矩,同时能够减弱机械冲击。通过正弦S曲线算法控制电机运动块加减速,可以实现电机的平稳可靠的运行。
S43:将所述实际位置作为零点位置。
可理解的是,在对停车距离进行补偿后,电机运动块停止的实际位置才是真正的零点位置。在零点定位完成后,还可以向编码器发送回零完成信号,以同步编码器的当前采样值,并设置编码器的回零状态,等待上位机指令。
本实施例通过正弦S曲线算法规划运动路径控制电机动块的加减速运行,在对停车距离精准反向补偿的同时,保障了位置的准确性,实现了精准定位。
本发明进一步提供一种位移控制***。
参照图5,图5为本发明位移控制***第一实施例的功能模块图。
本实施例中,所述位移控制***包括:
碰撞检测模块10,用于控制电机运动块朝向限位块运行,并对所述电机运动块进行碰撞检测;
可以理解的是,传统的位移控制方法是将传感器放置在零点附近,将电机运动块以某一恒定速度向着固定方向运动,当检测到传感器就减速停止,将电机运动块完全停止时的位置设置为零点。但是由于电机运动块停止需要时间,并会运行一段距离,因此,真正的零点与电机运动块完全停止的位置并不相同,导致位移控制存在较大误差。本实施例取消了传感器,利用伺服电机中的限位块、编码器及相应的程序控制实现精确的位移控制。
应理解的是,所述朝向限位块运行指向限位块的方向运行,本实施例中不限定具体运行路径。
需要说明的是,所述碰撞检测是对电机运动块是否碰撞到限位块进行检测,其检测方式有很多种。作为一优选实施例,在进行碰撞检测时分别对电机运动块的碰撞电流、碰撞时间及碰撞位移进行检测;只有同时满足三个条件,即当所述碰撞电流不小于预设电流,所述碰撞时间不小于第一预设时间 且所述碰撞位置不大于预设位移时才判定碰撞成功,以保证碰撞充分。
在具体实现中,三相逆变模块是电机的驱动硬件,用于驱动电机运行。当碰撞电流不小于预设电流且碰撞时间不小于第一预设时间时,说明电流过大并且持续时间较长,此时需要控制三相逆变模块关闭,以使三相逆变模块停止驱动电机运动块,如此可以有效保护三相逆变模块。
信号检测模块20,用于当碰撞成功时,控制所述电机运动块背离所述限位块运行,并实时检测是否接收到编码器发送的Z信号;
应理解的是,所述背离限位块运行指向限位块的方向的反方向运行,本实施例中不限定具体运行路径。
需要说明的是,为了控制产品成本及方便用户操作,所述编码器可以使用增量式编码器。增量式编码器是直接利用光电转换原理输出三组方波脉冲A、B和Z相,A、B两组脉冲相位差90,从而可方便的判断出旋转方向,而Z相为每转一个脉冲,用于零点定位。
编码器读取模块30,用于在检测到所述Z信号时从所述编码器读取第一编码器值,并控制所述电机运动块减速运行,以读取所述电机运动块停止时的第二编码器值;
具体地,在检测到第N个Z信号时判断检测到所述第N个Z信号的时间是否大于第二预设时间;其中,N为预设正整数;若是,则控制所述三相逆变模块关闭;若否,从所述编码器读取第一编码器值。
需要说明的是,Z信号在一圈内位置是零位,通过读取Z信号,可以在一圈内修正增量信号因脉冲丢失而产生的计数误差。本实施例中,工程人员可以根据伺服电机的具体硬件情况选取第N个Z信号时编码器的值作为第一编码器值。
当然,如果编码器出现故障,找不到信号或者找到第N个Z信号的时间过长时,为了保护驱动硬件,同样需要关闭三相逆变模块。
应当理解的是,此时电机运动块减速运行,是指电机运动块背离限位块减速运行。
在具体实现中,由于增量式编码器是将位移转换成周期性的电信号,再把这个电信号转变成计数脉冲,用脉冲的个数表示位移的大小,因此,通过第一编码器值及第二编码器值可以计算电机运动块在不同时间段的位移。
距离补偿模块40,用于基于预设算法根据所述第一编码器值及所述第二编码器值确定零点位置;
需要说明的是,从接收到第N个Z信号开始停车,到电机运动块完全停止,这期间存在一段停车距离。所述预设算法用于通过反向补偿方式对停车距离进行回补,消除电机运动块的停车误差,从而减少定位误差,完成精确定位。
位移确定模块50,用于根据所述零点位置确定所述电机运动块的运行位移。
应当理解的是,根据该精确的零点位置建立位移坐标系,覆盖电机运动块行程的所有位移,根据该位移坐标系对电机运动块进行控制,可以有效提高位移控制的准确性。
本实施例通过控制电机运动块朝向限位块运行,并对电机运动块进行碰撞检测;当碰撞成功时,控制电机运动块背离限位块运行,并实时检测是否接收到编码器发送的Z信号;在检测到Z信号时从编码器读取第一编码器值,并控制电机运动块减速运行,以读取电机运动块停止时的第二编码器值;基于预设算法根据第一编码器值及第二编码器值确定零点位置;根据零点位置确定电机运动块的运行位移。其中,通过Z信号检测及对电机运动块减速运行的距离补偿实现对零点的精确定位,进而实现对电机运动块位移的精确控制,降低了位移控制误差,提高了使用增量式编码器的伺服电机的精度。
此外,本发明实施例还提出一种存储介质,所述存储介质上存储有位移控制程序,所述位移控制程序被处理器执行时实现如下操作:
控制电机运动块朝向限位块运行,并对所述电机运动块进行碰撞检测;
当碰撞成功时,控制所述电机运动块背离所述限位块运行,并实时检测是否接收到编码器发送的Z信号;
在检测到所述Z信号时从所述编码器读取第一编码器值,并控制所述电机运动块减速运行,以读取所述电机运动块停止时的第二编码器值;
基于预设算法根据所述第一编码器值及所述第二编码器值确定零点位置;
根据所述零点位置确定所述电机运动块的运行位移。
进一步地,所述位移控制程序被处理器执行时还实现如下操作:
根据所述零点位置建立电机运动块的位移坐标系;
根据预设位置补偿表获得各位移坐标对应的位移补偿值;
将所述各位移坐标对应的位移补偿值作为校正值对应校正各位移坐标的位移,获得电机运动块的运行位移。
进一步地,所述位移控制程序被处理器执行时还实现如下操作:
建立训练位移坐标系;
重复执行训练步骤;其中,所述训练步骤包括:从所述训练位移坐标系中读取位移坐标,在所述电机运动块到达所述位移坐标时,控制所述电机运动块以位移指令值运行,并测量所述电机运动块的实际位移值;
检测所述训练位移坐标系中所有的位移坐标是否读取完毕;
若是,对应将所述训练位移坐标系中的各位移坐标、位移指令值和实际位移值保存至所述预设位置补偿表中。
进一步地,所述位移控制程序被处理器执行时还实现如下操作:
根据所述第二编码器值与所述第一编码器值的差值确定停车距离;
基于正弦S曲线算法对所述停车距离进行补偿,获得所述电机运动块停止时的实际位置;
将所述实际位置作为零点位置。
进一步地,所述位移控制程序被处理器执行时还实现如下操作:
基于正弦S曲线算法根据所述停车距离及预设目标速度获取所述电机运动块的加加速度;
控制所述电机运动块以所述加加速度朝向限位块运行;
当所述电机运动块的运行距离为所述停车距离时,记录所述电机运动块的当前位置,并将所述当前位置作为所述电机运动块停止时的实际位置。
进一步地,所述位移控制程序被处理器执行时还实现如下操作:
分别对所述电机运动块的碰撞电流、碰撞时间及碰撞位移进行检测;
当所述碰撞电流不小于预设电流,所述碰撞时间不小于第一预设时间且所述碰撞位置不大于预设位移时判定碰撞成功。
本发明计算机可读存储介质的具体实施例与上述位移控制方法各实施例基本相同,在此不作赘述。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者***不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者***所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者***中还存在另外的相同要素。
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本发明各个实施例所述的方法。
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。

Claims (10)

  1. 一种位移控制方法,其特征在于,所述位移控制方法包括以下步骤:
    控制电机运动块朝向限位块运行,并对所述电机运动块进行碰撞检测;
    当碰撞成功时,控制所述电机运动块背离所述限位块运行,并实时检测是否接收到编码器发送的Z信号;
    在检测到所述Z信号时从所述编码器读取第一编码器值,并控制所述电机运动块减速运行,以读取所述电机运动块停止时的第二编码器值;
    基于预设算法根据所述第一编码器值及所述第二编码器值确定零点位置;
    根据所述零点位置确定所述电机运动块的运行位移。
  2. 如权利要求1所述的位移控制方法,其特征在于,所述根据所述零点位置确定所述电机运动块的运行位移的步骤,包括:
    根据所述零点位置建立电机运动块的位移坐标系;
    根据预设位置补偿表获得各位移坐标对应的位移补偿值;
    将所述各位移坐标对应的位移补偿值作为校正值对应校正各位移坐标的位移,获得电机运动块的运行位移。
  3. 如权利要求2所述的位移控制方法,其特征在于,所述根据预设位置补偿表对所述位移坐标系进行补偿的步骤之前,所述方法还包括:
    建立训练位移坐标系;
    重复执行训练步骤;其中,所述训练步骤包括:从所述训练位移坐标系中读取位移坐标,在所述电机运动块到达所述位移坐标时,控制所述电机运动块以位移指令值运行,并测量所述电机运动块的实际位移值;
    检测所述训练位移坐标系中所有的位移坐标是否读取完毕;
    若是,对应将所述训练位移坐标系中的各位移坐标、位移指令值和实际位移值保存至所述预设位置补偿表中。
  4. 如权利要求1所述的位移控制方法,其特征在于,所述基于预设算法 根据所述第一编码器值及所述第二编码器值确定零点位置的步骤,包括:
    根据所述第二编码器值与所述第一编码器值的差值确定停车距离;
    基于正弦S曲线算法对所述停车距离进行补偿,获得所述电机运动块停止时的实际位置;
    将所述实际位置作为零点位置。
  5. 如权利要求4所述的位移控制方法,其特征在于,所述基于正弦S曲线算法对所述停车距离进行补偿,获得所述电机运动块停止时的实际位置的步骤,包括:
    基于正弦S曲线算法根据所述停车距离及预设目标速度获取所述电机运动块的加加速度;
    控制所述电机运动块以所述加加速度朝向限位块运行;
    当所述电机运动块的运行距离为所述停车距离时,记录所述电机运动块的当前位置,并将所述当前位置作为所述电机运动块停止时的实际位置。
  6. 如权利要求5所述的位移控制方法,其特征在于,所述正弦S曲线算法为:
    Figure PCTCN2019129085-appb-100001
    其中,V p为预设目标速度,S p为所述停车距离,t为运行时间,j(t)为所述电机运动块的加加速度。
  7. 如权利要求1~6中任一项所述的位移控制方法,其特征在于,所述对所述电机运动块进行碰撞检测的步骤,包括:
    分别对所述电机运动块的碰撞电流、碰撞时间及碰撞位移进行检测;
    当所述碰撞电流不小于预设电流,所述碰撞时间不小于第一预设时间且所述碰撞位置不大于预设位移时判定碰撞成功。
  8. 一种位移控制***,其特征在于,所述位移控制***包括:
    碰撞检测模块,用于控制电机运动块朝向限位块运行,并对所述电机运动块进行碰撞检测;
    信号检测模块,用于当碰撞成功时,控制所述电机运动块背离所述限位块运行,并实时检测是否接收到编码器发送的Z信号;
    编码器读取模块,用于在检测到所述Z信号时从所述编码器读取第一编码器值,并控制所述电机运动块减速运行,以读取所述电机运动块停止时的第二编码器值;
    距离补偿模块,用于基于预设算法根据所述第一编码器值及所述第二编码器值确定零点位置;
    位移确定模块,用于根据所述零点位置确定所述电机运动块的运行位移。
  9. 一种伺服电机,其特征在于,所述伺服电机包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的位移控制程序,所述位移控制程序配置为实现如权利要求1至7中任一项所述的位移控制方法的步骤。
  10. 一种存储介质,其特征在于,所述存储介质上存储有位移控制程序,所述位移控制程序被处理器执行时实现如权利要求1至7中任一项所述的位移控制方法的步骤。
PCT/CN2019/129085 2019-11-27 2019-12-27 位移控制方法、***、伺服电机及存储介质 WO2021103254A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911209990.9 2019-11-27
CN201911209990.9A CN110955274B (zh) 2019-11-27 2019-11-27 位移控制方法、***、伺服电机及存储介质

Publications (1)

Publication Number Publication Date
WO2021103254A1 true WO2021103254A1 (zh) 2021-06-03

Family

ID=69979156

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/129085 WO2021103254A1 (zh) 2019-11-27 2019-12-27 位移控制方法、***、伺服电机及存储介质

Country Status (2)

Country Link
CN (1) CN110955274B (zh)
WO (1) WO2021103254A1 (zh)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113682988A (zh) * 2021-08-31 2021-11-23 深圳市海浦蒙特科技有限公司 一种塔式起重机及其防冲顶保护方法、***和装置
CN113820994A (zh) * 2021-08-17 2021-12-21 华能澜沧江水电股份有限公司 筒阀控制方法、装置、计算机设备及计算机可读存储介质
CN114296393A (zh) * 2021-12-29 2022-04-08 北京半导体专用设备研究所(中国电子科技集团公司第四十五研究所) 运动台回零方法、装置、电子设备和存储介质
CN114741925A (zh) * 2022-04-15 2022-07-12 中铁大桥勘测设计院集团有限公司 杆件伸缩量的计算方法、装置、设备及可读存储介质
CN115503629A (zh) * 2022-10-27 2022-12-23 常州星宇车灯股份有限公司 一种汽车车灯als和afs自动校正***及校正方法
CN116392259A (zh) * 2023-04-28 2023-07-07 极限人工智能有限公司 同轨道双驱动模块的行程和防撞监测方法、***和机器人
CN116857247A (zh) * 2023-07-01 2023-10-10 广州达蒙安防科技有限公司 一种控制爬架动态平衡的方法
CN117555292A (zh) * 2024-01-11 2024-02-13 南京德克威尔自动化有限公司 基于协同控制的伺服驱动控制方法、***、设备及介质

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110793553B (zh) * 2019-11-07 2021-07-23 歌尔股份有限公司 零点定位方法、***、伺服电机及存储介质
CN113552835B (zh) * 2020-04-23 2022-08-19 德律科技股份有限公司 适用于具有输送带的自动化机台的自动控制***及方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08335115A (ja) * 1995-06-08 1996-12-17 Amada Co Ltd 位置決め装置の原点設定方法およびその装置
JPH09138706A (ja) * 1995-11-15 1997-05-27 Denso Corp 可動体の自動原点校正装置
CN109656130A (zh) * 2017-10-10 2019-04-19 北京京东尚科信息技术有限公司 搬运机器人运行控制方法、装置、机器人以及存储介质
CN109968377A (zh) * 2017-12-27 2019-07-05 韩华精密机械株式会社 机器人控制***和控制机器人的方法

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62299320A (ja) * 1986-06-19 1987-12-26 Fanuc Ltd 射出成形機の自動原点調整方式
WO2017113331A1 (zh) * 2015-12-31 2017-07-06 深圳配天智能技术研究院有限公司 一种主轴定向方法、数控装置及数控机床
CN108599658B (zh) * 2018-05-03 2022-05-17 杭州瑞拉腾电气科技有限公司 一种同步磁阻电机的位置传感器的零位自学习方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08335115A (ja) * 1995-06-08 1996-12-17 Amada Co Ltd 位置決め装置の原点設定方法およびその装置
JPH09138706A (ja) * 1995-11-15 1997-05-27 Denso Corp 可動体の自動原点校正装置
CN109656130A (zh) * 2017-10-10 2019-04-19 北京京东尚科信息技术有限公司 搬运机器人运行控制方法、装置、机器人以及存储介质
CN109968377A (zh) * 2017-12-27 2019-07-05 韩华精密机械株式会社 机器人控制***和控制机器人的方法

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113820994B (zh) * 2021-08-17 2023-08-22 华能澜沧江水电股份有限公司 筒阀控制方法、装置、计算机设备及计算机可读存储介质
CN113820994A (zh) * 2021-08-17 2021-12-21 华能澜沧江水电股份有限公司 筒阀控制方法、装置、计算机设备及计算机可读存储介质
CN113682988A (zh) * 2021-08-31 2021-11-23 深圳市海浦蒙特科技有限公司 一种塔式起重机及其防冲顶保护方法、***和装置
CN114296393B (zh) * 2021-12-29 2024-01-16 北京半导体专用设备研究所(中国电子科技集团公司第四十五研究所) 运动台回零方法、装置、电子设备和存储介质
CN114296393A (zh) * 2021-12-29 2022-04-08 北京半导体专用设备研究所(中国电子科技集团公司第四十五研究所) 运动台回零方法、装置、电子设备和存储介质
CN114741925A (zh) * 2022-04-15 2022-07-12 中铁大桥勘测设计院集团有限公司 杆件伸缩量的计算方法、装置、设备及可读存储介质
CN114741925B (zh) * 2022-04-15 2023-12-29 中铁大桥勘测设计院集团有限公司 杆件伸缩量的计算方法、装置、设备及可读存储介质
CN115503629A (zh) * 2022-10-27 2022-12-23 常州星宇车灯股份有限公司 一种汽车车灯als和afs自动校正***及校正方法
CN115503629B (zh) * 2022-10-27 2024-04-09 常州星宇车灯股份有限公司 一种汽车车灯als和afs自动校正***及校正方法
CN116392259A (zh) * 2023-04-28 2023-07-07 极限人工智能有限公司 同轨道双驱动模块的行程和防撞监测方法、***和机器人
CN116392259B (zh) * 2023-04-28 2024-06-04 极限人工智能有限公司 同轨道双驱动模块的行程和防撞监测方法、***和机器人
CN116857247A (zh) * 2023-07-01 2023-10-10 广州达蒙安防科技有限公司 一种控制爬架动态平衡的方法
CN117555292A (zh) * 2024-01-11 2024-02-13 南京德克威尔自动化有限公司 基于协同控制的伺服驱动控制方法、***、设备及介质
CN117555292B (zh) * 2024-01-11 2024-04-09 南京德克威尔自动化有限公司 基于协同控制的伺服驱动控制方法、***、设备及介质

Also Published As

Publication number Publication date
CN110955274B (zh) 2023-03-07
CN110955274A (zh) 2020-04-03

Similar Documents

Publication Publication Date Title
WO2021103254A1 (zh) 位移控制方法、***、伺服电机及存储介质
WO2021088235A1 (zh) 零点定位方法、***、伺服电机及存储介质
CN104950922A (zh) 一种四点支撑机电调平***虚腿补偿控制方法
CN104914864A (zh) 一种移动装置、移动装置控制***及控制方法
JPS59188517A (ja) サ−ボ制御系の絶対位置検出方式
CN107797488A (zh) 一种位移控制***及其控制方法、移动终端
CN202634339U (zh) 双电机并联驱动装置
US4795955A (en) Position control apparatus
CN103760921B (zh) 低精度多个传感器融合的原点精确定位***及定位方法
CN110126842B (zh) 一种智能驾驶车辆纵向加速度动态校正方法及装置
US8121711B2 (en) System and method for controlling movement of a measurement machine
CN111026130A (zh) Agv定位偏差修正的控制方法、装置及可读存储介质
CN116027714A (zh) 一种随动转台切换控制方法
CN114296393B (zh) 运动台回零方法、装置、电子设备和存储介质
WO2022142117A1 (zh) 双轴同导轨设备回零方法和装置
JPH06242830A (ja) 位置制御システムの位置情報判別装置及びその判別方法
JPH10315173A (ja) ロボットの異常検出装置
CN110989596B (zh) 对桩控制方法、装置、智能机器人及存储介质
CN106921333A (zh) 马达力矩纹波动态补偿方法
JP2021163277A (ja) 位置検出システム
CN111146986A (zh) 磁编码器的位置定位方法、装置、电子设备及计算机可读存储介质
CN114268246B (zh) 电机控制方法、装置、***及计算机可读存储介质
CN117411374B (zh) 一种电机控制方法、***、装置及电子设备
KR100405718B1 (ko) 위치제어를 위한 원호 보간 방법 및 시스템
CN117375462B (zh) 步进电机校准方法、装置、设备及计算机存储介质

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: 19954692

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19954692

Country of ref document: EP

Kind code of ref document: A1