[其他ST产品] 学习 stm32(TTL)串口通信控制16路舵机控制板(维特智能)

[复制链接]
1862|14
 楼主| 斧王FUWANG 发表于 2023-9-22 10:39 | 显示全部楼层 |阅读模式
16路舵机控制板

1、’可同时支持16路舵机大的输出
2、支持TTL 串口通信
3、支持上位机软件控制动作以及动作组
4、串口初始化为9600

如下图所示为官方提供资料

33462650cfe6c4c0f5.png

实物图图下
14275650cfe796177b.png

 楼主| 斧王FUWANG 发表于 2023-9-22 10:40 | 显示全部楼层
硬件操作流程
第一种
stm32控制板-------------usart1-------------------->16路舵机控制板
第二种
上位机软件 --------------usb ---------------16路舵机控制班。

 楼主| 斧王FUWANG 发表于 2023-9-22 10:40 | 显示全部楼层
上位机软件如下图

61540650cfe989ce72.png
 楼主| 斧王FUWANG 发表于 2023-9-22 10:44 | 显示全部楼层
我的接线图
下面我用自己的开发板接的如下如 ,(16路舵机控制板)
设计采用的芯片是STM32F103ZET6,采用的16路舵机控制板,自主进行电路设计,通过串口传输,完成对16路舵机控制板串口通信完成动作。
 楼主| 斧王FUWANG 发表于 2023-9-22 10:45 | 显示全部楼层
 楼主| 斧王FUWANG 发表于 2023-9-22 10:45 | 显示全部楼层
下面直接上示例代码,(可下载官方的代码参考移植,上面有官网地址)-

主函数
  1. void UART1_Put_StringL(unsigned char *Str,unsigned char len)
  2. {
  3.         unsigned char i = 0;
  4.         for (i=0;i<len;i++) UART1_Put_Char(*(Str + i));
  5. }

  6. void UART_DM_ReportData(unsigned char data[])
  7. {               
  8.         UART1_Put_StringL(data,10);     //打印长度根据所打印的数组长度来改,动作组是5,速度状态是10。最好填10。        
  9. }

  10. //**********动作组及各种舵机的速度角度配置都在“BOOL.h”头文件里面******//
  11. //**********直接把数组名称放在UART_DM_ReportData()函数里面就可以了,例如UART_DM_ReportData(DM0_Speed1_Position_90)********//


  12. /*******************************************************************************
  13. * 函 数 名         : main
  14. * 函数功能                   : 主函数
  15. * 输    入         : 无
  16. * 输    出         : 无
  17. *******************************************************************************/

  18. int main()
  19. {
  20.         u8 i=0;
  21.         SysTick_Init(72);
  22.         NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);  //中断优先级分组 分2组
  23.         LED_Init();
  24.         USART1_Init(9600);//串口初始化为9600
  25.         while(1)
  26.         {
  27.                 UART_DM_ReportData(DM0_Speed20_Position_90);     //设置通道0,速度=1,位置=90度
  28.                 delay_ms(10000);                                 //延时2S   
  29.                 UART_DM_ReportData(DM0_Speed20_Position_0);      //设置通道0,速度=3,位置=0度
  30.                 delay_ms(10000);
  31.                 UART_DM_ReportData(DM_Action0);            //设置动作组0
  32.                 delay_ms(2000);
  33. //                UART_DM_ReportData(DM_Action1);          //设置动作组1
  34. //                UART_DM_ReportData(DM_Action2);          //设置动作组2
  35. //                UART_DM_ReportData(DM_Action3);          //设置动作组3
  36. //                UART_DM_ReportData(DM_Action4);          //设置动作组4
  37. //                UART_DM_ReportData(DM_Action5);          //设置动作组5
  38. //                UART_DM_ReportData(DM_Action6);          //设置动作组6
  39. //                UART_DM_ReportData(DM_Action7);          //设置动作组7        
  40. //                UART_DM_ReportData(DM_Action8);          //设置动作组8         
  41. //                UART_DM_ReportData(DM_Action9);          //设置动作组9
  42. //                UART_DM_ReportData(DM_Action10);         //设置动作组10
  43. //                UART_DM_ReportData(DM_Action11);         //设置动作组11
  44. //                UART_DM_ReportData(DM_Action12);         //设置动作组12
  45. //                UART_DM_ReportData(DM_Action13);         //设置动作组13
  46. //                UART_DM_ReportData(DM_Action14);         //设置动作组14
  47. //                UART_DM_ReportData(DM_Action15);         //设置动作组15
  48.         }

  49. }
 楼主| 斧王FUWANG 发表于 2023-9-22 10:46 | 显示全部楼层
