{"id":65005,"date":"2026-01-24T11:49:37","date_gmt":"2026-01-24T03:49:37","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/65005.html"},"modified":"2026-01-24T11:49:37","modified_gmt":"2026-01-24T03:49:37","slug":"%e9%a1%b9%e7%9b%ae%e7%ab%af%ef%bc%883%ef%bc%89%e5%b9%b3%e8%a1%a1%e8%bd%a6","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/65005.html","title":{"rendered":"\u9879\u76ee\u7aef\uff083\uff09\u5e73\u8861\u8f66"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"720\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260124034927-6974414784efa.png\" width=\"1200\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"656\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260124034928-697441484c8a8.png\" width=\"1146\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"768\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260124034928-69744148d114d.png\" width=\"1143\" \/><\/p>\n<p style=\"margin-left:0\">MPU6050&#xff1b;<\/p>\n<p style=\"margin-left:0\">\u4fef\u4ef0\u89d2<\/p>\n<p style=\"margin-left:0\">\u7ffb\u6eda\u89d2<\/p>\n<p style=\"margin-left:0\">\u504f\u822a\u89d2<\/p>\n<p style=\"margin-left:0\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"758\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260124034929-6974414964a8d.png\" width=\"881\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"765\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260124034929-69744149aebd1.png\" width=\"1061\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"769\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260124034930-6974414a30809.png\" width=\"1080\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"335\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260124034930-6974414ac080f.png\" width=\"1070\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"459\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260124034931-6974414b1064b.png\" width=\"1200\" \/><\/p>\n<h3>TB6612\u00a0<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"548\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260124034931-6974414b6e763.png\" width=\"1061\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"941\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260124034931-6974414bc7a1b.png\" width=\"1200\" \/>\u00a0<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1080\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260124034933-6974414d1095d.png\" width=\"1200\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"103\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260124034934-6974414e7696e.png\" width=\"1200\" \/>\u00a0<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"90\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260124034934-6974414e9ee03.png\" width=\"1053\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"90\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260124034934-6974414ec258b.png\" width=\"1200\" \/>\u00a0<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"75\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260124034935-6974414f09390.png\" width=\"1200\" \/><\/p>\n<h3><\/h3>\n<h3>PID<\/h3>\n<p style=\"margin-left:0\">1.PID\u57fa\u7840\u77e5\u8bc6<\/p>\n<p style=\"margin-left:0\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"205\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260124034935-6974414f357d5.png\" width=\"1030\" \/><\/p>\n<h3><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"486\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260124034935-6974414f6bce6.png\" width=\"1026\" \/><\/h3>\n<h3><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"373\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260124034935-6974414fcee0a.png\" width=\"1121\" \/><\/h3>\n<h3><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"709\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260124034936-697441501ccb1.png\" width=\"891\" \/><\/h3>\n<h3><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"309\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260124034936-6974415062c8a.png\" width=\"1144\" \/><\/h3>\n<h3><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"514\" src=\"2026-01-24z35kwsyjqfn.png\" width=\"1200\" \/><\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"520\" src=\"2026-01-24pwjgrh35dec.png\" width=\"1155\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"411\" src=\"2026-01-24nou4pmmecbb.png\" width=\"1020\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"636\" src=\"2026-01-242h01uiw33iz.png\" width=\"1193\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"449\" src=\"2026-01-24lkkgpqh5ecy.png\" width=\"861\" \/><\/p>\n<p style=\"margin-left:0\">\u8bbe\u5b9a\u503c\u548c\u53cd\u9988\u503c\u76f8\u6bd4\u8f83\u5c31\u662f\u504f\u5dee<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"308\" src=\"2026-01-24utb1bmczn54.png\" width=\"878\" \/><\/p>\n<p style=\"margin-left:0\">\u6bd4\u4f8b\u9879\u5c31\u662f\u4e00\u4e2a\u7cfb\u6570\u4e58\u4ee5\u4e00\u4e2a\u504f\u5dee<\/p>\n<p style=\"margin-left:0\">\u6bd4\u4f8b&#xff1a;\u63d0\u9ad8\u53cd\u5e94\u901f\u5ea6&#xff0c;\u51cf\u5c0f\u9759\u5dee<\/p>\n<p style=\"margin-left:0\">\u79ef\u5206&#xff1a;\u6d88\u9664\u9759\u6001\u8bef\u5dee<\/p>\n<p style=\"margin-left:0\">\u5fae\u5206\u9879&#xff1a;\u51cf\u5c0f\u9707\u8361\u4ee5\u53ca\u8d85\u8c03<\/p>\n<p style=\"margin-left:0\">\n<p style=\"margin-left:0\">\u76f4\u7acb\u73af&#xff0c;\u8ba9\u89d2\u5ea6\u8d8b\u4e8e0<\/p>\n<p style=\"margin-left:0\">\u901f\u5ea6\u73af&#xff0c;\u8ba9\u901f\u5ea6\u8d8b\u4e8e0<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"913\" src=\"2026-01-24xberxuoeurh.png\" width=\"1200\" \/><\/p>\n<p style=\"margin-left:0\">\u79ef\u5206\u9879&#xff0c;\u4e00\u4e2aki&#xff0c;\u79ef\u5206\u65f6\u95f4\u5e38\u6570\u4e58EK\u7684\u79ef\u5206&#xff0c;\u4ece0\u5230k<\/p>\n<p style=\"margin-left:0\">\u5fae\u5206&#xff0c;\u5c31\u662f\u4e00\u4e2a\u6c42\u5bfc&#xff0c;\u672c\u6b21\u7684\u504f\u5dee\u51cf\u53bb\u4e0a\u6b21\u7684\u504f\u5dee\u518d\u9664\u4ee5\u4e00\u4e2a\u5355\u4f4d\u65f6\u95f4<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"531\" src=\"2026-01-240chb4etbr0d.png\" width=\"941\" \/><\/p>\n<p>PID\u6709\u4e24\u79cd&#xff0c;\u4e00\u4e2a\u662f\u4f4d\u7f6e\u5f0f&#xff0c;\u4e00\u4e2a\u662f\u589e\u91cf\u5f0f\u00a0<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"740\" src=\"2026-01-244ad54mwmlk4.png\" width=\"1200\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"648\" src=\"2026-01-24n3fmgeigfpl.png\" width=\"1200\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"859\" src=\"2026-01-24z0poo01seur.png\" width=\"1200\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"444\" src=\"2026-01-24q1hc3d114iv.png\" width=\"874\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"755\" src=\"2026-01-2412uzoi4jgky.png\" width=\"1200\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"703\" src=\"2026-01-24ed44qrjnrat.png\" width=\"1079\" \/>\u00a0<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1165\" src=\"2026-01-241hjnxgrvxgc.png\" width=\"1200\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1028\" src=\"2026-01-24xdc0qxwn5pw.png\" width=\"1200\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"469\" src=\"2026-01-24tbm3c0z32vb.png\" width=\"775\" \/><\/p>\n<p>\u52a0\u901f\u5ea6\u53cd\u5e94\u7684\u662f\u4f4d\u7f6e\u7684\u53d8\u5316\u7387\u00a0<\/p>\n<h3>\u6ee4\u6ce2&#xff0c;\u6d4b\u901f\u7b97\u6cd5<\/h3>\n<p style=\"margin-left:0\"><span style=\"color:#333333\"><span style=\"background-color:#fcfcfc\">\u5173\u4e8e\u6ee4\u6ce2\u7b97\u6cd5<\/span><\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\"><span style=\"background-color:#fcfcfc\">\u65b9\u6848\u4e00&#xff1a; \u5361\u5c14\u66fc\u6ee4\u6ce2&#xff0c;\u53ef\u4ee5\u5728\u6709\u5927\u91cf\u5e72\u6270\u7684\u60c5\u51b5\u4e0b&#xff0c;\u4ece\u5df2\u77e5\u6d4b\u91cf\u65b9\u5dee\u7684\u5b58\u5728\u566a\u58f0\u7684\u6570\u636e\u4e2d\u9884\u6d4b\u4f30\u7b97\u51fa\u7cfb\u7edf\u7684\u6700\u4f18\u72b6\u6001<\/span><span style=\"background-color:#fcfcfc\">[3]<\/span><span style=\"background-color:#fcfcfc\">&#xff0c;\u5229\u7528\u5361\u5c14\u66fc\u6ee4\u6ce2\u53ef\u4ee5\u4ece<\/span><span style=\"background-color:#fcfcfc\">MPU6050<\/span><span style=\"background-color:#fcfcfc\">\u7684\u539f\u59cb\u6570\u636e\u4e2d\u5f97\u5230\u4e00\u7ec4\u63a5\u8fd1\u771f\u503c\u3001\u8f83\u4e3a\u51c6\u786e\u7684\u667a\u80fd\u8f66\u59ff\u6001\u6570\u636e\u3002<\/span><\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\"><span style=\"background-color:#fcfcfc\">\u65b9\u6848\u4e8c&#xff1a; \u7ecf\u5178\u6570\u5b57\u6ee4\u6ce2\u5668&#xff0c;\u4e3b\u8981\u5305\u62ec\u4f4e\u901a\u3001\u9ad8\u901a\u3001\u5e26\u901a\u6ee4\u6ce2\u5668&#xff0c;\u4e92\u8865\u6ee4\u6ce2\u5668\u5c5e\u4e8e\u5e26\u901a\u6ee4\u6ce2\u5668\u7684\u53d8\u79cd\u3002\u8ba1\u7b97\u89d2\u5ea6\u65f6&#xff0c;\u4e00\u822c\u901a\u8fc7\u89d2\u52a0\u901f\u5ea6\u548c\u89d2\u901f\u5ea6\u4e24\u79cd\u65b9\u5f0f\u8ba1\u7b97\u5f97\u5230\u89d2\u5ea6&#xff0c;\u56e0\u4e3a\u4e24\u79cd\u89d2\u5ea6\u7684\u5f97\u51fa\u65b9\u5f0f\u4e0d\u540c&#xff0c;\u5728\u878d\u5408\u539f\u59cb\u6570\u636e\u65f6\u9700\u8981\u4e00\u4e2a\u878d\u5408\u7cfb\u6570<\/span><span style=\"background-color:#fcfcfc\">[4]<\/span><span style=\"background-color:#fcfcfc\">\u3002\u5728\u5c06\u4e24\u79cd\u65b9\u5f0f\u5f97\u5230\u7684\u89d2\u5ea6\u8fdb\u884c\u4e92\u8865\u6ee4\u6ce2\u540e\u5373\u53ef\u5f97\u5230\u4e00\u4e2a\u53cd\u5e94\u8fc5\u901f\u3001\u89d2\u5ea6\u8ddf\u8e2a\u8f83\u4e3a\u51c6\u786e\u7684\u59ff\u6001\u6570\u636e\u3002<\/span><\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\"><span style=\"background-color:#fcfcfc\">\u5728\u8fdb\u884c\u4e24\u79cd\u65b9\u6848\u7684\u5bf9\u6bd4\u9009\u62e9\u4e2d&#xff0c;\u53d1\u73b0<\/span><span style=\"background-color:#fcfcfc\">MPU6050<\/span><span style=\"background-color:#fcfcfc\">\u82af\u7247\u5185\u90e8\u81ea\u5e26\u8fd0\u52a8\u6570\u636e\u5904\u7406\u8fd0\u7b97\u5355\u5143&#xff08;<\/span><span style=\"background-color:#fcfcfc\">DMP<\/span><span style=\"background-color:#fcfcfc\">&#xff09;&#xff0c;\u901a\u8fc7<\/span><span style=\"background-color:#fcfcfc\">DMP<\/span><span style=\"background-color:#fcfcfc\">\u53ef\u4ee5\u76f4\u63a5\u8f93\u51fa\u82af\u7247\u7684\u59ff\u6001\u89d2&#xff0c;\u5305\u62ec\u4fef\u4ef0\u89d2\u3001\u504f\u822a\u89d2\u548c\u6eda\u8f6c\u89d2&#xff0c;\u800c\u4fef\u4ef0\u89d2\u5373\u82af\u7247\u6240\u5728\u5e73\u9762\u4e0e\u6c34\u5e73\u9762\u7684\u5939\u89d2&#xff0c;\u4e5f\u5c31\u662f\u4e0a\u6587\u63d0\u5230\u7684\u89d2\u5ea6\u503c\u3002\u8fd9\u6837&#xff0c;\u901a\u8fc7\u4f7f\u7528<\/span><span style=\"background-color:#fcfcfc\">MPU6050<\/span><span style=\"background-color:#fcfcfc\">\u7684<\/span><span style=\"background-color:#fcfcfc\">DMP<\/span><span style=\"background-color:#fcfcfc\">\u65e2\u53ef\u4ee5\u5f97\u5230\u4e00\u4e2a\u8f83\u4e3a\u51c6\u786e\u7684\u89d2\u5ea6\u503c&#xff0c;\u53c8\u53ef\u4ee5\u51cf\u8f7b\u5fae\u5904\u7406\u5668\u7684\u8fd0\u7b97\u8d1f\u62c5&#xff0c;\u4f46\u4e3a\u4e86\u4f7f\u6700\u540e\u7684\u6570\u636e\u66f4\u63a5\u8fd1\u771f\u503c&#xff0c;\u5728\u901f\u5ea6\u63a7\u5236\u4e0a\u4ecd\u7136\u4f7f\u7528\u4e86\u4f4e\u901a\u6ee4\u6ce2\u7b97\u6cd5\u3002\u6700\u540e\u91c7\u7528\u7684\u65b9\u6848\u662f\u5728\u65b9\u6848\u4e8c\u7684\u57fa\u7840\u4e0a\u8c03\u7528\u4e86<\/span><span style=\"background-color:#fcfcfc\">MPU6050<\/span><span style=\"background-color:#fcfcfc\">\u7684<\/span><span style=\"background-color:#fcfcfc\">DMP<\/span><span style=\"background-color:#fcfcfc\">&#xff0c;\u867d\u7136\u7a0b\u5e8f\u4e0a\u8981\u79fb\u690d\u5927\u91cf\u7684<\/span><span style=\"background-color:#fcfcfc\">MPU6050<\/span><span style=\"background-color:#fcfcfc\">\u7684\u56fa\u4ef6\u5e93&#xff0c;\u4f46\u6570\u636e\u66f4\u52a0\u51c6\u786e\u3002<\/span><\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\">\u00a0<\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\"><span style=\"background-color:#fcfcfc\">\u5173\u4e8e\u63a7\u5236\u7b97\u6cd5<\/span><\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\"><span style=\"background-color:#fcfcfc\">\u63a7\u5236\u7b97\u6cd5\u91c7\u7528\u7684\u662f\u4e45\u7ecf\u5de5\u4e1a\u73b0\u573a\u8003\u9a8c\u7684<\/span><span style=\"background-color:#fcfcfc\">PID<\/span><span style=\"background-color:#fcfcfc\">\u7b97\u6cd5<\/span><span style=\"background-color:#fcfcfc\">[5]<\/span><span style=\"background-color:#fcfcfc\">&#xff0c;\u5176\u63a7\u5236\u7b97\u6cd5\u8f83\u4e3a\u7b80\u5355\u4f46\u63a7\u5236\u6027\u80fd\u6bd4\u8f83\u53ef\u9760\u7a33\u5b9a\u3001\u9c81\u68d2\u6027\u8f83\u5f3a\u3001\u53c2\u6570\u6574\u5b9a\u7684\u65b9\u6848\u8f83\u4e3a\u6210\u719f\u5e76\u4e14\u65e0\u9700\u5efa\u7acb\u6570\u5b66\u6a21\u578b&#xff0c;\u56e0\u6b64\u4e3a\u4e86\u5b9e\u73b0\u667a\u80fd\u8f66\u7684\u81ea\u4e3b\u5e73\u8861&#xff0c;\u63a7\u5236\u7b97\u6cd5\u91c7\u7528\u7684\u662f<\/span><span style=\"background-color:#fcfcfc\">PID<\/span><span style=\"background-color:#fcfcfc\">\u7b97\u6cd5&#xff0c;\u6d89\u53ca\u5230\u76f4\u7acb<\/span><span style=\"background-color:#fcfcfc\">PID<\/span><span style=\"background-color:#fcfcfc\">\u3001\u901f\u5ea6<\/span><span style=\"background-color:#fcfcfc\">PID<\/span><span style=\"background-color:#fcfcfc\">\u548c\u8f6c\u5411<\/span><span style=\"background-color:#fcfcfc\">PID[6]<\/span><span style=\"background-color:#fcfcfc\">\u3002<\/span><\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\">\u00a0<\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\"><span style=\"background-color:#fcfcfc\">\u5173\u4e8e\u6d4b\u901f\u7b97\u6cd5<\/span><\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\"><span style=\"background-color:#fcfcfc\">\u65b9\u6848\u4e00&#xff1a;\u4f4d\u7f6e\u5dee\u5206\u6cd5&#xff08;\u5373<\/span><span style=\"background-color:#fcfcfc\">M<\/span><span style=\"background-color:#fcfcfc\">\u6cd5&#xff09;&#xff0c;\u6d4b\u91cf\u89c4\u5b9a\u65f6\u95f4\u5185\u9f7f\u8f6e\u8f6c\u8fc7\u7684\u89d2\u5ea6\u503c<\/span><\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\"><span style=\"background-color:#fcfcfc\">\u65b9\u6848\u4e8c&#xff1a;\u5b9a\u89d2\u6d4b\u65f6\u6cd5&#xff08;\u5373<\/span><span style=\"background-color:#fcfcfc\">T<\/span><span style=\"background-color:#fcfcfc\">\u6cd5&#xff09;&#xff0c;\u6d4b\u91cf\u9f7f\u8f6e\u8f6c\u8fc7\u56fa\u5b9a\u89d2\u5ea6\u6240\u7528\u7684\u65f6\u95f4<\/span><\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\"><span style=\"background-color:#fcfcfc\">M<\/span><span style=\"background-color:#fcfcfc\">\u6cd5\u7684\u7a0b\u5e8f\u7f16\u5199\u7b80\u5355&#xff0c;\u867d\u7136\u6d4b\u91cf\u4f4e\u901f\u8109\u51b2\u65f6\u53ef\u80fd\u4f1a\u6709\u4e00\u4e9b\u8bef\u5dee&#xff0c;\u4f46\u662f\u6d4b\u91cf\u9ad8\u901f\u65f6\u5e73\u7a33\u6027\u548c\u7cbe\u5ea6\u90fd\u8f83\u9ad8&#xff1b;<\/span><span style=\"background-color:#fcfcfc\">T<\/span><span style=\"background-color:#fcfcfc\">\u6cd5\u4e00\u822c\u662f\u6d4b\u91cf\u4e24\u4e2a\u8109\u51b2\u4e4b\u95f4\u7684\u65f6\u95f4\u95f4\u9694\u786e\u5b9a\u88ab\u6d4b\u901f\u5ea6&#xff0c;\u9002\u5408\u6d4b\u91cf\u4f4e\u901f\u60c5\u51b5&#xff0c;\u4f46\u8f66\u8f6e\u8f6c\u4e00\u5708\u4f1a\u4ea7\u751f\u51e0\u5341\u4e0a\u767e\u4e2a\u8109\u51b2&#xff0c;\u4f7f\u7528<\/span><span style=\"background-color:#fcfcfc\">T<\/span><span style=\"background-color:#fcfcfc\">\u6cd5\u4e0d\u592a\u65b9\u4fbf&#xff0c;\u91c7\u7528\u65b9\u6848\u4e00\u3002<\/span><\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\">\u00a0<\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\"><span style=\"background-color:#fcfcfc\">3\u00a0 <\/span><span style=\"background-color:#fcfcfc\">\u7cfb\u7edf\u7684\u786c\u4ef6\u8bbe\u8ba1\u53ca\u7cfb\u7edf\u6d41\u7a0b<\/span><\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\"><span style=\"background-color:#fcfcfc\">3.1<\/span><span style=\"background-color:#fcfcfc\"> \u5355\u7247\u673a\u63a7\u5236\u7535\u8def<\/span><\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\"><span style=\"background-color:#fcfcfc\">ARM<\/span><span style=\"background-color:#fcfcfc\">\u516c\u53f8\u63a8\u51fa\u7684 <\/span><span style=\"background-color:#fcfcfc\">Cortex-M <\/span><span style=\"background-color:#fcfcfc\">\u7cfb\u5217\u5fae\u5904\u7406\u5668\u662f\u5e02\u573a\u4e0a\u8f83\u4e3a\u4e3b\u6d41\u7684\u82af\u7247&#xff0c;\u7ecf\u591a\u65b9\u6bd4\u8f83&#xff0c;\u672c\u5b9e\u9a8c\u5e73\u53f0\u9009\u62e9 <\/span><span style=\"background-color:#fcfcfc\">STM32F103C8T6<\/span><span style=\"background-color:#fcfcfc\">\u4f5c\u4e3a\u6838\u5fc3\u82af\u7247&#xff0c;\u8be5\u82af\u7247\u662f\u65b0\u4e00\u4ee3 <\/span><span style=\"background-color:#fcfcfc\">Cortex-M3<\/span><span style=\"background-color:#fcfcfc\">\u5185\u6838\u7684\u5fae\u5904\u7406\u5668&#xff0c;\u5177\u6709 <\/span><span style=\"background-color:#fcfcfc\">72 MHz <\/span><span style=\"background-color:#fcfcfc\">\u4e3b\u9891\u3001<\/span><span style=\"background-color:#fcfcfc\">20K<\/span><span style=\"background-color:#fcfcfc\">\u5b57\u8282<\/span><span style=\"background-color:#fcfcfc\">SRAM<\/span><span style=\"background-color:#fcfcfc\">\u3001<\/span><span style=\"background-color:#fcfcfc\">128K<\/span><span style=\"background-color:#fcfcfc\">\u5b57\u8282\u95ea\u5b58&#xff0c;\u63d0\u4f9b\u4e24\u4e2a<\/span><span style=\"background-color:#fcfcfc\">12<\/span><span style=\"background-color:#fcfcfc\">\u4f4d<\/span><span style=\"background-color:#fcfcfc\">adc(16<\/span><span style=\"background-color:#fcfcfc\">\u901a\u9053<\/span><span style=\"background-color:#fcfcfc\">)<\/span><span style=\"background-color:#fcfcfc\">&#xff0c;\u4e09\u4e2a\u901a\u7528<\/span><span style=\"background-color:#fcfcfc\">16<\/span><span style=\"background-color:#fcfcfc\">\u4f4d\u5b9a\u65f6\u5668\u52a0\u4e0a\u4e00\u4e2a<\/span><span style=\"background-color:#fcfcfc\">PWM<\/span><span style=\"background-color:#fcfcfc\">\u5b9a\u65f6\u5668&#xff0c;\u591a\u8fbe\u4e24\u4e2a<\/span><span style=\"background-color:#fcfcfc\">I2Cs<\/span><span style=\"background-color:#fcfcfc\">\u548c<\/span><span style=\"background-color:#fcfcfc\">SPIs<\/span><span style=\"background-color:#fcfcfc\">&#xff0c;\u4e09\u4e2a<\/span><span style=\"background-color:#fcfcfc\">usart[11]<\/span><span style=\"background-color:#fcfcfc\">&#xff0c;\u4e00\u4e2a<\/span><span style=\"background-color:#fcfcfc\">USB,<\/span><span style=\"background-color:#fcfcfc\">\u4e00\u4e2a<\/span><span style=\"background-color:#fcfcfc\">CAN, 2<\/span><span style=\"background-color:#fcfcfc\">\u4e2a\u770b\u95e8\u72d7\u5b9a\u65f6\u5668<\/span><span style=\"background-color:#fcfcfc\">, CRC<\/span><span style=\"background-color:#fcfcfc\">\u8ba1\u7b97\u5355\u5143&#xff0c;<\/span><span style=\"background-color:#fcfcfc\">7<\/span><span style=\"background-color:#fcfcfc\">\u901a\u9053<\/span><span style=\"background-color:#fcfcfc\">DMA<\/span><span style=\"background-color:#fcfcfc\">\u63a7\u5236\u5668\u3002\u800c\u4e14\u6709\u5b98\u65b9\u63d0\u4f9b\u7684\u4e13\u95e8\u7684\u5f00\u53d1\u5e93&#xff0c;\u64cd\u4f5c\u8c03\u8bd5\u66f4\u52a0\u65b9\u4fbf\u7b80\u5355<\/span><span style=\"background-color:#fcfcfc\">[12] <\/span><span style=\"background-color:#fcfcfc\">\u3002\u5916\u56f4\u7535\u8def\u6a21\u5757\u90e8\u5206\u56f4\u7ed5\u4e3b\u82af\u7247\u8bbe\u8ba1&#xff0c;\u4e3b\u8981\u7ec4\u6210\u53ca\u529f\u80fd\u5982\u4e0b&#xff1a;<\/span><\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\">\u00a0<\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\"><span style=\"background-color:#fcfcfc\">4.1.2<\/span><span style=\"background-color:#fcfcfc\"> \u7b97\u6cd5\u4ecb\u7ecd<\/span><\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\"><span style=\"background-color:#fcfcfc\">\u4f4e\u901a\u6ee4\u6ce2\u5668\u7b97\u6cd5&#xff1a;<\/span><span style=\"background-color:#fcfcfc\">Encoder_Least &#061;(speed_left&#043;speed_right)-0;\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <span style=\"background-color:#fcfcfc\">Encoder *&#061; 0.8;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\">\u00a0<\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <span style=\"background-color:#fcfcfc\">Encoder &#043;&#061; Encoder_Least*0.2;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\">\u00a0<\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\"><span style=\"background-color:#fcfcfc\">\u4e0a\u5f0f\u4e2d<\/span><span style=\"background-color:#fcfcfc\">Encoder_Least<\/span><span style=\"background-color:#fcfcfc\">\u662f\u6700\u65b0\u901f\u5ea6\u504f\u5dee&#xff1b; \u7b2c<\/span><span style=\"background-color:#fcfcfc\">2<\/span><span style=\"background-color:#fcfcfc\">\u3001<\/span><span style=\"background-color:#fcfcfc\">3<\/span><span style=\"background-color:#fcfcfc\">\u4e2a\u7a0b\u5e8f\u53ef\u4ee5\u7406\u89e3\u4e3a<\/span><span style=\"background-color:#fcfcfc\">Y(n)&#061;<\/span><span style=\"background-color:#fcfcfc\">\u03b1<\/span><span style=\"background-color:#fcfcfc\">X(n)&#043;(1-<\/span><span style=\"background-color:#fcfcfc\">\u03b1<\/span><span style=\"background-color:#fcfcfc\">)Y(n-1)<\/span><span style=\"background-color:#fcfcfc\">&#xff0c;\u5176\u4e2d<\/span><span style=\"background-color:#fcfcfc\">X(n)<\/span><span style=\"background-color:#fcfcfc\">\u7b49\u540c\u4e8e<\/span><span style=\"background-color:#fcfcfc\">Encoder_Least<\/span><span style=\"background-color:#fcfcfc\">&#xff0c;\u4ee3\u8868\u672c\u6b21\u91c7\u6837\u503c&#xff1b;<\/span><span style=\"background-color:#fcfcfc\">Y(n-1)<\/span><span style=\"background-color:#fcfcfc\">\u7b49\u540c\u4e8e<\/span><span style=\"background-color:#fcfcfc\">Encoder<\/span><span style=\"background-color:#fcfcfc\">&#xff0c;\u4ee3\u8868\u4e0a\u6b21\u6ee4\u6ce2\u8f93\u51fa\u503c&#xff1b;\u03b1\u662f\u6ee4\u6ce2\u7cfb\u6570&#xff0c;\u5728\u4e0a\u5f0f\u4e2d\u662f<\/span><span style=\"background-color:#fcfcfc\">0.2<\/span><span style=\"background-color:#fcfcfc\">\u3002<\/span><\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\">\u00a0<\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\"><span style=\"background-color:#fcfcfc\">\u4e00\u9636\u4e92\u8865\u6ee4\u6ce2\u7b97\u6cd5&#xff1a;<\/span><span style=\"background-color:#fcfcfc\">g_fAngle &#061; 0.02 * Angle_ax &#043; (0.98) * (g_fAngle &#043; GY * dt); <\/span><\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\"><span style=\"background-color:#fcfcfc\">\u4e0a\u5f0f\u4e2d\u5de6\u8fb9\u7684<\/span><span style=\"background-color:#fcfcfc\">g_fAngle<\/span><span style=\"background-color:#fcfcfc\">\u4e3a\u5b9e\u9645\u5f97\u5230\u7684\u89d2\u5ea6&#xff1b;<\/span><span style=\"background-color:#fcfcfc\">Angle_ax<\/span><span style=\"background-color:#fcfcfc\">\u4e3a\u89d2\u52a0\u901f\u5ea6\u6362\u7b97\u540e\u7684\u89d2\u5ea6\u503c&#xff0c;\u56e0\u4e3a\u89d2\u52a0\u901f\u5ea6\u53d7\u8f66\u4f53\u9707\u8361\u7b49\u56e0\u7d20\u4f1a\u4ea7\u751f\u9ad8\u9891\u566a\u58f0&#xff0c;\u6240\u4ee5\u5bf9\u5176\u8fdb\u884c\u4f4e\u901a\u6ee4\u6ce2&#xff0c;\u6ee4\u9664\u9ad8\u9891\u4fe1\u53f7&#xff0c;\u56e0\u6b64\u878d\u5408\u7cfb\u6570\u8f83\u5c0f&#xff1b;\u53f3\u8fb9\u7684<\/span><span style=\"background-color:#fcfcfc\">g_fAngle<\/span><span style=\"background-color:#fcfcfc\">\u53ef\u4ee5\u7406\u89e3\u4e3a\u4e0a\u4e00\u6b21\u7684\u89d2\u5ea6&#xff1b;<\/span><span style=\"background-color:#fcfcfc\">GY<\/span><span style=\"background-color:#fcfcfc\">\u662f\u89d2\u901f\u5ea6&#xff0c;<\/span><span style=\"background-color:#fcfcfc\">dt<\/span><span style=\"background-color:#fcfcfc\">\u662f\u65f6\u95f4&#xff0c;<\/span><span style=\"background-color:#fcfcfc\">GY *<\/span><span style=\"background-color:#fcfcfc\">\u8ba1\u7b97<\/span><span style=\"background-color:#fcfcfc\">dt<\/span><span style=\"background-color:#fcfcfc\">\u65f6\u95f4\u6bb5\u5185\u901a\u8fc7\u7684\u89d2\u5ea6&#xff0c;\u901a\u8fc7\u5bf9\u89d2\u5ea6\u7684\u4e0d\u65ad\u79ef\u5206\u5f97\u5230\u4e00\u4e2a\u8f83\u4e3a\u51c6\u786e\u7684\u89d2\u5ea6&#xff0c;\u53ef\u4fe1\u5ea6\u548c\u878d\u5408\u7cfb\u6570\u8f83\u5927&#xff0c;\u6709\u70b9\u7c7b\u4f3c\u9ad8\u901a\u6ee4\u6ce2\u3002<\/span><\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\">\u00a0<\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\"><span style=\"background-color:#fcfcfc\">PID<\/span><span style=\"background-color:#fcfcfc\">\u7b97\u6cd5&#xff1a;<\/span><span style=\"background-color:#fcfcfc\">balance&#061;CarAngle.Kp*Bias&#043;CarAngle.Kd*Gyro<\/span><span style=\"background-color:#fcfcfc\">&#xff1b;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <span style=\"background-color:#fcfcfc\">Velocity&#061;Encoder*CarSpeed.Kp&#043;Encoder_Integral*CarSpeed.Ki;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\">\u00a0<\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <span style=\"background-color:#fcfcfc\">Turn &#061; -Turn_Target * Kp &#8211; gyro * Kd;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\">\u00a0<\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\"><span style=\"background-color:#fcfcfc\">\u4e0a\u9762\u7b2c<\/span><span style=\"background-color:#fcfcfc\">1<\/span><span style=\"background-color:#fcfcfc\">\u4e2a\u7a0b\u5e8f\u662f\u76f4\u7acb<\/span><span style=\"background-color:#fcfcfc\">PD<\/span><span style=\"background-color:#fcfcfc\">\u7b97\u6cd5&#xff0c;\u5373\u89d2\u5ea6\u73af\u63a7\u5236\u7b97\u6cd5&#xff0c;\u5c5e\u4e8e\u4f4d\u7f6e<\/span><span style=\"background-color:#fcfcfc\">PD<\/span><span style=\"background-color:#fcfcfc\">\u7b97\u6cd5<\/span><span style=\"background-color:#fcfcfc\">[15]<\/span><span style=\"background-color:#fcfcfc\">\u3002\u901a\u8fc7\u6b64\u7b97\u6cd5\u53ef\u4ee5\u5b9e\u73b0\u667a\u80fd\u8f66\u77ed\u65f6\u95f4\u7684\u76f4\u7acb\u5e73\u8861\u72b6\u6001&#xff0c;\u5176\u4e2d<\/span><span style=\"background-color:#fcfcfc\">Bias<\/span><span style=\"background-color:#fcfcfc\">\u662f\u5c0f\u8f66\u504f\u79bb\u6c34\u5e73\u9762\u7684\u89d2\u5ea6&#xff0c;\u6570\u503c\u4e3a<\/span><span style=\"background-color:#fcfcfc\">0<\/span><span style=\"background-color:#fcfcfc\">\u65f6\u5373\u4e0e\u5730\u9762\u5e73\u884c&#xff1b;<\/span><span style=\"background-color:#fcfcfc\">Gyro<\/span><span style=\"background-color:#fcfcfc\">\u662f\u89d2\u901f\u5ea6\u503c&#xff0c;\u901a\u8fc7\u8c03\u8282<\/span><span style=\"background-color:#fcfcfc\">Kd<\/span><span style=\"background-color:#fcfcfc\">\u53ef\u4ee5\u51cf\u7f13\u5c0f\u8f66\u9707\u8361&#xff1b;\u5177\u4f53\u8c03\u8282\u6b65\u9aa4\u5982\u56fe<\/span><span style=\"background-color:#fcfcfc\">4-2<\/span><span style=\"background-color:#fcfcfc\">&#xff0c;\u5f53\u5c0f\u8f66\u5411\u524d\u503e\u5012\u65f6&#xff0c;\u8f66\u8f6e\u8ddf\u968f\u5c0f\u8f66\u524d\u8fdb\u7684\u65b9\u5411&#xff0c;\u4f7f\u5176\u6709\u4e00\u4e2a\u5411\u540e\u7684\u529b&#xff0c;\u53cd\u4e4b\u4ea6\u7136&#xff0c;\u8c03\u53c2\u6570\u65f6\u7684\u6700\u597d\u73b0\u8c61\u662f\u5c0f\u8f66\u5bf9\u89d2\u5ea6\u53d8\u5316\u53cd\u5e94\u654f\u611f\u4e14\u6ca1\u6709\u9707\u8361\u3002<\/span><\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\"><span style=\"background-color:#fcfcfc\">\u56fe<\/span><span style=\"background-color:#fcfcfc\">4-2<\/span><span style=\"background-color:#fcfcfc\">\u00a0 \u76f4\u7acb\u5c0f\u8f66\u8fd0\u52a8\u6a21\u578b<\/span><\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\"><span style=\"background-color:#fcfcfc\">\u7b2c<\/span><span style=\"background-color:#fcfcfc\">2<\/span><span style=\"background-color:#fcfcfc\">\u4e2a\u7a0b\u5e8f\u662f\u901f\u5ea6<\/span><span style=\"background-color:#fcfcfc\">PI<\/span><span style=\"background-color:#fcfcfc\">\u63a7\u5236&#xff0c;<\/span><span style=\"background-color:#fcfcfc\">Encoder<\/span><span style=\"background-color:#fcfcfc\">\u662f\u7ecf\u8fc7\u4f4e\u901a\u6ee4\u6ce2\u8f93\u51fa\u7684\u5f53\u524d\u901f\u5ea6\u503c&#xff0c;\u56e0\u4e3a\u901f\u5ea6\u63a7\u5236\u548c\u76f4\u7acb\u63a7\u5236\u8f93\u51fa\u503c\u662f\u8981\u52a0\u5230\u4e00\u8d77\u7684&#xff0c;\u4f4e\u901a\u6ee4\u6ce2\u53ef\u4ee5\u51cf\u7f13\u901f\u5ea6\u5dee\u503c\u5bf9\u76f4\u7acb\u63a7\u5236\u7684\u5e72\u6270&#xff1b;<\/span><span style=\"background-color:#fcfcfc\">Encoder_Integral<\/span><span style=\"background-color:#fcfcfc\">\u662f\u5bf9\u901f\u5ea6\u7684\u79ef\u5206&#xff0c;\u5373\u4f4d\u79fb&#xff0c;\u79ef\u5206\u63a7\u5236\u7684\u662f\u901f\u5ea6\u7684\u9759\u5dee&#xff0c;\u5bf9<\/span><span style=\"background-color:#fcfcfc\">Encoder_Integra<\/span><span style=\"background-color:#fcfcfc\">\u7684\u9650\u5e45\u5c31\u662f\u5bf9\u901f\u5ea6\u7684\u9650\u5e45&#xff1b;\u76f4\u7acb\u73af\u548c\u901f\u5ea6\u73af\u4e00\u8d77\u8c03\u8bd5&#xff0c;\u5373\u53ef\u5b9e\u73b0\u5c0f\u8f66\u7684\u957f\u65f6\u95f4\u76f4\u7acb<\/span><span style=\"background-color:#fcfcfc\">[16]<\/span><span style=\"background-color:#fcfcfc\">&#xff0c;\u76f4\u7acb\u73af\u662f\u8d1f\u53cd\u9988&#xff0c;\u901f\u5ea6\u73af\u662f\u6b63\u53cd\u9988&#xff0c;\u5373\u5c0f\u8f66\u56e0\u4e3a\u76f4\u7acb\u73af\u539f\u56e0\u5411\u4e00\u4e2a\u65b9\u5411\u52a0\u901f\u65f6&#xff0c;\u901f\u5ea6\u73af\u7684\u4f5c\u7528\u662f\u4ea7\u751f\u4e00\u4e2a\u540c\u65b9\u5411\u66f4\u5feb\u7684\u901f\u5ea6\u3002<\/span><\/span><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\"><span style=\"background-color:#fcfcfc\">\u7b2c<\/span><span style=\"background-color:#fcfcfc\">3<\/span><span style=\"background-color:#fcfcfc\">\u4e2a\u7a0b\u5e8f\u662f\u8f6c\u5411<\/span><span style=\"background-color:#fcfcfc\">PD<\/span><span style=\"background-color:#fcfcfc\">\u7b97\u6cd5&#xff0c;<\/span><span style=\"background-color:#fcfcfc\">Turn_Target<\/span><span style=\"background-color:#fcfcfc\">\u662f\u8f6c\u5411\u901f\u5ea6\u503c&#xff0c;\u6570\u503c\u8f83\u5927\u65f6\u8f6c\u5411\u901f\u5ea6\u5757&#xff0c;\u53cd\u4e4b\u6162&#xff0c;\u6570\u503c\u5927\u5c0f\u548c\u8f6c\u5411\u524d\u5c0f\u8f66\u7684\u901f\u5ea6\u6709\u5173&#xff0c;\u5373\u5c0f\u8f66\u7684\u65cb\u8f6c\u901f\u5ea6\u53ef\u4ee5\u8ddf\u968f\u5b9e\u65f6\u901f\u5ea6&#xff0c;\u589e\u52a0\u5c0f\u8f66\u7684\u9002\u5e94\u6027&#xff1b;<\/span><span style=\"background-color:#fcfcfc\">gyro<\/span><span style=\"background-color:#fcfcfc\">\u662f\u89d2\u901f\u5ea6\u503c&#xff0c;<\/span><span style=\"background-color:#fcfcfc\">gyro * Kd<\/span><span style=\"background-color:#fcfcfc\">\u53ef\u4ee5\u51cf\u5c0f\u5c0f\u8f66\u8f6c\u5411\u65f6\u7684\u9707\u8361&#xff1b;\u636e\u4f53\u63a7\u5236\u65b9\u6cd5\u5c31\u662f\u5c06\u5c0f\u8f66\u7684\u5de6\u8f6e<\/span><span style=\"background-color:#fcfcfc\">PWM<\/span><span style=\"background-color:#fcfcfc\">\u8f93\u51fa\u503c\u51cf\u53bb\u8f6c\u5411<\/span><span style=\"background-color:#fcfcfc\">PD<\/span><span style=\"background-color:#fcfcfc\">\u8f93\u51fa\u503c&#xff0c;\u5c0f\u8f66\u7684\u53f3\u8f6e<\/span><span style=\"background-color:#fcfcfc\">PWM<\/span><span style=\"background-color:#fcfcfc\">\u8f93\u51fa\u503c\u52a0\u4e0a\u8f6c\u5411<\/span><span style=\"background-color:#fcfcfc\">PD<\/span><span style=\"background-color:#fcfcfc\">\u8f93\u51fa\u503c&#xff0c;\u5229\u7528\u5c0f\u8f66\u8f66\u8f6e\u7684\u5dee\u901f\u8fdb\u884c\u8f6c\u5411\u3002<\/span><\/span><\/p>\n<h3 style=\"margin-left:0px\"><span style=\"color:#333333\"><span style=\"background-color:#fcfcfc\">\u4e32\u53e3\u901a\u4fe1<\/span><\/span><\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"678\" src=\"2026-01-24xjxqwp1o5ee.png\" width=\"1200\" \/><\/p>\n<p style=\"margin-left:0\">\n<p style=\"margin-left:0\">\u65f6\u949f\u6807\u51c6\u662f\u4ec0\u4e48<\/p>\n<p style=\"margin-left:0\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"495\" src=\"2026-01-24ws0jbeladcy.png\" width=\"1183\" \/><\/p>\n<p style=\"margin-left:0\"><span style=\"color:#333333\">\u00a0<\/span><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"419\" src=\"2026-01-2444b4ckmimi1.png\" width=\"1200\" \/><\/p>\n<p style=\"margin-left:0\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"711\" src=\"2026-01-24ybskwalqayw.png\" width=\"1200\" \/><\/p>\n<p>\u00a0<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"623\" src=\"2026-01-244vt2amzxzyu.png\" width=\"1131\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"716\" src=\"2026-01-24akb1r2zrjis.png\" width=\"1200\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"725\" src=\"2026-01-245zgfhkrns2t.png\" width=\"1200\" \/>RI\u662f\u63a5\u53d7\u7684\u4e00\u4e2a\u6807\u5fd7\u4f4d<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"693\" src=\"2026-01-24erf1qvcgtv2.png\" width=\"1200\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"354\" src=\"2026-01-244abmxbg1q04.png\" width=\"1103\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"358\" src=\"2026-01-24wftlrs1zuod.png\" width=\"773\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"684\" src=\"2026-01-242roefw0pxel.png\" width=\"1156\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"309\" src=\"2026-01-24mx2lqkakwis.png\" width=\"1075\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"404\" src=\"2026-01-24hiegodhfyau.png\" width=\"1063\" \/>\u4e00\u4e2a\u662f\u63a5\u6536\u7684SBUF&#xff0c;\u4e00\u4e2a\u662f\u53d1\u9001\u7684SBUF<\/p>\n<h3>\u76f4\u6d41\u7535\u673a\u9a71\u52a8<\/h3>\n<p>   <img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"574\" src=\"2026-01-24yuy0blccvtu.png\" width=\"981\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"915\" src=\"2026-01-24a2l5baesoxp.png\" width=\"1200\" \/>\u00a0\u505c\u7535\u65f6\u7528\u6765\u5438\u6536\u5269\u4f59\u611f\u6027\u539f\u4ef6\u7535\u6d41\u7684\u4e8c\u6781\u7ba1<\/p>\n<h3>\u7f16\u7801\u5668<\/h3>\n<p style=\"margin-left:0\">PID&#xff0c;\u4f4d\u7f6e\u5f0fPID<\/p>\n<p style=\"margin-left:0\">\u76f4\u7acb\u73af&#xff0c;\u901f\u5ea6\u73af<\/p>\n<p style=\"margin-left:0\">\u8f6c\u5411\u73af&#xff0c;\u4e0d\u662f<\/p>\n<p style=\"margin-left:0\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"450\" src=\"2026-01-242qj1wq14i3u.png\" width=\"610\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"668\" src=\"2026-01-24px0r1tthmzz.png\" width=\"1200\" \/>\u00a0<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"615\" src=\"2026-01-24x31wzpnkryd.png\" width=\"1049\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"375\" src=\"2026-01-243p5j44rh2kr.png\" width=\"1200\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"551\" src=\"2026-01-244eewjalrf3s.png\" width=\"1200\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"513\" src=\"2026-01-241d2qek5m4vd.png\" width=\"1056\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"496\" src=\"2026-01-24zdhixofnxki.png\" width=\"1065\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"621\" src=\"2026-01-24i0eunz5t2eh.png\" width=\"934\" \/><\/p>\n<p>#include &#034;encoder.h&#034;\/\/\u7f16\u7801\u5668\u51fd\u6570<br \/>\n\/**************************************************************************<br \/>\n\u51fd\u6570\u529f\u80fd&#xff1a;\u603b\u4f53\u6765\u8bf4&#xff0c;\u6211\u4eec\u5148\u8981\u5f00\u542f\u603b\u7ebf\u65f6\u949f&#xff0c;\u7136\u540e\u7528\u4e09\u4e2a\u51fd\u6570&#xff0c;\u975e\u522b\u662f1.\u65f6\u949f\u521d\u59cb\u5316\u51fd\u65702.GPIO\u7aef\u53e3\u521d\u59cb\u5316\u51fd\u65703.\u914d\u7f6e\u8f93\u5165\u6355\u83b7\u51fd\u6570&#xff0c;\u4e5f\u5c31\u662f\u7f16\u7801\u5668\u76f8\u5173\u7684\u51fd\u6570<\/p>\n<p>**************************************************************************\/<br \/>\nvoid Encoder_Init_TIM2(void)\/\/\u7f16\u7801\u5668\u521d\u59cb\u5316\u51fd\u6570&#xff0c;\u5f62\u5f0f\u53c2\u6570\u5199void\u505a\u4e00\u4e2a\u5f3a\u8c03<br \/>\n{<br \/>\n  TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;  \/\/\u5b9a\u4e49\u4e00\u4e2a\u7ed3\u6784\u4f53\u53d8\u91cf\u6210\u5458<br \/>\n  TIM_ICInitTypeDef TIM_ICInitStructure;  \/\/\u5b9a\u4e49\u4e00\u4e2a\u7ed3\u6784\u4f53\u53d8\u91cf\u6210\u5458<br \/>\n  GPIO_InitTypeDef GPIO_InitStructure;     \/\/\u5b9a\u4e49\u4e00\u4e2a\u7ed3\u6784\u4f53\u53d8\u91cf\u6210\u5458<br \/>\n\/\/\/\/<br \/>\n  RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2, ENABLE);\/\/\u4f7f\u80fd\u5b9a\u65f6\u56682\u7684\u65f6\u949f&#xff0c;\u56e0\u4e3a\u5168\u90e8GPIO\u90fd\u662f\u6302\u8f7d\u5230APB2\u603b\u7ebf\u4e0a\u7684&#xff0c;\u8fd9\u662f\u5f00\u542f\u603b\u7ebf\u7684&#xff0c;\u901a\u7528\u5b9a\u65f6\u5668&#xff0c;\u6302\u8f7d\u5230HB1\u4e0a\u7684<br \/>\n  RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);\/\/\u4f7f\u80fdPB\u7aef\u53e3\u65f6\u949f<\/p>\n<p>  GPIO_InitStructure.GPIO_Pin &#061; GPIO_Pin_0|GPIO_Pin_1;\/\/\u7aef\u53e3\u914d\u7f6e<br \/>\n  GPIO_InitStructure.GPIO_Mode &#061; GPIO_Mode_IN_FLOATING; \/\/\u6d6e\u7a7a\u8f93\u5165<br \/>\n  GPIO_Init(GPIOA, &amp;GPIO_InitStructure);      \/\/\u6839\u636e\u8bbe\u5b9a\u53c2\u6570\u521d\u59cb\u5316GPIOA&#xff0c;\u6839\u636e\u8bbe\u5b9a\u53c2\u6570\u521d\u59cb\u5316GPIOA.8,\u5f15\u7528\u51fd\u6570&#xff0c;\u7b2c\u4e00\u4e2a\u662fGPIOc&#xff0c;\u521d\u59cb\u5316GPIOA\u5916\u8bbe&#xff0c;\u7b2c\u4e8c\u4e2a\u662f\u7ed3\u6784\u4f53\u53d8\u91cf\u540d<br \/>\n\/\/\u524d\u9762\u52a0\u4e0a\u53d6\u5730\u5740\u7684\u7b26\u53f7&#xff0c;\u8fd9\u91cc\u4f7f\u7528\u7684\u662f\u5730\u5740\u4f20\u9012<br \/>\n  \/\/\/\/\u4e0d\u914d\u7f6e\u901f\u5ea6\u662f\u56e0\u4e3a\u7f16\u7801\u5668\u662f\u8bfb\u53d6&#xff0c;\u4e0d\u662f\u8f93\u51fa&#xff0c;&#xff0c;&#xff0c;&#xff0c;&#xff0c;Note: TIM_TimeBaseStructInit \u8fd9\u4e2a\u7528\u4e8e\u521d\u59cb\u5316\u7ed3\u6784\u4f53<br \/>\n  TIM_TimeBaseStructInit(&amp;TIM_TimeBaseStructure);\/\/\u8fd9\u662f\u5bf9\u5b9a\u65f6\u5668\u8fdb\u884c\u521d\u59cb\u5316&#xff0c;Note: TIM_TimeBaseStructInit \u8fd9\u4e2a\u7528\u4e8e\u521d\u59cb\u5316\u7ed3\u6784\u4f53&#xff0c;\u6700\u597d\u52a0\u4e0a&#xff0c;\u9632\u6b62\u6709\u5176\u4ed6\u5f02\u5e38<br \/>\n  TIM_TimeBaseStructure.TIM_Prescaler &#061; 0x00; \/\/ 4.\u5206\u9891\u7cfb\u6570&#xff0c;\u9884\u5206\u9891\u5668&#xff0c;\u8fd9\u91cc\u5c31\u662f0&#xff0c;\u56e0\u4e3a\u4e0d\u5206\u9891<br \/>\n  TIM_TimeBaseStructure.TIM_Period &#061; 65535; \/\/3.\u8bbe\u5b9a\u8ba1\u6570\u5668\u81ea\u52a8\u91cd\u88c5\u503c&#xff0c; \/\/\u4e0d\u53ef\u5927\u4e8e65535 \u56e0\u4e3aF103\u7684\u5b9a\u65f6\u5668\u662f16\u4f4d\u7684\u3002<br \/>\n  TIM_TimeBaseStructure.TIM_ClockDivision &#061; TIM_CKD_DIV1;\/\/1.\u9009\u62e9\u65f6\u949f\u5206\u9891&#xff1a;\u4e0d\u5206\u9891<br \/>\n  TIM_TimeBaseStructure.TIM_CounterMode &#061; TIM_CounterMode_Up;\/\/\/\/2.TIM\u5411\u4e0a\u8ba1\u6570&#xff0c;\u8ba1\u6570\u6a21\u5f0f<br \/>\n  TIM_TimeBaseInit(TIM2, &amp;TIM_TimeBaseStructure);<br \/>\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<br \/>\n  TIM_EncoderInterfaceConfig(TIM2, TIM_EncoderMode_TI12, TIM_ICPolarity_Rising, TIM_ICPolarity_Rising);\/\/\u4f7f\u7528\u7f16\u7801\u5668\u6a21\u5f0f3\u3001\u3001\u8fd9\u662f\u7f16\u7801\u5668\u7279\u6709\u7684&#xff0c;\u7f16\u7801\u5668\u914d\u7f6e\u51fd\u6570&#xff0c;\u7b2c\u4e00\u4e2a\u53c2\u6570\u662f\u5b9a\u65f6\u5668&#xff0c;\u7b2c\u4e8c\u4e2a\u53c2\u6570\u662f\u6a21\u5f0f3&#xff0c;\u4e3a\u4ec0\u4e48\u662f\u6a21\u5f0f3\u554a&#xff0c;\u7b2c\u4e09\u4e2a\u53c2\u6570\u662f\u4e0a\u5347\u6cbf&#xff0c;\u4e24\u4e2a\u90fd\u662f\u4e0a\u5347\u6cbf<br \/>\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\u600e\u4e48\u8f93\u5165\u6355\u83b7\u521d\u59cb\u5316\u5c31\u8bbe\u7f6e\u4e86\u4e00\u4e2a\u6ee4\u6ce2\u7cfb\u6570&#xff0c;\u8fb9\u6cbf\u68c0\u6d4b\u548c\u6355\u83b7\u901a\u9053\u90fd\u6ca1\u8bbe\u7f6e\u5462&#xff1f;<br \/>\n  TIM_ICStructInit(&amp;TIM_ICInitStructure);<br \/>\n  TIM_ICInitStructure.TIM_ICFilter &#061; 10;\/\/\u8fd9\u91cc\u53ea\u6709\u4e00\u4e2a\u6ee4\u6ce2\u5668&#xff0c;\u6ee4\u6ce2\u5668\u662f\u8bbe\u7f6e10\u5c31\u53ef\u4ee5\u4e86&#xff0c;ic\u53ea\u6709\u6ee4\u6ce2\u5668\u6709\u6548&#xff0c;\u5176\u4ed6\u90fd\u7528\u4e0d\u4e0a<br \/>\n  \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<br \/>\n  TIM_ICInit(TIM2, &amp;TIM_ICInitStructure);<br \/>\n  TIM_ClearFlag(TIM2, TIM_FLAG_Update);\/\/\u6e05\u9664TIM\u7684\u66f4\u65b0\u6807\u5fd7\u4f4d&#xff0c;\u8ba1\u6570\u66f4\u65b0\u4e4b\u540e\u4f1a\u62c9\u9ad8&#xff0c;\u7136\u540e\u8981\u6e05\u9664\u4e00\u4e0b<br \/>\n  TIM_ITConfig(TIM2, TIM_IT_Update, ENABLE);\/\/\u914d\u7f6e\u4ec0\u4e48\u4e2d\u65ad\u7c7b\u578b&#xff0c;\u5f53\u7136\u662f\u6ea2\u51fa\u66f4\u65b0<br \/>\n  \/\/Reset counter<br \/>\n  TIM_SetCounter(TIM2,0);\/\/\u628a0\u7ed9\u8fd9\u4e2a\u5b9a\u65f6\u5668<br \/>\n  TIM_Cmd(TIM2, ENABLE); \/\/\u5f00\u5b9a\u65f6\u5668<br \/>\n}<\/p>\n<p>\/**************************************************************************<br \/>\n\u51fd\u6570\u529f\u80fd&#xff1a;\u628aTIM4\u521d\u59cb\u5316\u4e3a\u7f16\u7801\u5668\u63a5\u53e3\u6a21\u5f0f<br \/>\n\u5165\u53e3\u53c2\u6570&#xff1a;\u65e0<br \/>\n\u8fd4\u56de  \u503c&#xff1a;\u65e0<br \/>\n**************************************************************************\/<br \/>\nvoid Encoder_Init_TIM4(void)<br \/>\n{<br \/>\nTIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;<br \/>\n  TIM_ICInitTypeDef TIM_ICInitStructure;<br \/>\n  GPIO_InitTypeDef GPIO_InitStructure;<br \/>\n  RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM4, ENABLE);\/\/\u4f7f\u80fd\u5b9a\u65f6\u56684\u7684\u65f6\u949f<br \/>\n  RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);\/\/\u4f7f\u80fdPB\u7aef\u53e3\u65f6\u949f<\/p>\n<p>  GPIO_InitStructure.GPIO_Pin &#061; GPIO_Pin_6|GPIO_Pin_7;\/\/\u7aef\u53e3\u914d\u7f6e<br \/>\n  GPIO_InitStructure.GPIO_Mode &#061; GPIO_Mode_IN_FLOATING; \/\/\u6d6e\u7a7a\u8f93\u5165<br \/>\n  GPIO_Init(GPIOB, &amp;GPIO_InitStructure);      \/\/\u6839\u636e\u8bbe\u5b9a\u53c2\u6570\u521d\u59cb\u5316GPIOB<\/p>\n<p>  TIM_TimeBaseStructInit(&amp;TIM_TimeBaseStructure);<br \/>\n  TIM_TimeBaseStructure.TIM_Prescaler &#061; 0x00; \/\/ \u9884\u5206\u9891\u5668<br \/>\n  TIM_TimeBaseStructure.TIM_Period &#061; 65535; \/\/\u8bbe\u5b9a\u8ba1\u6570\u5668\u81ea\u52a8\u91cd\u88c5\u503c<br \/>\n  TIM_TimeBaseStructure.TIM_ClockDivision &#061; TIM_CKD_DIV1;\/\/\u9009\u62e9\u65f6\u949f\u5206\u9891&#xff1a;\u4e0d\u5206\u9891<br \/>\n  TIM_TimeBaseStructure.TIM_CounterMode &#061; TIM_CounterMode_Up;\/\/\/\/TIM\u5411\u4e0a\u8ba1\u6570<br \/>\n  TIM_TimeBaseInit(TIM4, &amp;TIM_TimeBaseStructure);<br \/>\n  TIM_EncoderInterfaceConfig(TIM4, TIM_EncoderMode_TI12, TIM_ICPolarity_Rising, TIM_ICPolarity_Rising);\/\/\u4f7f\u7528\u7f16\u7801\u5668\u6a21\u5f0f3<br \/>\n  TIM_ICStructInit(&amp;TIM_ICInitStructure);<br \/>\n  TIM_ICInitStructure.TIM_ICFilter &#061; 10;<br \/>\n  TIM_ICInit(TIM4, &amp;TIM_ICInitStructure);<br \/>\n  TIM_ClearFlag(TIM4, TIM_FLAG_Update);\/\/\u6e05\u9664TIM\u7684\u66f4\u65b0\u6807\u5fd7\u4f4d<br \/>\n  TIM_ITConfig(TIM4, TIM_IT_Update, ENABLE);<br \/>\n  \/\/Reset counter<br \/>\n  TIM_SetCounter(TIM4,0);<br \/>\n  TIM_Cmd(TIM4, ENABLE);<br \/>\n}<\/p>\n<p>\/**************************************************************************<br \/>\n\u51fd\u6570\u529f\u80fd&#xff1a;\u5355\u4f4d\u65f6\u95f4\u8bfb\u53d6\u7f16\u7801\u5668\u8ba1\u6570<br \/>\n\u5165\u53e3\u53c2\u6570&#xff1a;\u5b9a\u65f6\u5668<br \/>\n\u8fd4\u56de  \u503c&#xff1a;\u901f\u5ea6\u503c<br \/>\n**************************************************************************\/<br \/>\nint Read_Encoder(u8 TIMX)\/\/\u7f16\u7801\u5668\u8bfb\u53d6\u901f\u5ea6&#xff0c;\u8fd9\u91cc\u5982\u679c\u7528int\u8fdb\u884c\u5f3a\u5236\u7c7b\u578b\u8f6c\u6362\u4f1a\u62a5\u9519<br \/>\n{<br \/>\n    int point;    \/\/\u8bfb\u53d6\u5b9a\u65f6\u5668\u7684\u8ba1\u6570\u503c&#xff0c;\u7136\u540e\u518d\u6e050<br \/>\n   switch(TIMX)<br \/>\n {\/\/\u6240\u4ee5\u6362\u6210\u8fd9\u4e2a\u5e93\u51fd\u6570&#xff0c;\u8fd9\u7ed3\u6784\u4f53\u6210\u5458\u4e0d\u4f1a<br \/>\n case 2:  point&#061; TIM_GetCounter(TIM2);TIM_SetCounter(TIM2,0); break;<br \/>\n case 4:  point&#061; TIM_GetCounter(TIM4);TIM_SetCounter(TIM2,0); break;<br \/>\n   default:  point&#061;0;<br \/>\n }<br \/>\nreturn point;\/\/\u56e0\u4e3agetcounter\u8fd4\u56de\u7684\u662fuint16&#xff0c;\u8fd9\u4e2a\u662f\u4ec0\u4e48&#xff0c;\u8fd9\u4e2a\u662f\u77ed\u6574\u578b\u51fd\u6570&#xff0c;\u800c\u6211\u4eec\u4e4b\u524d\u5bf9\u51fd\u6570\u5b9a\u4e49\u7684\u662fint&#xff0c;\u6240\u4ee5\u53ef\u80fd\u4f1a\u51fa\u9519\u3002\u6240\u4ee5\u6211\u4eec\u8981\u8fdb\u884c\u4e00\u6b21\u5f3a\u5236\u7c7b\u578b\u8f6c\u6362<br \/>\n}<br \/>\n\/**************************************************************************<br \/>\n\u51fd\u6570\u529f\u80fd&#xff1a;TIM4\u4e2d\u65ad\u670d\u52a1\u51fd\u6570<br \/>\n\u5165\u53e3\u53c2\u6570&#xff1a;\u65e0<br \/>\n\u8fd4\u56de  \u503c&#xff1a;\u65e0<br \/>\n**************************************************************************\/<br \/>\nvoid TIM4_IRQHandler(void)<br \/>\n{<br \/>\nif(TIM4-&gt;SR&amp;0X0001)\/\/\u6ea2\u51fa\u4e2d\u65ad<br \/>\n{<br \/>\n}<br \/>\nTIM4-&gt;SR&amp;&#061;~(1&lt;&lt;0);\/\/\u6e05\u9664\u4e2d\u65ad\u6807\u5fd7\u4f4d<br \/>\n}<br \/>\n\/**************************************************************************<br \/>\n\u51fd\u6570\u529f\u80fd&#xff1a;TIM2\u4e2d\u65ad\u670d\u52a1\u51fd\u6570<br \/>\n\u5165\u53e3\u53c2\u6570&#xff1a;\u65e0<br \/>\n\u8fd4\u56de  \u503c&#xff1a;\u65e0<br \/>\n**************************************************************************\/<br \/>\nvoid TIM2_IRQHandler(void)<br \/>\n{<br \/>\nif(TIM2-&gt;SR&amp;0X0001)\/\/\u6ea2\u51fa\u4e2d\u65ad<br \/>\n{<br \/>\n}<br \/>\nTIM2-&gt;SR&amp;&#061;~(1&lt;&lt;0);\/\/\u6e05\u9664\u4e2d\u65ad\u6807\u5fd7\u4f4d<br \/>\n}<\/p>\n<p>void TIM4_IRQHandler(void)\/\/\u4e2d\u65ad\u6807\u5fd7\u4f4d\u6e05\u9664<br \/>\n{<br \/>\nif(TIM4-&gt;SR&amp;0X0001)\/\/\u6ea2\u51fa\u4e2d\u65ad<br \/>\nTIM4-&gt;SR&amp;&#061;~(1&lt;&lt;0);\/\/\u6e05\u9664\u4e2d\u65ad\u6807\u5fd7\u4f4d<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MPU6050&#xff1b;<br \/>\n\u4fef\u4ef0\u89d2<br \/>\n\u7ffb\u6eda\u89d2<br \/>\n\u504f\u822a\u89d2 TB6612\u00a0 PID<br \/>\n1.PID\u57fa\u7840\u77e5\u8bc6 \u8bbe\u5b9a\u503c\u548c\u53cd\u9988\u503c\u76f8\u6bd4\u8f83\u5c31\u662f\u504f\u5dee \u6bd4\u4f8b\u9879\u5c31\u662f\u4e00\u4e2a\u7cfb\u6570\u4e58\u4ee5\u4e00\u4e2a\u504f\u5dee<br \/>\n\u6bd4\u4f8b&#xff1a;\u63d0\u9ad8\u53cd\u5e94\u901f\u5ea6&#xff0c;\u51cf\u5c0f\u9759\u5dee<br \/>\n\u79ef\u5206&#xff1a;\u6d88\u9664\u9759\u6001\u8bef\u5dee<br \/>\n\u5fae\u5206\u9879&#xff1a;\u51cf\u5c0f\u9707\u8361\u4ee5\u53ca\u8d85\u8c03 \u76f4\u7acb\u73af&#xff0c;\u8ba9\u89d2\u5ea6\u8d8b\u4e8e0<br \/>\n\u901f\u5ea6\u73af&#xff0c;\u8ba9\u901f\u5ea6\u8d8b\u4e8e0 \u79ef\u5206\u9879&#xff0c;\u4e00\u4e2aki&#xff0c;\u79ef\u5206\u65f6\u95f4\u5e38\u6570\u4e58EK\u7684\u79ef\u5206&#xff0c;\u4ece0\u5230k <\/p>\n","protected":false},"author":2,"featured_media":64985,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[70],"topic":[],"class_list":["post-65005","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-ide"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u9879\u76ee\u7aef\uff083\uff09\u5e73\u8861\u8f66 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/65005.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u9879\u76ee\u7aef\uff083\uff09\u5e73\u8861\u8f66 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"MPU6050&#xff1b; \u4fef\u4ef0\u89d2 \u7ffb\u6eda\u89d2 \u504f\u822a\u89d2 TB6612\u00a0 PID 1.PID\u57fa\u7840\u77e5\u8bc6 \u8bbe\u5b9a\u503c\u548c\u53cd\u9988\u503c\u76f8\u6bd4\u8f83\u5c31\u662f\u504f\u5dee \u6bd4\u4f8b\u9879\u5c31\u662f\u4e00\u4e2a\u7cfb\u6570\u4e58\u4ee5\u4e00\u4e2a\u504f\u5dee \u6bd4\u4f8b&#xff1a;\u63d0\u9ad8\u53cd\u5e94\u901f\u5ea6&#xff0c;\u51cf\u5c0f\u9759\u5dee \u79ef\u5206&#xff1a;\u6d88\u9664\u9759\u6001\u8bef\u5dee \u5fae\u5206\u9879&#xff1a;\u51cf\u5c0f\u9707\u8361\u4ee5\u53ca\u8d85\u8c03 \u76f4\u7acb\u73af&#xff0c;\u8ba9\u89d2\u5ea6\u8d8b\u4e8e0 \u901f\u5ea6\u73af&#xff0c;\u8ba9\u901f\u5ea6\u8d8b\u4e8e0 \u79ef\u5206\u9879&#xff0c;\u4e00\u4e2aki&#xff0c;\u79ef\u5206\u65f6\u95f4\u5e38\u6570\u4e58EK\u7684\u79ef\u5206&#xff0c;\u4ece0\u5230k\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/65005.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-24T03:49:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260124034927-6974414784efa.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/65005.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/65005.html\",\"name\":\"\u9879\u76ee\u7aef\uff083\uff09\u5e73\u8861\u8f66 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-24T03:49:37+00:00\",\"dateModified\":\"2026-01-24T03:49:37+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/65005.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/65005.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/65005.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u9879\u76ee\u7aef\uff083\uff09\u5e73\u8861\u8f66\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u9879\u76ee\u7aef\uff083\uff09\u5e73\u8861\u8f66 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/65005.html","og_locale":"zh_CN","og_type":"article","og_title":"\u9879\u76ee\u7aef\uff083\uff09\u5e73\u8861\u8f66 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"MPU6050&#xff1b; \u4fef\u4ef0\u89d2 \u7ffb\u6eda\u89d2 \u504f\u822a\u89d2 TB6612\u00a0 PID 1.PID\u57fa\u7840\u77e5\u8bc6 \u8bbe\u5b9a\u503c\u548c\u53cd\u9988\u503c\u76f8\u6bd4\u8f83\u5c31\u662f\u504f\u5dee \u6bd4\u4f8b\u9879\u5c31\u662f\u4e00\u4e2a\u7cfb\u6570\u4e58\u4ee5\u4e00\u4e2a\u504f\u5dee \u6bd4\u4f8b&#xff1a;\u63d0\u9ad8\u53cd\u5e94\u901f\u5ea6&#xff0c;\u51cf\u5c0f\u9759\u5dee \u79ef\u5206&#xff1a;\u6d88\u9664\u9759\u6001\u8bef\u5dee \u5fae\u5206\u9879&#xff1a;\u51cf\u5c0f\u9707\u8361\u4ee5\u53ca\u8d85\u8c03 \u76f4\u7acb\u73af&#xff0c;\u8ba9\u89d2\u5ea6\u8d8b\u4e8e0 \u901f\u5ea6\u73af&#xff0c;\u8ba9\u901f\u5ea6\u8d8b\u4e8e0 \u79ef\u5206\u9879&#xff0c;\u4e00\u4e2aki&#xff0c;\u79ef\u5206\u65f6\u95f4\u5e38\u6570\u4e58EK\u7684\u79ef\u5206&#xff0c;\u4ece0\u5230k","og_url":"https:\/\/www.wsisp.com\/helps\/65005.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-24T03:49:37+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260124034927-6974414784efa.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/65005.html","url":"https:\/\/www.wsisp.com\/helps\/65005.html","name":"\u9879\u76ee\u7aef\uff083\uff09\u5e73\u8861\u8f66 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-24T03:49:37+00:00","dateModified":"2026-01-24T03:49:37+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/65005.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/65005.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/65005.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u9879\u76ee\u7aef\uff083\uff09\u5e73\u8861\u8f66"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/65005","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=65005"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/65005\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/64985"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=65005"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=65005"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=65005"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=65005"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}