{"id":1736,"date":"2017-11-29T21:33:20","date_gmt":"2017-11-29T12:33:20","guid":{"rendered":"http:\/\/www.chihayafuru.jp\/tech\/?p=1736"},"modified":"2017-12-05T11:02:08","modified_gmt":"2017-12-05T02:02:08","slug":"openmv-pwm%e5%88%b6%e5%be%a1","status":"publish","type":"post","link":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/archives\/1736","title":{"rendered":"OpenMV PWM\u5236\u5fa1"},"content":{"rendered":"<p>\u30d5\u30ea\u30b9\u30af\u30b5\u30a4\u30ba\u306e\u5c0f\u3055\u306a\u57fa\u677f\u306b\u30c7\u30b8\u30bf\u30eb\u30ab\u30e1\u30e9\u3068\u753b\u50cf\u51e6\u7406\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u642d\u8f09\u3055\u308c\u305f\u88fd\u54c1 <b>Open MV Cam<\/b>\u3002\u3053\u306e\u5c0f\u3055\u306a\u30b5\u30a4\u30ba\u3067\uff08\u30d1\u30bd\u30b3\u30f3\u3084\u30b9\u30de\u30db\u306a\u3057\u306b\uff09\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u3067\u30ab\u30e1\u30e9\u306e\u753b\u50cf\u3092\u53d6\u308a\u8fbc\u307f\u306a\u304c\u3089\u3001\u4e26\u884c\u3057\u3066\u753b\u50cf\u51e6\u7406\u3084\u753b\u50cf\u8a8d\u8b58\uff08\u4f8b\u3048\u3070\u9854\u8a8d\u8b58\uff09\u307e\u3067\u5b8c\u7d50\u3059\u308b\u306e\u306f\u9a5a\u304d\u306a\u306e\u3067\u3059\u304c\u3001\u30de\u30a4\u30b3\u30f3\u30dc\u30fc\u30c9\u3068\u3057\u3066\u306eGPIO\u306e\u6a5f\u80fd\u3082\u5145\u5b9f\u3057\u3066\u3044\u307e\u3059\u3002SPI, UART, ADC, DAC, PWM \u3068\u6c4e\u7528\u30de\u30a4\u30b3\u30f3\u30dc\u30fc\u30c9\u306eArduino\u3084mbed\u3068\u540c\u7b49\u306e\u6a5f\u80fd\u304c\u8a70\u307e\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3053\u3067OpenMV\u304b\u3089\u30e2\u30fc\u30bf\u30fc\u30c9\u30e9\u30a4\u30d0\u30fc\u3092\u4ecb\u3057\u3066DC\u30e2\u30fc\u30bf\u30fc\u306b\u63a5\u7d9a\u3057\u3001\u4e8c\u8f2a\u99c6\u52d5\u30ed\u30dc\u30c3\u30c8\u306e\u30b9\u30d4\u30fc\u30c9\u5236\u5fa1\u3092\u8a66\u307f\u307e\u3059\u3002OpenMV Cam M7\u306e<b>PWM Out<\/b>\u3068<b>Digital Out<\/b>\u3092&quot;<b>TB6612 2ch\u30e2\u30fc\u30bf\u30fc\u30c9\u30e9\u30a4\u30d0\u30fc<\/b>&quot;\u306b\u63a5\u7d9a\u3057\u3066\u5de6\u53f3\uff11\u5bfe\u306e\u30d6\u30e9\u30b7\u4ed8\u304dDC\u30e2\u30fc\u30bf\u30fc\uff08\u3044\u308f\u3086\u308b\u6a21\u578b\u7528\u30e2\u30fc\u30bf\u30fc\uff09\u3092\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" src=\"\/tech\/wp-content\/uploads\/2017\/11\/OpenMV-PWM.png\"><br \/>\n<!--more--><\/p>\n<p>\u203b\u4e0a\u5199\u771f\u306b\u306f\u30e2\u30fc\u30bf\u30fc\u306e\u51fa\u529b\uff08\u30ef\u30cb\u53e3\u30af\u30ea\u30c3\u30d7\uff09\u304c\uff11\u5bfe\u3057\u304b\u6620\u3063\u3066\u3044\u307e\u305b\u3093\u304c\u3001\u30e2\u30fc\u30bf\u30fc\u30c9\u30e9\u30a4\u30d0\u30fc\u306e\u30bf\u30fc\u30df\u30ca\u30eb\uff08\u7aef\u5b50\u53f0\uff09\u306b\u306f\uff12\u5bfe(AOUT1\/AOUT2\u3068BOUT1\/BOUT2)\u306e\u51fa\u529b\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3>OpenMV\u3068TB6612\u306e\u63a5\u7d9a<\/h3>\n<p>OpenMV\u306e\u51fa\u529b(&quot;PWM Out&quot;\u3068&quot;Digital Out&quot;)\u3092TB6612 motor driver\u306e\u5165\u529b\u3078\u63a5\u7d9a\u3057\u307e\u3059\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<th style=\"text-transform: none;\">OpenMV<\/th>\n<th>TB6612<\/th>\n<th>\u5099\u8003<\/th>\n<\/tr>\n<tr>\n<td>P0<\/td>\n<td>AIN1<\/td>\n<td>\u30e2\u30fc\u30bfA \u65b9\u54111<\/td>\n<\/tr>\n<tr>\n<td>P1<\/td>\n<td>AIN2<\/td>\n<td>\u30e2\u30fc\u30bfA \u65b9\u54112<\/td>\n<\/tr>\n<tr>\n<td>P2<\/td>\n<td>BIN1<\/td>\n<td>\u30e2\u30fc\u30bfB \u65b9\u54111<\/td>\n<\/tr>\n<tr>\n<td>P3<\/td>\n<td>BIN2<\/td>\n<td>\u30e2\u30fc\u30bfB \u65b9\u54112<\/td>\n<\/tr>\n<tr>\n<td>GND<\/td>\n<td>GND<\/td>\n<td>&nbsp;<\/td>\n<\/tr>\n<tr>\n<td>P7<\/td>\n<td>PWMA<\/td>\n<td>\u30e2\u30fc\u30bfA PWM<\/td>\n<\/tr>\n<tr>\n<td>P8<\/td>\n<td>PWMB<\/td>\n<td>\u30e2\u30fc\u30bfB PWM<\/td>\n<\/tr>\n<tr>\n<td>N\/C<\/td>\n<td>STBY<\/td>\n<td>5V (10k\u03a9\u30d7\u30eb\u30a2\u30c3\u30d7)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h3>TB6612\u306e\u5165\u529b(IN1\/IN2)\u3068\u51fa\u529b\u306e\u771f\u7406\u5024\u8868<\/h3>\n<p>TB6612 motor driver\u306b\u306f<b>A<\/b>\u3068<b>B<\/b>\u306e2\u30c1\u30e3\u30f3\u30cd\u30eb\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u305f\u3068\u3048\u3070\u3001A\u30c1\u30e3\u30f3\u30cd\u30eb\u306e<b>IN1<\/b>\u306f<b>AIN1<\/b>\u3068\u8aad\u307f\u66ff\u3048\u307e\u3059\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<th>IN1<\/th>\n<th>IN2<\/th>\n<th>\u51fa\u529b<\/th>\n<\/tr>\n<tr>\n<td>Low<\/td>\n<td>Low<\/td>\n<td>\u505c\u6b62\uff08\u30d6\u30ec\u30fc\u30ad\uff09 \u203b\uff11<\/td>\n<\/tr>\n<tr>\n<td>Low<\/td>\n<td>High<\/td>\n<td>\u6b63\u8ee2 (CW:ClockWise direction)<\/td>\n<\/tr>\n<tr>\n<td>High<\/td>\n<td>Low<\/td>\n<td>\u9006\u8ee2 (CCW:CounterClockWise direction)<\/td>\n<\/tr>\n<tr>\n<td>High<\/td>\n<td>High<\/td>\n<td>\u505c\u6b62\uff08\u30d5\u30ea\u30fc\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u203b1. \u767a\u96fb\u30d6\u30ec\u30fc\u30ad\u3001\u30b7\u30e7\u30fc\u30c8\u30d6\u30ec\u30fc\u30ad(Short Brake)<\/p>\n<p>&nbsp;<\/p>\n<h3>TB6612\u51fa\u529b\u5148\u306e\u63a5\u7d9a<\/h3>\n<table>\n<tbody>\n<tr>\n<th>TB6612<\/th>\n<th>\u51fa\u529b\u5148<\/th>\n<\/tr>\n<tr>\n<td>AO1<\/td>\n<td>\u5de6\u30e2\u30fc\u30bf (+)<\/td>\n<\/tr>\n<tr>\n<td>AO2<\/td>\n<td>\u5de6\u30e2\u30fc\u30bf (-)<\/td>\n<\/tr>\n<tr>\n<td>BO1<\/td>\n<td>\u53f3\u30e2\u30fc\u30bf (+)<\/td>\n<\/tr>\n<tr>\n<td>BO2<\/td>\n<td>\u53f3\u30e2\u30fc\u30bf (-)<\/td>\n<\/tr>\n<tr>\n<td>GND<\/td>\n<td>\u30d0\u30c3\u30c6\u30ea\u30fc (-)<\/td>\n<\/tr>\n<tr>\n<td>VM<\/td>\n<td>\u30d0\u30c3\u30c6\u30ea\u30fc (+)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h3>OpenMV\u306eMicroPython\u30b9\u30af\u30ea\u30d7\u30c8<\/h3>\n<pre class=\"lang:python decode:true \" >from pyb import Pin, Timer\r\n\r\npin0 = Pin('P0', Pin.OUT_PP)\r\npin1 = Pin('P1', Pin.OUT_PP)\r\npin2 = Pin('P2', Pin.OUT_PP)\r\npin3 = Pin('P3', Pin.OUT_PP)\r\n\r\ntim = Timer(4, freq=1000) # Frequency in Hz\r\n\r\nch1 = tim.channel(1, Timer.PWM, pin=Pin(\"P7\"), pulse_width_percent=25)\r\nch2 = tim.channel(2, Timer.PWM, pin=Pin(\"P8\"), pulse_width_percent=50)\r\npin0.high()\r\npin1.low()\r\npin2.high()\r\npin3.low()<\/pre>\n<p>&nbsp;<\/p>\n<h3>\u53c2\u7167\u30ea\u30f3\u30af<\/h3>\n<ul>\n<li>OpenMV\u516c\u5f0f\u30b5\u30a4\u30c8 : <a href=\"https:\/\/openmv.io\">https:\/\/openmv.io<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u30d5\u30ea\u30b9\u30af\u30b5\u30a4\u30ba\u306e\u5c0f\u3055\u306a\u57fa\u677f\u306b\u30c7\u30b8\u30bf\u30eb\u30ab\u30e1\u30e9\u3068\u753b\u50cf\u51e6\u7406\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u642d\u8f09\u3055\u308c\u305f\u88fd\u54c1 Open MV Cam\u3002\u3053\u306e\u5c0f\u3055\u306a\u30b5\u30a4\u30ba\u3067\uff08\u30d1\u30bd\u30b3\u30f3\u3084\u30b9\u30de\u30db\u306a\u3057\u306b\uff09\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u3067\u30ab\u30e1\u30e9\u306e\u753b\u50cf\u3092\u53d6\u308a\u8fbc\u307f\u306a\u304c\u3089\u3001\u4e26\u884c\u3057\u3066\u753b\u50cf\u51e6\u7406\u3084\u753b\u50cf\u8a8d\u8b58\uff08 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[62,59,60],"class_list":["post-1736","post","type-post","status-publish","format-standard","hentry","category-memo","tag-cam-robot","tag-openmv","tag-tb6612"],"_links":{"self":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/1736","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/comments?post=1736"}],"version-history":[{"count":27,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/1736\/revisions"}],"predecessor-version":[{"id":1758,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/1736\/revisions\/1758"}],"wp:attachment":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/media?parent=1736"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/categories?post=1736"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/tags?post=1736"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}