串口文件参考
  1. #include "usart.h"                 
  2. #include "system.h"
  3. #include "string.h"


  4. #include <stdio.h>
  5. #include "system.h"  //#include "stm32f10x.h"
  6. #include "stm32f10x_gpio.h"
  7. #include "stm32f10x_usart.h"
  8. #include "stm32f10x_rcc.h"
  9. #include "misc.h"
  10. #include "bool.h"




  11. static unsigned char TxBuffer[256];
  12. static unsigned char TxCounter=0;
  13. static unsigned char count=0;
  14. extern void CopeSerial1Data(unsigned char ucData);






  15. int fputc(int ch,FILE *p)  //函数默认的,在使用printf函数时自动调用
  16. {
  17.         USART_SendData(USART1,(u8)ch);       
  18.         while(USART_GetFlagStatus(USART1,USART_FLAG_TXE)==RESET);
  19.         return ch;
  20. }



  21. //串口1中断服务程序
  22. //注意,读取USARTx->SR能避免莫名其妙的错误          
  23. u8 USART1_RX_BUF[USART1_REC_LEN];     //接收缓冲,最大USART_REC_LEN个字节.
  24. //接收状态
  25. //bit15,        接收完成标志
  26. //bit14,        接收到0x0d
  27. //bit13~0,        接收到的有效字节数目
  28. u16 USART1_RX_STA=0;       //接收状态标记


  29. /*******************************************************************************
  30. * 函 数 名         : USART1_Init
  31. * 函数功能                   : USART1初始化函数
  32. * 输    入         : bound:波特率
  33. * 输    出         : 无
  34. *******************************************************************************/
  35. void USART1_Init(u32 bound)
  36. {
  37.    //GPIO端口设置
  38.         GPIO_InitTypeDef GPIO_InitStructure;
  39.         USART_InitTypeDef USART_InitStructure;
  40.         NVIC_InitTypeDef NVIC_InitStructure;
  41.        
  42.         RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA,ENABLE);
  43.         RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1,ENABLE);

  44.        
  45.         /*  配置GPIO的模式和IO口 */
  46.         GPIO_InitStructure.GPIO_Pin=GPIO_Pin_9;//TX                           //串口输出PA9
  47.         GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;
  48.         GPIO_InitStructure.GPIO_Mode=GPIO_Mode_AF_PP;            //复用推挽输出
  49.         GPIO_Init(GPIOA,&GPIO_InitStructure);  /* 初始化串口输入IO */
  50.         GPIO_InitStructure.GPIO_Pin=GPIO_Pin_10;//RX                         //串口输入PA10
  51.         GPIO_InitStructure.GPIO_Mode=GPIO_Mode_IN_FLOATING;                  //模拟输入
  52.         GPIO_Init(GPIOA,&GPIO_InitStructure); /* 初始化GPIO */
  53.        

  54.         //USART1 初始化设置
  55.         USART_InitStructure.USART_BaudRate = bound;//波特率设置
  56.         USART_InitStructure.USART_WordLength = USART_WordLength_8b;//字长为8位数据格式
  57.         USART_InitStructure.USART_StopBits = USART_StopBits_1;//一个停止位
  58.         USART_InitStructure.USART_Parity = USART_Parity_No;//无奇偶校验位
  59.         USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;//无硬件数据流控制
  60.         USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;        //收发模式
  61.         USART_Init(USART1, &USART_InitStructure); //初始化串口1
  62.        
  63.         USART_Cmd(USART1, ENABLE);  //使能串口1
  64.        
  65.         USART_ClearFlag(USART1, USART_FLAG_TC);
  66.                
  67.         USART_ITConfig(USART1, USART_IT_RXNE, ENABLE);//开启相关中断

  68.         //Usart1 NVIC 配置
  69.         NVIC_InitStructure.NVIC_IRQChannel = USART1_IRQn;//串口1中断通道
  70.         NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority=3;//抢占优先级3
  71.         NVIC_InitStructure.NVIC_IRQChannelSubPriority =3;                //子优先级3
  72.         NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;                        //IRQ通道使能
  73.         NVIC_Init(&NVIC_InitStructure);        //根据指定的参数初始化VIC寄存器、       
  74. }

  75. /*******************************************************************************
  76. * 函 数 名         : USART1_IRQHandler
  77. * 函数功能                   : USART1中断函数
  78. * 输    入         : 无
  79. * 输    出         : 无
  80. *******************************************************************************/
  81. //void USART1_IRQHandler(void)                        //串口1中断服务程序
  82. //{
  83. //        u8 r;
  84. //        if(USART_GetITStatus(USART1, USART_IT_RXNE) != RESET)  //接收中断
  85. //        {
  86. //                r =USART_ReceiveData(USART1);//(USART1->DR);        //读取接收到的数据
  87. //                if((USART1_RX_STA&0x8000)==0)//接收未完成
  88. //                {
  89. //                        if(USART1_RX_STA&0x4000)//接收到了0x0d
  90. //                        {
  91. //                                if(r!=0x0a)USART1_RX_STA=0;//接收错误,重新开始
  92. //                                else USART1_RX_STA|=0x8000;        //接收完成了
  93. //                        }
  94. //                        else //还没收到0X0D
  95. //                        {       
  96. //                                if(r==0x0d)USART1_RX_STA|=0x4000;
  97. //                                else
  98. //                                {
  99. //                                        USART1_RX_BUF[USART1_RX_STA&0X3FFF]=r;
  100. //                                        USART1_RX_STA++;
  101. //                                        if(USART1_RX_STA>(USART1_REC_LEN-1))USART1_RX_STA=0;//接收数据错误,重新开始接收          
  102. //                                }                 
  103. //                        }
  104. //                }                    
  105. //        }
  106. //}



  107. void UART1_Put_Char(unsigned char DataToSend)
  108. {
  109.         TxBuffer[count++] = DataToSend;  
  110.   USART_ITConfig(USART1, USART_IT_TXE, ENABLE);  
  111. }

  112. void UART1_Put_String(unsigned char *Str)
  113. {
  114.         while(*Str)
  115.         {
  116.                 if(*Str=='\r')UART1_Put_Char(0x0d);
  117.                         else if(*Str=='\n')UART1_Put_Char(0x0a);
  118.                                 else UART1_Put_Char(*Str);
  119.                 Str++;
  120.         }
  121. }

  122. void CopeSerial1Data(unsigned char ucData)
  123. {
  124. }

  125. void USART1_IRQHandler(void)
  126. {
  127.   
  128.         if(USART_GetITStatus(USART1, USART_IT_TXE) != RESET)
  129.   {   
  130.     USART_SendData(USART1, TxBuffer[TxCounter++]);
  131.     if(TxCounter == count)
  132.                 {
  133.                         USART_ITConfig(USART1, USART_IT_TXE, DISABLE);// 全部发送完成
  134.                 }
  135.     USART_ClearITPendingBit(USART1, USART_IT_TXE);
  136.   }
  137.         else if(USART_GetITStatus(USART1, USART_IT_RXNE) != RESET)
  138.   {
  139.                 CopeSerial1Data((unsigned char)USART1->DR);//处理数据
  140.                 USART_ClearITPendingBit(USART1, USART_IT_RXNE);
  141.   }
  142.         USART_ClearITPendingBit(USART1,USART_IT_ORE);

  143. }






 楼主| 斧王FUWANG 发表于 2023-9-22 10:46 | 显示全部楼层
