Method for improving acquisition speed and accuracy of servo driver based on BISS encoder

文档序号:1295714 发布日期:2020-08-07 浏览:16次 中文

阅读说明:本技术 基于biss编码器提高伺服驱动器采集速度和精度的方法 (Method for improving acquisition speed and accuracy of servo driver based on BISS encoder ) 是由 项勤建 朱路生 邓世海 于 2020-04-30 设计创作,主要内容包括:本发明公开了基于BISS编码器提高伺服驱动器采集速度和精度的方法,包括伺服驱动器,与伺服驱动器连接的主控制器、电机和BISS编码器,方法包括:伺服驱动器的主芯片连续产生两个16位的伪数据给BISS编码器,产生BISS编码器需要的32位时钟脉冲;BISS编码器在32位时钟到来时,向SPI总线上传32位数据;当SPI总线上收到两个字节的数据,根据事先设置的两级接收中断,主芯片取出该数据用于位置计算和速度计算。本发明采用基于BISS协议的编码器,并通过设置协作机器人伺服驱动器的主芯片,使产生满足BISS编码器的32位时钟脉冲,提供了采集的精度和采集速度。(The invention discloses a method for improving the acquisition speed and accuracy of a servo driver based on a BISS encoder, which comprises the servo driver, a main controller, a motor and the BISS encoder, wherein the main controller, the motor and the BISS encoder are connected with the servo driver, and the method comprises the following steps: a main chip of the servo driver continuously generates two 16-bit pseudo data to a BISS encoder, and generates 32-bit clock pulses required by the BISS encoder; when a 32-bit clock arrives, the BISS encoder uploads 32-bit data to the SPI bus; when the SPI bus receives data of two bytes, the main chip takes out the data for position calculation and speed calculation according to the two-stage receiving interruption set in advance. The invention adopts the encoder based on BISS protocol, and generates 32-bit clock pulse meeting BISS encoder by setting the main chip of the servo driver of the cooperative robot, thereby providing the acquisition precision and the acquisition speed.)

1. A method for improving the acquisition speed and accuracy of a servo driver based on a BISS encoder is characterized by comprising the servo driver, a main controller connected with the servo driver, a motor and the BISS encoder, wherein the method comprises the following steps:

step S100: a main chip of the servo driver continuously generates two 16-bit pseudo data to a BISS encoder, and generates 32-bit clock pulses required by the BISS encoder;

step S200: when a 32-bit clock arrives, the BISS encoder uploads 32-bit data to the SPI bus;

step S300: when the SPI bus receives data of two bytes, the main chip takes out the data for position calculation and speed calculation according to the two-stage receiving interruption set in advance.

2. The method for improving the acquisition speed and accuracy of a servo driver based on BISS encoder as claimed in claim 1, wherein the BISS encoder is composed of 5 bits start bit, 19 bits data bit, data abnormal alarm bit F0, over temperature alarm bit F1 and 6 bits check bit.

3. The method for improving the acquisition speed and accuracy of the servo driver based on the BISS encoder as claimed in claim 1, wherein the step S100 is specifically as follows:

step S110: initializing a main chip and setting an SPI module to be two-stage receiving interruption and 16-bit data length;

step S120: the main control ADC controls the interruption, and two continuous 16-bit pseudo data are generated by adopting a for statement in the main control flow, so that a continuous 32-bit clock required by reading the BISS encoder is generated.

4. The method for improving the acquisition speed and accuracy of the servo driver based on the BISS encoder as claimed in claim 1, wherein the step S300 is specifically:

step S310: the SPI receives the interrupt, reads the FIFO data, carries on CRC check and alarm bit judgement to the BISS data, if the alarm bit is abnormal, jumps to step S330; if the alarm position is normal, entering the next step;

step S320: and the CRC checksum continuously judges whether the CRC check result is correct:

step S321: when the CRC check is correct, calculating the position and the speed, and entering the step S323; otherwise, entering the next step;

step S322: comparing the CRC error times with a preset value, and when the CRC error is smaller than the preset value, adopting the position and the speed of the last control period to control; entering the next step; otherwise, judging the encoder fault, and ending;

step S323: adding speed and position into a motor control flow;

step S330: judging whether the continuous alarming times are smaller than a preset threshold value, if so, adopting the position and the speed of the last control period to control, and adding the speed and the position into a motor control process; otherwise, judging the encoder fault and ending.

9页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种自动引导车控制方法和系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!