100)//pwm限幅 {  pwm=100; } if(pwm<-100) {  pwm=-100; } -IMDN开发者社群-imdn.cn"> 100)//pwm限幅 {  pwm=100; } if(pwm<-100) {  pwm=-100; }  - IMDN开发者社群-imdn.cn">
登录
首页 » c++ » XIAOZHILI

XIAOZHILI

于 2022-01-26 发布 文件大小:61.94 kB
0 74
下载积分: 2 下载次数: 1

代码说明:

/***************************************************************自平衡程序修改时间:2013.12.8***************************************************************/#include "main.h"#define position_max 6000  //位置最大值int j=0;int position=0;int k=0;int i=0;int speed1=0;int speed=0;int acc_y=0;int acc_z=0;int gyr_x=0;int receive=0;int pwm=0;float G_X=0,A_X=0;float gyro_angle=0;float balan_angle=0;float balan_angle1=0;float G_X1=0,A_X1=0,G_X2=0,G_X3=0,GXERRO=0;float erro[3]; int pwmneed=0;int pwmturn=0;void adjust(void);void judge(){  pwm=PID_control(erro[0],G_X)+PID_control_2(speed,position);  //pwm+=pwmneed;  if(pwm>100) //pwm限幅  {    pwm=100;  }  if(pwm

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • usb
    communication usb embedded c
    2013-08-03 20:20:26下载
    积分:1
  • BeautifulTextBox
    数字文本框,只能输入数字,有三种模式,希望大家喜欢(Digital text box, can only input Numbers)
    2013-03-13 21:23:11下载
    积分:1
  • License-plate-correction
    车牌矫正,对于一写不够标准的车牌进行矫正,让车牌更容易被分割(Plate correction, not enough for a standard license plate write to correct, so more likely to be split plate)
    2015-05-21 15:48:47下载
    积分:1
  • tca8418_keypad
    实现了tca8418的键盘驱动,感觉很好用,可以下载试试(The keyboard driver of tca8418 is realized)
    2021-02-24 17:19:39下载
    积分:1
  • 通讯录管理系统 sqlserver 数据库
    c#通讯录管理 数据库连接自己修改,图片有些是本地需要自己手动修改
    2019-05-20下载
    积分:1
  • yuyifenxihezhongjiandaima
    一个很好的语义分析即中间代码生成文档,讲解详细!很值的参考!(yi ge hen hao de yu yi fenxi ji zhongjian daima shengchengwendang,jiangjiexiangxi!henzhidecankao!)
    2009-06-04 23:22:58下载
    积分:1
  • Microphone-volume-level
    Noise Detection (Microphone volume level) - Windows Phone Silverlight.zip MSDN源代码(Noise Detection (Microphone volume level)- Windows Phone Silverlight.zip)
    2015-12-23 17:10:56下载
    积分:1
  • 查找并删除某个同学的姓名。例如:输入的同学姓名分别为:Li Fang , Wang Li , Xiao hanxiong , Feng Lei , Fu Xia...
    查找并删除某个同学的姓名。例如:输入的同学姓名分别为:Li Fang , Wang Li , Xiao hanxiong , Feng Lei , Fu Xiaoxiao ,要查找并删除的同学的姓名为:Feng Lei. 则删除后,同学姓名包含有:Li Fang , Wang Li , Xiao hanxiong , Fu Xiaoxiao -Find and delete the name of a classmate. For example: Enter the names of the students were: Li Fang, Wang Li, Xiao hanxiong, Feng Lei, Fu Xiaoxiao, to search and delete the names of students for: Feng Lei. Is deleted, the names of the students have included: Li Fang, Wang Li, Xiao hanxiong, Fu Xiaoxiao
    2023-06-16 19:40:03下载
    积分:1
  • ypqhhk
    Network and Communication ComTes()
    2017-11-09 17:48:08下载
    积分:1
  • STM32_SPI配置
    说明:  基于STM32 硬件SPI控制DA输出,程序清测可用,STM32 硬件SPI控制DAC输出(Based on STM32 hardware SPI to control Da output, program clear test is available, STM32 hardware SPI to control DAC output)
    2021-04-20 19:58:50下载
    积分:1
  • 696518资源总数
  • 105908会员总数
  • 30今日下载