bool 官方参数直接下载拿过来用

 楼主| 斧王FUWANG 发表于 2023-9-22 10:46 | 显示全部楼层
  1. #ifndef _bool_H
  2. #define _bool_H

  3. //****************************************位置角度控制****************************************//
  4. static  unsigned char DM0_Speed1_Position_90[15]    =    { 0xff, 0x01, 0x00, 0x01, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 };  //通道0,速度=1,位置90度
  5. static  unsigned char DM0_Speed2_Position_90[15]    =    { 0xff, 0x01, 0x00, 0x02, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 };  //通道0,速度=2,位置90度
  6. static  unsigned char DM0_Speed3_Position_90[15]    =    { 0xff, 0x01, 0x00, 0x03, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 };  //通道0,速度=3,位置90度
  7. static  unsigned char DM0_Speed4_Position_90[15]    =    { 0xff, 0x01, 0x00, 0x04, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 };  //通道0,速度=4,位置90度
  8. static  unsigned char DM0_Speed5_Position_90[15]    =    { 0xff, 0x01, 0x00, 0x05, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 };  //通道0,速度=5,位置90度
  9. static  unsigned char DM0_Speed6_Position_90[15]    =    { 0xff, 0x01, 0x00, 0x06, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 };  //通道0,速度=6,位置90度
  10. static  unsigned char DM0_Speed7_Position_90[15]    =    { 0xff, 0x01, 0x00, 0x07, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 };  //通道0,速度=7,位置90度
  11. static  unsigned char DM0_Speed8_Position_90[15]    =    { 0xff, 0x01, 0x00, 0x08, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 };  //通道0,速度=8,位置90度
  12. static  unsigned char DM0_Speed9_Position_90[15]    =    { 0xff, 0x01, 0x00, 0x09, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 };  //通道0,速度=9,位置90度
  13. static  unsigned char DM0_Speed10_Position_90[15]   =    { 0xff, 0x01, 0x00, 0x0a, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 };  //通道0,速度=10,位置90度
  14. static  unsigned char DM0_Speed11_Position_90[15]   =    { 0xff, 0x01, 0x00, 0x0b, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 };  //通道0,速度=11,位置90度
  15. static  unsigned char DM0_Speed12_Position_90[15]   =    { 0xff, 0x01, 0x00, 0x0c, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 };  //通道0,速度=12,位置90度
  16. static  unsigned char DM0_Speed13_Position_90[15]   =    { 0xff, 0x01, 0x00, 0x0d, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 };  //通道0,速度=13,位置90度
  17. static  unsigned char DM0_Speed14_Position_90[15]   =    { 0xff, 0x01, 0x00, 0x0e, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 };  //通道0,速度=14,位置90度
  18. static  unsigned char DM0_Speed15_Position_90[15]   =    { 0xff, 0x01, 0x00, 0x0f, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 };  //通道0,速度=15,位置90度
  19. static  unsigned char DM0_Speed16_Position_90[15]   =    { 0xff, 0x01, 0x00, 0x10, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 };  //通道0,速度=16,位置90度
  20. static  unsigned char DM0_Speed17_Position_90[15]   =    { 0xff, 0x01, 0x00, 0x11, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 };  //通道0,速度=17,位置90度
  21. static  unsigned char DM0_Speed18_Position_90[15]   =    { 0xff, 0x01, 0x00, 0x12, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 };  //通道0,速度=18,位置90度
  22. static  unsigned char DM0_Speed19_Position_90[15]   =    { 0xff, 0x01, 0x00, 0x13, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 };  //通道0,速度=19,位置90度
  23. static  unsigned char DM0_Speed20_Position_90[15]   =    { 0xff, 0x01, 0x00, 0x14, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 };  //通道0,速度=20,位置90度
  24.    

  25. static  unsigned char DM0_Speed1_Position_0[15]     =    { 0xff, 0x01, 0x00, 0x01, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 };  //通道0,速度=1,位置0度
  26. static  unsigned char DM0_Speed2_Position_0[15]     =    { 0xff, 0x01, 0x00, 0x02, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 };  //通道0,速度=2,位置0度
  27. static  unsigned char DM0_Speed3_Position_0[15]     =    { 0xff, 0x01, 0x00, 0x03, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 };  //通道0,速度=3,位置0度
  28. static  unsigned char DM0_Speed4_Position_0[15]     =    { 0xff, 0x01, 0x00, 0x04, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 };  //通道0,速度=4,位置0度
  29. static  unsigned char DM0_Speed5_Position_0[15]     =    { 0xff, 0x01, 0x00, 0x05, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 };  //通道0,速度=5,位置0度
  30. static  unsigned char DM0_Speed6_Position_0[15]     =    { 0xff, 0x01, 0x00, 0x06, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 };  //通道0,速度=6,位置0度
  31. static  unsigned char DM0_Speed7_Position_0[15]     =    { 0xff, 0x01, 0x00, 0x07, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 };  //通道0,速度=7,位置0度
  32. static  unsigned char DM0_Speed8_Position_0[15]     =    { 0xff, 0x01, 0x00, 0x08, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 };  //通道0,速度=8,位置0度
  33. static  unsigned char DM0_Speed9_Position_0[15]     =    { 0xff, 0x01, 0x00, 0x09, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 };  //通道0,速度=9,位置0度
  34. static  unsigned char DM0_Speed10_Position_0[15]    =    { 0xff, 0x01, 0x00, 0x0a, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 };  //通道0,速度=10,位置0度
  35. static  unsigned char DM0_Speed11_Position_0[15]    =    { 0xff, 0x01, 0x00, 0x0b, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 };  //通道0,速度=11,位置0度
  36. static  unsigned char DM0_Speed12_Position_0[15]    =    { 0xff, 0x01, 0x00, 0x0c, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 };  //通道0,速度=12,位置0度
  37. static  unsigned char DM0_Speed13_Position_0[15]    =    { 0xff, 0x01, 0x00, 0x0d, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 };  //通道0,速度=13,位置0度
  38. static  unsigned char DM0_Speed14_Position_0[15]    =    { 0xff, 0x01, 0x00, 0x0e, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 };  //通道0,速度=14,位置0度
  39. static  unsigned char DM0_Speed15_Position_0[15]    =    { 0xff, 0x01, 0x00, 0x0f, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 };  //通道0,速度=15,位置0度
  40. static  unsigned char DM0_Speed16_Position_0[15]    =    { 0xff, 0x01, 0x00, 0x10, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 };  //通道0,速度=16,位置0度
  41. static  unsigned char DM0_Speed17_Position_0[15]    =    { 0xff, 0x01, 0x00, 0x11, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 };  //通道0,速度=17,位置0度
  42. static  unsigned char DM0_Speed18_Position_0[15]    =    { 0xff, 0x01, 0x00, 0x12, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 };  //通道0,速度=18,位置0度
  43. static  unsigned char DM0_Speed19_Position_0[15]    =    { 0xff, 0x01, 0x00, 0x13, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 };  //通道0,速度=19,位置0度
  44. static  unsigned char DM0_Speed20_Position_0[15]    =    { 0xff, 0x01, 0x00, 0x14, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 };  //通道0,速度=20,位置0度
  45.                                                                                                   
  46.                                             
  47. static  unsigned char DM1_Speed1_Position_90[15]    =    { 0xff, 0x01, 0x01, 0x01, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 };  //通道1,速度=1,位置90度
  48. static  unsigned char DM1_Speed2_Position_90[15]    =    { 0xff, 0x01, 0x01, 0x02, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 };  //通道1,速度=2,位置90度
  49. static  unsigned char DM1_Speed3_Position_90[15]    =    { 0xff, 0x01, 0x01, 0x03, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 };  //通道1,速度=3,位置90度
  50. static  unsigned char DM1_Speed4_Position_90[15]    =    { 0xff, 0x01, 0x01, 0x04, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 };  //通道1,速度=4,位置90度
  51. static  unsigned char DM1_Speed5_Position_90[15]    =    { 0xff, 0x01, 0x01, 0x05, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 };  //通道1,速度=5,位置90度
  52. static  unsigned char DM1_Speed6_Position_90[15]    =    { 0xff, 0x01, 0x01, 0x06, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 };  //通道1,速度=6,位置90度
  53. static  unsigned char DM1_Speed7_Position_90[15]    =    { 0xff, 0x01, 0x01, 0x07, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 };  //通道1,速度=7,位置90度
  54. static  unsigned char DM1_Speed8_Position_90[15]    =    { 0xff, 0x01, 0x01, 0x08, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 };  //通道1,速度=8,位置90度
  55. static  unsigned char DM1_Speed9_Position_90[15]    =    { 0xff, 0x01, 0x01, 0x09, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 };  //通道1,速度=9,位置90度
  56. static  unsigned char DM1_Speed10_Position_90[15]   =    { 0xff, 0x01, 0x01, 0x0a, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 };  //通道1,速度=10,位置90度
  57. static  unsigned char DM1_Speed11_Position_90[15]   =    { 0xff, 0x01, 0x01, 0x0b, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 };  //通道1,速度=11,位置90度
  58. static  unsigned char DM1_Speed12_Position_90[15]   =    { 0xff, 0x01, 0x01, 0x0c, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 };  //通道1,速度=12,位置90度
  59. static  unsigned char DM1_Speed13_Position_90[15]   =    { 0xff, 0x01, 0x01, 0x0d, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 };  //通道1,速度=13,位置90度
  60. static  unsigned char DM1_Speed14_Position_90[15]   =    { 0xff, 0x01, 0x01, 0x0e, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 };  //通道1,速度=14,位置90度
  61. static  unsigned char DM1_Speed15_Position_90[15]   =    { 0xff, 0x01, 0x01, 0x0f, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 };  //通道1,速度=15,位置90度
  62. static  unsigned char DM1_Speed16_Position_90[15]   =    { 0xff, 0x01, 0x01, 0x10, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 };  //通道1,速度=16,位置90度
  63. static  unsigned char DM1_Speed17_Position_90[15]   =    { 0xff, 0x01, 0x01, 0x11, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 };  //通道1,速度=17,位置90度
  64. static  unsigned char DM1_Speed18_Position_90[15]   =    { 0xff, 0x01, 0x01, 0x12, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 };  //通道1,速度=18,位置90度
  65. static  unsigned char DM1_Speed19_Position_90[15]   =    { 0xff, 0x01, 0x01, 0x13, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 };  //通道1,速度=19,位置90度
  66. static  unsigned char DM1_Speed20_Position_90[15]   =    { 0xff, 0x01, 0x01, 0x14, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 };  //通道1,速度=20,位置90度
  67.       

  68. static  unsigned char DM1_Speed1_Position_0[15]     =    { 0xff, 0x01, 0x01, 0x01, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 };  //通道1,速度=1,位置0度
  69. static  unsigned char DM1_Speed2_Position_0[15]     =    { 0xff, 0x01, 0x01, 0x02, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 };  //通道1,速度=2,位置0度
  70. static  unsigned char DM1_Speed3_Position_0[15]     =    { 0xff, 0x01, 0x01, 0x03, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 };  //通道1,速度=3,位置0度
  71. static  unsigned char DM1_Speed4_Position_0[15]     =    { 0xff, 0x01, 0x01, 0x04, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 };  //通道1,速度=4,位置0度
  72. static  unsigned char DM1_Speed5_Position_0[15]     =    { 0xff, 0x01, 0x01, 0x05, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 };  //通道1,速度=5,位置0度
  73. static  unsigned char DM1_Speed6_Position_0[15]     =    { 0xff, 0x01, 0x01, 0x06, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 };  //通道1,速度=6,位置0度
  74. static  unsigned char DM1_Speed7_Position_0[15]     =    { 0xff, 0x01, 0x01, 0x07, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 };  //通道1,速度=7,位置0度
  75. static  unsigned char DM1_Speed8_Position_0[15]     =    { 0xff, 0x01, 0x01, 0x08, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 };  //通道1,速度=8,位置0度
  76. static  unsigned char DM1_Speed9_Position_0[15]     =    { 0xff, 0x01, 0x01, 0x09, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 };  //通道1,速度=9,位置0度
  77. static  unsigned char DM1_Speed10_Position_0[15]    =    { 0xff, 0x01, 0x01, 0x0a, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 };  //通道1,速度=10,位置0度
  78. static  unsigned char DM1_Speed11_Position_0[15]    =    { 0xff, 0x01, 0x01, 0x0b, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 };  //通道1,速度=11,位置0度
  79. static  unsigned char DM1_Speed12_Position_0[15]    =    { 0xff, 0x01, 0x01, 0x0c, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 };  //通道1,速度=12,位置0度
  80. static  unsigned char DM1_Speed13_Position_0[15]    =    { 0xff, 0x01, 0x01, 0x0d, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 };  //通道1,速度=13,位置0度
  81. static  unsigned char DM1_Speed14_Position_0[15]    =    { 0xff, 0x01, 0x01, 0x0e, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 };  //通道1,速度=14,位置0度
  82. static  unsigned char DM1_Speed15_Position_0[15]    =    { 0xff, 0x01, 0x01, 0x0f, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 };  //通道1,速度=15,位置0度
  83. static  unsigned char DM1_Speed16_Position_0[15]    =    { 0xff, 0x01, 0x01, 0x10, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 };  //通道1,速度=16,位置0度
  84. static  unsigned char DM1_Speed17_Position_0[15]    =    { 0xff, 0x01, 0x01, 0x11, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 };  //通道1,速度=17,位置0度
  85. static  unsigned char DM1_Speed18_Position_0[15]    =    { 0xff, 0x01, 0x01, 0x12, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 };  //通道1,速度=18,位置0度
  86. static  unsigned char DM1_Speed19_Position_0[15]    =    { 0xff, 0x01, 0x01, 0x13, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 };  //通道1,速度=19,位置0度
  87. static  unsigned char DM1_Speed20_Position_0[15]    =    { 0xff, 0x01, 0x01, 0x14, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 };  //通道1,速度=20,位置0度
  88.                                             
  89.                                             
  90. static  unsigned char DM2_Speed1_Position_90[15]    =    { 0xff, 0x01, 0x02, 0x01, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 };  //通道2,速度=1,位置90度
  91. static  unsigned char DM2_Speed2_Position_90[15]    =    { 0xff, 0x01, 0x02, 0x02, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 };  //通道2,速度=2,位置90度
  92. static  unsigned char DM2_Speed3_Position_90[15]    =    { 0xff, 0x01, 0x02, 0x03, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 };  //通道2,速度=3,位置90度
  93. static  unsigned char DM2_Speed4_Position_90[15]    =    { 0xff, 0x01, 0x02, 0x04, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 };  //通道2,速度=4,位置90度
  94. static  unsigned char DM2_Speed5_Position_90[15]    =    { 0xff, 0x01, 0x02, 0x05, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 };  //通道2,速度=5,位置90度
  95. static  unsigned char DM2_Speed6_Position_90[15]    =    { 0xff, 0x01, 0x02, 0x06, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 };  //通道2,速度=6,位置90度
  96. static  unsigned char DM2_Speed7_Position_90[15]    =    { 0xff, 0x01, 0x02, 0x07, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 };  //通道2,速度=7,位置90度
  97. static  unsigned char DM2_Speed8_Position_90[15]    =    { 0xff, 0x01, 0x02, 0x08, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 };  //通道2,速度=8,位置90度
  98. static  unsigned char DM2_Speed9_Position_90[15]    =    { 0xff, 0x01, 0x02, 0x09, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 };  //通道2,速度=9,位置90度
  99. static  unsigned char DM2_Speed10_Position_90[15]   =    { 0xff, 0x01, 0x02, 0x0a, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 };  //通道2,速度=10,位置90度
  100. static  unsigned char DM2_Speed11_Position_90[15]   =    { 0xff, 0x01, 0x02, 0x0b, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 };  //通道2,速度=11,位置90度
  101. static  unsigned char DM2_Speed12_Position_90[15]   =    { 0xff, 0x01, 0x02, 0x0c, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 };  //通道2,速度=12,位置90度
  102. static  unsigned char DM2_Speed13_Position_90[15]   =    { 0xff, 0x01, 0x02, 0x0d, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 };  //通道2,速度=13,位置90度
  103. static  unsigned char DM2_Speed14_Position_90[15]   =    { 0xff, 0x01, 0x02, 0x0e, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 };  //通道2,速度=14,位置90度
  104. static  unsigned char DM2_Speed15_Position_90[15]   =    { 0xff, 0x01, 0x02, 0x0f, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 };  //通道2,速度=15,位置90度
  105. static  unsigned char DM2_Speed16_Position_90[15]   =    { 0xff, 0x01, 0x02, 0x10, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 };  //通道2,速度=16,位置90度
  106. static  unsigned char DM2_Speed17_Position_90[15]   =    { 0xff, 0x01, 0x02, 0x11, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 };  //通道2,速度=17,位置90度
  107. static  unsigned char DM2_Speed18_Position_90[15]   =    { 0xff, 0x01, 0x02, 0x12, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 };  //通道2,速度=18,位置90度
  108. static  unsigned char DM2_Speed19_Position_90[15]   =    { 0xff, 0x01, 0x02, 0x13, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 };  //通道2,速度=19,位置90度
  109. static  unsigned char DM2_Speed20_Position_90[15]   =    { 0xff, 0x01, 0x02, 0x14, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 };  //通道2,速度=20,位置90度


  110. static  unsigned char DM2_Speed1_Position_0[15]     =    { 0xff, 0x01, 0x02, 0x01, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 };  //通道2,速度=1,位置0度
  111. static  unsigned char DM2_Speed2_Position_0[15]     =    { 0xff, 0x01, 0x02, 0x02, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 };  //通道2,速度=2,位置0度
  112. static  unsigned char DM2_Speed3_Position_0[15]     =    { 0xff, 0x01, 0x02, 0x03, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 };  //通道2,速度=3,位置0度
  113. static  unsigned char DM2_Speed4_Position_0[15]     =    { 0xff, 0x01, 0x02, 0x04, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 };  //通道2,速度=4,位置0度
  114. static  unsigned char DM2_Speed5_Position_0[15]     =    { 0xff, 0x01, 0x02, 0x05, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 };  //通道2,速度=5,位置0度
  115. static  unsigned char DM2_Speed6_Position_0[15]     =    { 0xff, 0x01, 0x02, 0x06, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 };  //通道2,速度=6,位置0度
  116. static  unsigned char DM2_Speed7_Position_0[15]     =    { 0xff, 0x01, 0x02, 0x07, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 };  //通道2,速度=7,位置0度
  117. static  unsigned char DM2_Speed8_Position_0[15]     =    { 0xff, 0x01, 0x02, 0x08, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 };  //通道2,速度=8,位置0度
  118. static  unsigned char DM2_Speed9_Position_0[15]     =    { 0xff, 0x01, 0x02, 0x09, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 };  //通道2,速度=9,位置0度
  119. static  unsigned char DM2_Speed10_Position_0[15]    =    { 0xff, 0x01, 0x02, 0x0a, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 };  //通道2,速度=10,位置0度
  120. static  unsigned char DM2_Speed11_Position_0[15]    =    { 0xff, 0x01, 0x02, 0x0b, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 };  //通道2,速度=11,位置0度
  121. static  unsigned char DM2_Speed12_Position_0[15]    =    { 0xff, 0x01, 0x02, 0x0c, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 };  //通道2,速度=12,位置0度
  122. static  unsigned char DM2_Speed13_Position_0[15]    =    { 0xff, 0x01, 0x02, 0x0d, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 };  //通道2,速度=13,位置0度
  123. static  unsigned char DM2_Speed14_Position_0[15]    =    { 0xff, 0x01, 0x02, 0x0e, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 };  //通道2,速度=14,位置0度
  124. static  unsigned char DM2_Speed15_Position_0[15]    =    { 0xff, 0x01, 0x02, 0x0f, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 };  //通道2,速度=15,位置0度
  125. static  unsigned char DM2_Speed16_Position_0[15]    =    { 0xff, 0x01, 0x02, 0x10, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 };  //通道2,速度=16,位置0度
  126. static  unsigned char DM2_Speed17_Position_0[15]    =    { 0xff, 0x01, 0x02, 0x11, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 };  //通道2,速度=17,位置0度
  127. static  unsigned char DM2_Speed18_Position_0[15]    =    { 0xff, 0x01, 0x02, 0x12, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 };  //通道2,速度=18,位置0度
  128. static  unsigned char DM2_Speed19_Position_0[15]    =    { 0xff, 0x01, 0x02, 0x13, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 };  //通道2,速度=19,位置0度
  129. static  unsigned char DM2_Speed20_Position_0[15]    =    { 0xff, 0x01, 0x02, 0x14, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 };  //通道2,速度=20,位置0度
  130.                                             
  131.                                             
  132. static  unsigned char DM3_Speed10_Position_90[15]   =    { 0xff, 0x01, 0x03, 0x0a, 0x00, 0xff, 0x02, 0x03, 0xdc, 0x05 };  //通道3,速度=10,位置90度
  133. static  unsigned char DM3_Speed20_Position_90[15]   =    { 0xff, 0x01, 0x03, 0x14, 0x00, 0xff, 0x02, 0x03, 0xdc, 0x05 };  //通道3,速度=20,位置90度
  134.                                             
  135. static  unsigned char DM3_Speed10_Position_0[15]    =    { 0xff, 0x01, 0x03, 0x0a, 0x00, 0xff, 0x02, 0x03, 0xf4, 0x01 };  //通道3,速度=10,位置0度
  136. static  unsigned char DM3_Speed20_Position_0[15]    =    { 0xff, 0x01, 0x03, 0x14, 0x00, 0xff, 0x02, 0x03, 0xf4, 0x01 };  //通道3,速度=20,位置0度
  137.                                             
  138.                                             
  139. static  unsigned char DM4_Speed10_Position_90[15]   =    { 0xff, 0x01, 0x04, 0x0a, 0x00, 0xff, 0x02, 0x04, 0xdc, 0x05 };  //通道4,速度=10,位置90度
  140. static  unsigned char DM4_Speed20_Position_90[15]   =    { 0xff, 0x01, 0x04, 0x14, 0x00, 0xff, 0x02, 0x04, 0xdc, 0x05 };  //通道4,速度=20,位置90度
  141.                                                                                                                           
  142. static  unsigned char DM4_Speed10_Position_0[15]    =    { 0xff, 0x01, 0x04, 0x0a, 0x00, 0xff, 0x02, 0x04, 0xf4, 0x01 };  //通道4,速度=10,位置0度
  143. static  unsigned char DM4_Speed20_Position_0[15]    =    { 0xff, 0x01, 0x04, 0x14, 0x00, 0xff, 0x02, 0x04, 0xf4, 0x01 };  //通道4,速度=20,位置0度
  144.                                             
  145.                                             
  146. static  unsigned char DM5_Speed10_Position_90[15]   =    { 0xff, 0x01, 0x05, 0x0a, 0x00, 0xff, 0x02, 0x05, 0xdc, 0x05 };  //通道5,速度=10,位置90度
  147. static  unsigned char DM5_Speed20_Position_90[15]   =    { 0xff, 0x01, 0x05, 0x14, 0x00, 0xff, 0x02, 0x05, 0xdc, 0x05 };  //通道5,速度=20,位置90度
  148.                                                                                                                            
  149. static  unsigned char DM5_Speed10_Position_0[15]    =    { 0xff, 0x01, 0x05, 0x0a, 0x00, 0xff, 0x02, 0x05, 0xf4, 0x01 };  //通道5,速度=10,位置0度
  150. static  unsigned char DM5_Speed20_Position_0[15]    =    { 0xff, 0x01, 0x05, 0x14, 0x00, 0xff, 0x02, 0x05, 0xf4, 0x01 };  //通道5,速度=20,位置0度
  151.                                             
  152.                                             
  153. static  unsigned char DM6_Speed10_Position_90[15]   =    { 0xff, 0x01, 0x06, 0x0a, 0x00, 0xff, 0x02, 0x06, 0xdc, 0x05 };  //通道6,速度=10,位置90度
  154. static  unsigned char DM6_Speed20_Position_90[15]   =    { 0xff, 0x01, 0x06, 0x14, 0x00, 0xff, 0x02, 0x06, 0xdc, 0x05 };  //通道6,速度=20,位置90度
  155.                                                                                                                            
  156. static  unsigned char DM6_Speed10_Position_0[15]    =    { 0xff, 0x01, 0x06, 0x0a, 0x00, 0xff, 0x02, 0x06, 0xf4, 0x01 };  //通道6,速度=10,位置0度
  157. static  unsigned char DM6_Speed20_Position_0[15]    =    { 0xff, 0x01, 0x06, 0x14, 0x00, 0xff, 0x02, 0x06, 0xf4, 0x01 };  //通道6,速度=20,位置0度
  158.                                             
  159.                                             
  160. static  unsigned char DM7_Speed10_Position_90[15]   =    { 0xff, 0x01, 0x07, 0x0a, 0x00, 0xff, 0x02, 0x07, 0xdc, 0x05 };  //通道7,速度=10,位置90度
  161. static  unsigned char DM7_Speed20_Position_90[15]   =    { 0xff, 0x01, 0x07, 0x14, 0x00, 0xff, 0x02, 0x07, 0xdc, 0x05 };  //通道7,速度=20,位置90度
  162.                                                                                                                            
  163. static  unsigned char DM7_Speed10_Position_0[15]    =    { 0xff, 0x01, 0x07, 0x0a, 0x00, 0xff, 0x02, 0x07, 0xf4, 0x01 };  //通道7,速度=10,位置0度
  164. static  unsigned char DM7_Speed20_Position_0[15]    =    { 0xff, 0x01, 0x07, 0x14, 0x00, 0xff, 0x02, 0x07, 0xf4, 0x01 };  //通道7,速度=20,位置0度
  165.                                             
  166.                                             
  167. static  unsigned char DM8_Speed10_Position_90[15]   =    { 0xff, 0x01, 0x08, 0x0a, 0x00, 0xff, 0x02, 0x08, 0xdc, 0x05 };  //通道8,速度=10,位置90度
  168. static  unsigned char DM8_Speed20_Position_90[15]   =    { 0xff, 0x01, 0x08, 0x14, 0x00, 0xff, 0x02, 0x08, 0xdc, 0x05 };  //通道8,速度=20,位置90度
  169.                                                                                                                            
  170. static  unsigned char DM8_Speed10_Position_0[15]    =    { 0xff, 0x01, 0x08, 0x0a, 0x00, 0xff, 0x02, 0x08, 0xf4, 0x01 };  //通道8,速度=10,位置0度
  171. static  unsigned char DM8_Speed20_Position_0[15]    =    { 0xff, 0x01, 0x08, 0x14, 0x00, 0xff, 0x02, 0x08, 0xf4, 0x01 };  //通道8,速度=20,位置0度
  172.                                             
  173.                                             
  174. static  unsigned char DM9_Speed10_Position_90[15]   =    { 0xff, 0x01, 0x09, 0x0a, 0x00, 0xff, 0x02, 0x09, 0xdc, 0x05 };  //通道9,速度=10,位置90度
  175. static  unsigned char DM9_Speed20_Position_90[15]   =    { 0xff, 0x01, 0x09, 0x14, 0x00, 0xff, 0x02, 0x09, 0xdc, 0x05 };  //通道9,速度=20,位置90度
  176.                                                                                                                            
  177. static  unsigned char DM9_Speed10_Position_0[15]    =    { 0xff, 0x01, 0x09, 0x0a, 0x00, 0xff, 0x02, 0x09, 0xf4, 0x01 };  //通道9,速度=10,位置0度
  178. static  unsigned char DM9_Speed20_Position_0[15]    =    { 0xff, 0x01, 0x09, 0x14, 0x00, 0xff, 0x02, 0x09, 0xf4, 0x01 };  //通道9,速度=20,位置0度


  179. static  unsigned char DM10_Speed10_Position_90[15]  =    { 0xff, 0x01, 0x0a, 0x0a, 0x00, 0xff, 0x02, 0x0a, 0xdc, 0x05 };  //通道10,速度=10,位置90度
  180. static  unsigned char DM10_Speed20_Position_90[15]  =    { 0xff, 0x01, 0x0a, 0x14, 0x00, 0xff, 0x02, 0x0a, 0xdc, 0x05 };  //通道10,速度=20,位置90度
  181.                                                                                                                            
  182. static  unsigned char DM10_Speed10_Position_0[15]   =    { 0xff, 0x01, 0x0a, 0x0a, 0x00, 0xff, 0x02, 0x0a, 0xf4, 0x01 };  //通道10,速度=10,位置0度
  183. static  unsigned char DM10_Speed20_Position_0[15]   =    { 0xff, 0x01, 0x0a, 0x14, 0x00, 0xff, 0x02, 0x0a, 0xf4, 0x01 };  //通道10,速度=20,位置0度


  184. static  unsigned char DM11_Speed10_Position_90[15]  =    { 0xff, 0x01, 0x0b, 0x0a, 0x00, 0xff, 0x02, 0x0b, 0xdc, 0x05 };  //通道11,速度=10,位置90度
  185. static  unsigned char DM11_Speed20_Position_90[15]  =    { 0xff, 0x01, 0x0b, 0x14, 0x00, 0xff, 0x02, 0x0b, 0xdc, 0x05 };  //通道11,速度=20,位置90度
  186.                                                                                                                            
  187. static  unsigned char DM11_Speed10_Position_0[15]   =    { 0xff, 0x01, 0x0b, 0x0a, 0x00, 0xff, 0x02, 0x0b, 0xf4, 0x01 };  //通道11,速度=10,位置0度
  188. static  unsigned char DM11_Speed20_Position_0[15]   =    { 0xff, 0x01, 0x0b, 0x14, 0x00, 0xff, 0x02, 0x0b, 0xf4, 0x01 };  //通道11,速度=20,位置0度


  189. static  unsigned char DM12_Speed10_Position_90[15]  =    { 0xff, 0x01, 0x0c, 0x0a, 0x00, 0xff, 0x02, 0x0c, 0xdc, 0x05 };  //通道12,速度=10,位置90度
  190. static  unsigned char DM12_Speed20_Position_90[15]  =    { 0xff, 0x01, 0x0c, 0x14, 0x00, 0xff, 0x02, 0x0c, 0xdc, 0x05 };  //通道12,速度=20,位置90度
  191.                                                                                                                            
  192. static  unsigned char DM12_Speed10_Position_0[15]   =    { 0xff, 0x01, 0x0c, 0x0a, 0x00, 0xff, 0x02, 0x0c, 0xf4, 0x01 };  //通道12,速度=10,位置0度
  193. static  unsigned char DM12_Speed20_Position_0[15]   =    { 0xff, 0x01, 0x0c, 0x14, 0x00, 0xff, 0x02, 0x0c, 0xf4, 0x01 };  //通道12,速度=20,位置0度


  194. static  unsigned char DM13_Speed10_Position_90[15]  =    { 0xff, 0x01, 0x0d, 0x0a, 0x00, 0xff, 0x02, 0x0d, 0xdc, 0x05 };  //通道13,速度=10,位置90度
  195. static  unsigned char DM13_Speed20_Position_90[15]  =    { 0xff, 0x01, 0x0d, 0x14, 0x00, 0xff, 0x02, 0x0d, 0xdc, 0x05 };  //通道13,速度=20,位置90度
  196.                                                                                                                            
  197. static  unsigned char DM13_Speed10_Position_0[15]   =    { 0xff, 0x01, 0x0d, 0x0a, 0x00, 0xff, 0x02, 0x0d, 0xf4, 0x01 };  //通道13,速度=10,位置0度
  198. static  unsigned char DM13_Speed20_Position_0[15]   =    { 0xff, 0x01, 0x0d, 0x14, 0x00, 0xff, 0x02, 0x0d, 0xf4, 0x01 };  //通道13,速度=20,位置0度


  199. static  unsigned char DM14_Speed10_Position_90[15]  =    { 0xff, 0x01, 0x0e, 0x0a, 0x00, 0xff, 0x02, 0x0e, 0xdc, 0x05 };  //通道14,速度=10,位置90度
  200. static  unsigned char DM14_Speed20_Position_90[15]  =    { 0xff, 0x01, 0x0e, 0x14, 0x00, 0xff, 0x02, 0x0e, 0xdc, 0x05 };  //通道14,速度=20,位置90度
  201.                                                                                                                            
  202. static  unsigned char DM14_Speed10_Position_0[15]   =    { 0xff, 0x01, 0x0e, 0x0a, 0x00, 0xff, 0x02, 0x0e, 0xf4, 0x01 };  //通道14,速度=10,位置0度
  203. static  unsigned char DM14_Speed20_Position_0[15]   =    { 0xff, 0x01, 0x0e, 0x14, 0x00, 0xff, 0x02, 0x0e, 0xf4, 0x01 };  //通道14,速度=20,位置0度


  204. static  unsigned char DM15_Speed10_Position_90[15]  =    { 0xff, 0x01, 0x0f, 0x0a, 0x00, 0xff, 0x02, 0x0f, 0xdc, 0x05 };  //通道15,速度=10,位置90度
  205. static  unsigned char DM15_Speed20_Position_90[15]  =    { 0xff, 0x01, 0x0f, 0x14, 0x00, 0xff, 0x02, 0x0f, 0xdc, 0x05 };  //通道15,速度=20,位置90度
  206.                                                                                                                            
  207. static  unsigned char DM15_Speed10_Position_0[15]   =    { 0xff, 0x01, 0x0f, 0x0a, 0x00, 0xff, 0x02, 0x0f, 0xf4, 0x01 };  //通道15,速度=10,位置0度
  208. static  unsigned char DM15_Speed20_Position_0[15]   =    { 0xff, 0x01, 0x0f, 0x14, 0x00, 0xff, 0x02, 0x0f, 0xf4, 0x01 };  //通道15,速度=20,位置0度


  209. //********************动作组********************//
  210. static  unsigned char DM_Action0[5]   = { 0xff, 0x09, 0x00, 0x00, 0x00 };               //动作组0
  211. static  unsigned char DM_Action1[5]   = { 0xff, 0x09, 0x00, 0x01, 0x00 };               //动作组1
  212. static  unsigned char DM_Action2[5]   = { 0xff, 0x09, 0x00, 0x02, 0x00 };               //动作组2
  213. static  unsigned char DM_Action3[5]   = { 0xff, 0x09, 0x00, 0x03, 0x00 };               //动作组3
  214. static  unsigned char DM_Action4[5]   = { 0xff, 0x09, 0x00, 0x04, 0x00 };               //动作组4
  215. static  unsigned char DM_Action5[5]   = { 0xff, 0x09, 0x00, 0x05, 0x00 };               //动作组5
  216. static  unsigned char DM_Action6[5]   = { 0xff, 0x09, 0x00, 0x06, 0x00 };               //动作组6
  217. static  unsigned char DM_Action7[5]   = { 0xff, 0x09, 0x00, 0x07, 0x00 };               //动作组7
  218. static  unsigned char DM_Action8[5]   = { 0xff, 0x09, 0x00, 0x08, 0x00 };               //动作组8
  219. static  unsigned char DM_Action9[5]   = { 0xff, 0x09, 0x00, 0x09, 0x00 };               //动作组9
  220. static  unsigned char DM_Action10[5]  = { 0xff, 0x09, 0x00, 0x0a, 0x00 };               //动作组a
  221. static  unsigned char DM_Action11[5]  = { 0xff, 0x09, 0x00, 0x0b, 0x00 };               //动作组b
  222. static  unsigned char DM_Action12[5]  = { 0xff, 0x09, 0x00, 0x0c, 0x00 };               //动作组c
  223. static  unsigned char DM_Action13[5]  = { 0xff, 0x09, 0x00, 0x0d, 0x00 };               //动作组d
  224. static  unsigned char DM_Action14[5]  = { 0xff, 0x09, 0x00, 0x0e, 0x00 };               //动作组e
  225. static  unsigned char DM_Action15[5]  = { 0xff, 0x09, 0x00, 0x0f, 0x00 };               //动作组f

  226. #endif
 楼主| 斧王FUWANG 发表于 2023-9-22 10:46 | 显示全部楼层
总结:

单片机连接舵机控制板进行舵机角度控制,电池电压7.2V 舵机mg996/mg90s
舵机控制板波特率9600
一般的stm32 机 本身就有1到4个PWM 控制输出根据个人情况去定义程序和选择产品
串口通信的常规用法。
公羊子丹 发表于 2024-8-11 08:25 | 显示全部楼层

如果碰到异型或圆型板才有可能用到邮票孔
Uriah 发表于 2024-8-11 10:31 | 显示全部楼层

电源模块的灌封用的胶是可以根据需求而调制的
帛灿灿 发表于 2024-8-11 12:27 | 显示全部楼层

所以不会通过地损耗
Bblythe 发表于 2024-8-11 13:30 | 显示全部楼层

相当于积分,用于滤波
童雨竹 发表于 2024-8-11 18:25 | 显示全部楼层

驱动脉冲变压器原边时,
您需要登录后才可以回帖 登录 | 注册

本版积分规则

39

主题

277

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部