差别
这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录 前一修订版 后一修订版 | 前一修订版 | ||
wm_wiki:mg995_sovor:manual [2020/03/10 18:39] juneral [4. 注意事项] |
wm_wiki:mg995_sovor:manual [2020/05/12 15:44] (当前版本) juneral [3.1. 模块功能及图形化编程指南] |
||
---|---|---|---|
行 4: | 行 4: | ||
<html><body> | <html><body> | ||
+ | <p class=MsoNormal style='text-indent:32.0pt'><span lang=EN-US | ||
+ | style='font-size:16.0pt;line-height:105%;font-family:宋体'>MG995</span><span | ||
+ | style='font-size:16.0pt;line-height:105%;font-family:宋体'>舵机是一种简单的,常用的标准伺服电机,可使用在机器人头部,机械手,云台等场景。</span></p> | ||
</body></html> | </body></html> | ||
行 10: | 行 12: | ||
===== 2. 电机参数 ===== | ===== 2. 电机参数 ===== | ||
<html><body> | <html><body> | ||
+ | <div align=center> | ||
+ | <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 | ||
+ | style='border-collapse:collapse;mso-yfti-tbllook:1184;mso-padding-alt:0cm 0cm 0cm 0cm'> | ||
+ | <tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes'> | ||
+ | <td width=173 valign=top style='width:130.1pt;border-top:solid #5B9BD5 3.0pt; | ||
+ | border-left:solid #5B9BD5 3.0pt;border-bottom:solid white 2.25pt;border-right: | ||
+ | none;background:#5B9BD5;padding:0cm 5.4pt 0cm 5.4pt'> | ||
+ | <p class=MsoNormal align=center style='margin-bottom:0cm;margin-bottom:.0001pt; | ||
+ | text-align:center;line-height:normal'><span style='font-size:18.0pt; | ||
+ | font-family:宋体;color:white'>参数</span></p> | ||
+ | </td> | ||
+ | <td width=395 valign=top style='width:295.9pt;border-top:solid #5B9BD5 3.0pt; | ||
+ | border-left:none;border-bottom:solid white 2.25pt;border-right:solid #5B9BD5 3.0pt; | ||
+ | background:#5B9BD5;padding:0cm 5.4pt 0cm 5.4pt'> | ||
+ | <p class=MsoNormal align=center style='margin-bottom:0cm;margin-bottom:.0001pt; | ||
+ | text-align:center;line-height:normal'><span style='font-size:18.0pt; | ||
+ | font-family:宋体;color:white'>值</span><span lang=EN-US style='font-size:18.0pt; | ||
+ | color:white'>/</span><span style='font-size:18.0pt;font-family:宋体;color:white'>描述</span></p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | <tr style='mso-yfti-irow:1'> | ||
+ | <td width=173 valign=top style='width:130.1pt;border-top:none;border-left: | ||
+ | solid #5B9BD5 3.0pt;border-bottom:none;border-right:solid white 1.0pt; | ||
+ | background:#5B9BD5;padding:0cm 5.4pt 0cm 5.4pt'> | ||
+ | <p class=MsoNormal align=center style='margin-bottom:0cm;margin-bottom:.0001pt; | ||
+ | text-align:center;line-height:normal'><b><span style='font-size:16.0pt; | ||
+ | font-family:宋体;color:white'>工作电压范围</span></b></p> | ||
+ | </td> | ||
+ | <td width=395 valign=top style='width:295.9pt;border:none;border-right:solid #5B9BD5 3.0pt; | ||
+ | background:#5B9BD5;padding:0cm 5.4pt 0cm 5.4pt'> | ||
+ | <p class=MsoNormal align=center style='margin-bottom:0cm;margin-bottom:.0001pt; | ||
+ | text-align:center;line-height:normal'><span lang=EN-US style='font-size:16.0pt; | ||
+ | color:white'>3.0~7.2 VDC</span></p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | <tr style='mso-yfti-irow:2'> | ||
+ | <td width=173 valign=top style='width:130.1pt;border:solid white 1.0pt; | ||
+ | border-left:solid #5B9BD5 3.0pt;background:#5B9BD5;padding:0cm 5.4pt 0cm 5.4pt'> | ||
+ | <p class=MsoNormal align=center style='margin-bottom:0cm;margin-bottom:.0001pt; | ||
+ | text-align:center;line-height:normal'><b><span style='font-size:16.0pt; | ||
+ | font-family:宋体;color:white'>工作电流</span></b></p> | ||
+ | </td> | ||
+ | <td width=395 valign=top style='width:295.9pt;border-top:solid white 1.0pt; | ||
+ | border-left:none;border-bottom:solid white 1.0pt;border-right:solid #5B9BD5 3.0pt; | ||
+ | background:#5B9BD5;padding:0cm 5.4pt 0cm 5.4pt'> | ||
+ | <p class=MsoNormal align=center style='margin-bottom:0cm;margin-bottom:.0001pt; | ||
+ | text-align:center;line-height:normal'><span lang=EN-US style='font-size:16.0pt; | ||
+ | font-family:宋体;color:white'>100</span><span lang=EN-US style='font-size:16.0pt; | ||
+ | color:white'>mA</span></p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | <tr style='mso-yfti-irow:3'> | ||
+ | <td width=173 valign=top style='width:130.1pt;border-top:none;border-left: | ||
+ | solid #5B9BD5 3.0pt;border-bottom:none;border-right:solid white 1.0pt; | ||
+ | background:#5B9BD5;padding:0cm 5.4pt 0cm 5.4pt'> | ||
+ | <p class=MsoNormal align=center style='margin-bottom:0cm;margin-bottom:.0001pt; | ||
+ | text-align:center;line-height:normal'><b><span style='font-size:16.0pt; | ||
+ | font-family:宋体;color:white'>舵机类型</span></b></p> | ||
+ | </td> | ||
+ | <td width=395 valign=top style='width:295.9pt;border:none;border-right:solid #5B9BD5 3.0pt; | ||
+ | background:#5B9BD5;padding:0cm 5.4pt 0cm 5.4pt'> | ||
+ | <p class=MsoNormal align=center style='margin-bottom:0cm;margin-bottom:.0001pt; | ||
+ | text-align:center;line-height:normal'><span style='font-size:16.0pt; | ||
+ | font-family:宋体;color:white'>模拟舵机</span></p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | <tr style='mso-yfti-irow:4'> | ||
+ | <td width=173 valign=top style='width:130.1pt;border:solid white 1.0pt; | ||
+ | border-left:solid #5B9BD5 3.0pt;background:#5B9BD5;padding:0cm 5.4pt 0cm 5.4pt'> | ||
+ | <p class=MsoNormal align=center style='margin-bottom:0cm;margin-bottom:.0001pt; | ||
+ | text-align:center;line-height:normal'><b><span style='font-size:16.0pt; | ||
+ | font-family:宋体;color:white'>工作扭矩</span></b></p> | ||
+ | </td> | ||
+ | <td width=395 valign=top style='width:295.9pt;border-top:solid white 1.0pt; | ||
+ | border-left:none;border-bottom:solid white 1.0pt;border-right:solid #5B9BD5 3.0pt; | ||
+ | background:#5B9BD5;padding:0cm 5.4pt 0cm 5.4pt'> | ||
+ | <p class=MsoNormal align=center style='margin-bottom:0cm;margin-bottom:.0001pt; | ||
+ | text-align:center;line-height:normal'><span lang=EN-US style='font-size:16.0pt; | ||
+ | font-family:宋体;color:white'>13KG/</span><span lang=EN-US style='font-size: | ||
+ | 16.0pt;color:white'>cm</span></p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | <tr style='mso-yfti-irow:5'> | ||
+ | <td width=173 valign=top style='width:130.1pt;border-top:none;border-left: | ||
+ | solid #5B9BD5 3.0pt;border-bottom:none;border-right:solid white 1.0pt; | ||
+ | background:#5B9BD5;padding:0cm 5.4pt 0cm 5.4pt'> | ||
+ | <p class=MsoNormal align=center style='margin-bottom:0cm;margin-bottom:.0001pt; | ||
+ | text-align:center;line-height:normal'><b><span style='font-size:16.0pt; | ||
+ | font-family:宋体;color:white'>反应转速</span></b></p> | ||
+ | </td> | ||
+ | <td width=395 valign=top style='width:295.9pt;border:none;border-right:solid #5B9BD5 3.0pt; | ||
+ | background:#5B9BD5;padding:0cm 5.4pt 0cm 5.4pt'> | ||
+ | <p class=MsoNormal align=center style='margin-bottom:0cm;margin-bottom:.0001pt; | ||
+ | text-align:center;line-height:normal'><span lang=EN-US style='font-size:16.0pt; | ||
+ | font-family:宋体;color:white'>53~62R/M</span></p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | <tr style='mso-yfti-irow:6'> | ||
+ | <td width=173 valign=top style='width:130.1pt;border:solid white 1.0pt; | ||
+ | border-left:solid #5B9BD5 3.0pt;background:#5B9BD5;padding:0cm 5.4pt 0cm 5.4pt'> | ||
+ | <p class=MsoNormal align=center style='margin-bottom:0cm;margin-bottom:.0001pt; | ||
+ | text-align:center;line-height:normal'><b><span style='font-size:16.0pt; | ||
+ | font-family:宋体;color:white'>转动角度</span></b></p> | ||
+ | </td> | ||
+ | <td width=395 valign=top style='width:295.9pt;border-top:solid white 1.0pt; | ||
+ | border-left:none;border-bottom:solid white 1.0pt;border-right:solid #5B9BD5 3.0pt; | ||
+ | background:#5B9BD5;padding:0cm 5.4pt 0cm 5.4pt'> | ||
+ | <p class=MsoNormal align=center style='margin-bottom:0cm;margin-bottom:.0001pt; | ||
+ | text-align:center;line-height:normal'><span lang=EN-US style='font-size:16.0pt; | ||
+ | font-family:宋体;color:white'>0</span><span style='font-size:16.0pt;font-family: | ||
+ | 宋体;color:white'>°<span lang=EN-US>~180</span>°</span></p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | <tr style='mso-yfti-irow:7;mso-yfti-lastrow:yes'> | ||
+ | <td width=173 valign=top style='width:130.1pt;border-top:none;border-left: | ||
+ | solid #5B9BD5 3.0pt;border-bottom:solid white 1.0pt;border-right:solid white 1.0pt; | ||
+ | background:#5B9BD5;padding:0cm 5.4pt 0cm 5.4pt'> | ||
+ | <p class=MsoNormal align=center style='margin-bottom:0cm;margin-bottom:.0001pt; | ||
+ | text-align:center;line-height:normal'><b><span style='font-size:16.0pt; | ||
+ | font-family:宋体;color:white'>结构材质</span></b></p> | ||
+ | </td> | ||
+ | <td width=395 valign=top style='width:295.9pt;border-top:none;border-left: | ||
+ | none;border-bottom:solid white 1.0pt;border-right:solid #5B9BD5 3.0pt; | ||
+ | background:#5B9BD5;padding:0cm 5.4pt 0cm 5.4pt'> | ||
+ | <p class=MsoNormal align=center style='margin-bottom:0cm;margin-bottom:.0001pt; | ||
+ | text-align:center;line-height:normal'><span style='font-size:16.0pt; | ||
+ | font-family:宋体;color:white'>金属铜齿、空心杯电机、双滚珠轴承</span></p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |||
+ | </div> | ||
</body></html> | </body></html> | ||
行 20: | 行 154: | ||
<html><body> | <html><body> | ||
+ | <p class=MsoNormal style='text-indent:32.0pt'><span style='font-size:16.0pt; | ||
+ | line-height:105%;font-family:等线;color:#666666;background:white'>该电机支持的图形化编程平台有</span><span | ||
+ | lang=EN-US style='font-size:16.0pt;line-height:105%;font-family:"Helvetica",sans-serif; | ||
+ | color:#666666;background:white'><span style='box-sizing: border-box;font-variant-ligatures: normal; | ||
+ | font-variant-caps: normal;orphans: 2;text-align:start;widows: 2;-webkit-text-stroke-width: 0px; | ||
+ | text-decoration-style: initial;text-decoration-color: initial;word-spacing: | ||
+ | 0px'>WeeeCode</span></span><span style='font-size:16.0pt;line-height:105%; | ||
+ | font-family:等线;color:#666666;background:white'><span style='box-sizing: border-box; | ||
+ | font-variant-ligatures: normal;font-variant-caps: normal;orphans: 2;text-align: | ||
+ | start;widows: 2;-webkit-text-stroke-width: 0px;text-decoration-style: initial; | ||
+ | text-decoration-color: initial;word-spacing:0px'>、编程猫平台、</span></span><span | ||
+ | lang=EN-US style='font-size:16.0pt;line-height:105%;font-family:"Helvetica",sans-serif; | ||
+ | color:#666666;background:white'><span style='box-sizing: border-box;font-variant-ligatures: normal; | ||
+ | font-variant-caps: normal;orphans: 2;text-align:start;widows: 2;-webkit-text-stroke-width: 0px; | ||
+ | text-decoration-style: initial;text-decoration-color: initial;word-spacing: | ||
+ | 0px'>Mixly_Arduino</span></span><span style='font-size:16.0pt;line-height:105%; | ||
+ | font-family:等线;color:#666666;background:white'><span style='box-sizing: border-box; | ||
+ | font-variant-ligatures: normal;font-variant-caps: normal;orphans: 2;text-align: | ||
+ | start;widows: 2;-webkit-text-stroke-width: 0px;text-decoration-style: initial; | ||
+ | text-decoration-color: initial;word-spacing:0px'>、</span></span><span | ||
+ | lang=EN-US style='font-size:16.0pt;line-height:105%;font-family:"Helvetica",sans-serif; | ||
+ | color:#666666;background:white'><span style='box-sizing: border-box;font-variant-ligatures: normal; | ||
+ | font-variant-caps: normal;orphans: 2;text-align:start;widows: 2;-webkit-text-stroke-width: 0px; | ||
+ | text-decoration-style: initial;text-decoration-color: initial;word-spacing: | ||
+ | 0px'>MakeCode</span></span><span style='font-size:16.0pt;line-height:105%; | ||
+ | font-family:等线;color:#666666;background:white'><span style='box-sizing: border-box; | ||
+ | font-variant-ligatures: normal;font-variant-caps: normal;orphans: 2;text-align: | ||
+ | start;widows: 2;-webkit-text-stroke-width: 0px;text-decoration-style: initial; | ||
+ | text-decoration-color: initial;word-spacing:0px'>等,其图形化编程大同小异,区别不会很大。</span></span></p> | ||
+ | <div align=center> | ||
+ | |||
+ | <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 | ||
+ | style='border-collapse:collapse'> | ||
+ | <tr style='height:24.7pt'> | ||
+ | <td width=244 valign=top style='width:183.3pt;border:solid windowtext 1.0pt; | ||
+ | padding:0cm 5.4pt 0cm 5.4pt;height:24.7pt'> | ||
+ | <p class=MsoNormal align=center style='margin-bottom:0cm;margin-bottom:.0001pt; | ||
+ | text-align:center;line-height:normal'><b><span style='font-size:14.0pt; | ||
+ | font-family:等线;color:black;background:white'>模块功能</span></b></p> | ||
+ | </td> | ||
+ | <td width=189 valign=top style='width:142.05pt;border:solid windowtext 1.0pt; | ||
+ | border-left:none;padding:0cm 5.4pt 0cm 5.4pt;height:24.7pt'> | ||
+ | <p class=MsoNormal align=center style='margin-bottom:0cm;margin-bottom:.0001pt; | ||
+ | text-align:center;line-height:normal'><b><span style='font-size:14.0pt; | ||
+ | font-family:等线;color:black;background:white'>需传参数</span></b></p> | ||
+ | </td> | ||
+ | <td width=455 valign=top style='width:341.05pt;border:solid windowtext 1.0pt; | ||
+ | border-left:none;padding:0cm 5.4pt 0cm 5.4pt;height:24.7pt'> | ||
+ | <p class=MsoNormal align=center style='margin-bottom:0cm;margin-bottom:.0001pt; | ||
+ | text-align:center;line-height:normal'><b><span style='font-size:14.0pt; | ||
+ | font-family:等线;color:black;background:white'>图形化编程块举例</span></b><b | ||
+ | style='box-sizing: border-box;font-variant-ligatures: normal;font-variant-caps: normal; | ||
+ | orphans: 2;widows: 2;-webkit-text-stroke-width: 0px;text-decoration-style: initial; | ||
+ | text-decoration-color: initial;word-spacing:0px'><span style='box-sizing: border-box'><span | ||
+ | lang=EN-US style='font-size:14.0pt;font-family:"Helvetica",sans-serif; | ||
+ | color:black;background:white'>(</span></span></b><b style='box-sizing: border-box; | ||
+ | font-variant-ligatures: normal;font-variant-caps: normal;orphans: 2; | ||
+ | widows: 2;-webkit-text-stroke-width: 0px;text-decoration-style: initial; | ||
+ | text-decoration-color: initial;word-spacing:0px'><span style='box-sizing: border-box'><span | ||
+ | style='font-size:14.0pt;font-family:等线;color:black;background:white'>其他平台图形化编程块大同小异</span></span></b><b | ||
+ | style='box-sizing: border-box;font-variant-ligatures: normal;font-variant-caps: normal; | ||
+ | orphans: 2;widows: 2;-webkit-text-stroke-width: 0px;text-decoration-style: initial; | ||
+ | text-decoration-color: initial;word-spacing:0px'><span style='box-sizing: border-box'><span | ||
+ | lang=EN-US style='font-size:14.0pt;font-family:"Helvetica",sans-serif; | ||
+ | color:black;background:white'>)</span></span></b></p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td width=244 style='width:183.3pt;border:solid windowtext 1.0pt;border-top: | ||
+ | none;padding:0cm 5.4pt 0cm 5.4pt'> | ||
+ | <p class=MsoNormal align=center style='margin-bottom:0cm;margin-bottom:.0001pt; | ||
+ | text-align:center;line-height:normal'><span style='font-size:14.0pt; | ||
+ | font-family:等线;color:black;background:white'>驱动舵机运作</span></p> | ||
+ | </td> | ||
+ | <td width=189 style='width:142.05pt;border-top:none;border-left:none; | ||
+ | border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; | ||
+ | padding:0cm 5.4pt 0cm 5.4pt'> | ||
+ | <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: | ||
+ | normal'><span style='font-size:14.0pt;font-family:等线;color:black;background: | ||
+ | white'>(</span><span lang=EN-US style='font-size:14.0pt;font-family:"Helvetica",sans-serif; | ||
+ | color:black;background:white'><span style='box-sizing: border-box;font-variant-ligatures: normal; | ||
+ | font-variant-caps: normal;orphans: 2;widows: 2;-webkit-text-stroke-width: 0px; | ||
+ | text-decoration-style: initial;text-decoration-color: initial;word-spacing: | ||
+ | 0px'>2</span></span><span style='font-size:14.0pt;font-family:等线;color:black; | ||
+ | background:white'>个参数)所接端口</span><span style='font-size:14.0pt;font-family: | ||
+ | 宋体;color:black;background:white'>、角度<span lang=EN-US>(0~180)</span></span></p> | ||
+ | </td> | ||
+ | <td width=455 valign=top style='width:341.05pt;border-top:none;border-left: | ||
+ | none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; | ||
+ | padding:0cm 5.4pt 0cm 5.4pt'> | ||
+ | <p class=MsoNormal align=center style='margin-bottom:0cm;margin-bottom:.0001pt; | ||
+ | text-align:center;line-height:normal'><span lang=EN-US><img width=310 | ||
+ | height=70 id="图片 1" src="lib/exe/fetch.php?media=wm_wiki:mg995_sovor:pasted:20200310-185655.png"></span></p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |||
+ | </div> | ||
+ | |||
+ | <p class=MsoNormal style='text-indent:36.0pt'><span lang=EN-US | ||
+ | style='font-size:5.0pt;line-height:105%;font-family:等线;color:#666666; | ||
+ | background:yellow'> </span></p> | ||
<p class=MsoNormal style='text-indent:36.0pt'><span style='font-size:16.0pt; | <p class=MsoNormal style='text-indent:36.0pt'><span style='font-size:16.0pt; | ||
行 27: | 行 263: | ||
</body></html> | </body></html> | ||
+ | {{ :wm_wiki:mg995_sovor:pasted:20200310-185643.png }} | ||
==== 3.2. 文本代码编程指南 ==== | ==== 3.2. 文本代码编程指南 ==== | ||
行 35: | 行 271: | ||
</body></html> | </body></html> | ||
- | <sxh cpp; first-line: 1;highlight: [3,4,13,14,16,17,19,20,22,23]; title: we_dcmotor_test.ino> | + | <sxh cpp; first-line: 1;highlight: [3,6,10,12]; title: we_servo_test.ino> |
#include "WeELF328P.h" | #include "WeELF328P.h" | ||
- | WeDCMotor motor1(M1); | + | Servo weservo; |
- | WeDCMotor motor2(M2); | + | void setup() |
- | + | { | |
- | uint8_t motorSpeed = 100; | + | weservo.attach(PORT_1); |
- | + | ||
- | void setup() | + | |
- | { | + | |
} | } | ||
- | void loop() | + | void loop() |
{ | { | ||
- | motor1.run(motorSpeed); | + | weservo.write(0); // sets the servo position according to the scaled value 0-180 |
- | motor2.run(motorSpeed); | + | delay(2000); // waits for the servo to get there |
- | delay(2000); | + | weservo.write(180); |
- | motor1.stop(); | + | delay(2000); |
- | motor2.stop(); | + | |
- | delay(500); | + | |
- | motor1.run(-motorSpeed); | + | |
- | motor2.run(-motorSpeed); | + | |
- | delay(2000); | + | |
- | motor1.stop(); | + | |
- | motor2.stop(); | + | |
- | delay(500); | + | |
} | } | ||
</sxh> | </sxh> | ||
行 66: | 行 291: | ||
<html><body> | <html><body> | ||
+ | <p class=MsoNormal style='text-indent:32.0pt'><span lang=EN-US | ||
+ | style='font-size:16.0pt;line-height:105%;font-family:宋体;color:#222222; | ||
+ | background:white'>1</span><span style='font-size:16.0pt;line-height:105%; | ||
+ | font-family:宋体;color:#222222;background:white'>、不能长时间快速正反转,这样会造成电流过大,发热量大,烧毁舵机。</span><span | ||
+ | lang=EN-US> </span></p> | ||
+ | |||
+ | <p class=MsoNormal style='text-indent:32.0pt'><span lang=EN-US | ||
+ | style='font-size:16.0pt;line-height:105%;font-family:宋体;color:#222222; | ||
+ | background:white'>2</span><span style='font-size:16.0pt;line-height:105%; | ||
+ | font-family:宋体;color:#222222;background:white'>、不能长时间堵转,这样会造成电流过大,发热量大,烧毁舵机。</span></p> | ||
+ | <p class=MsoNormal style='text-indent:32.0pt'><span lang=EN-US | ||
+ | style='font-size:16.0pt;line-height:105%;font-family:宋体;color:#222222; | ||
+ | background:white'>3</span><span style='font-size:16.0pt;line-height:105%; | ||
+ | font-family:宋体;color:#222222;background:white'>、电源正负极不能接错。</span></p> | ||
</body></html> | </body></html> |