<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Simple Arduino DC Motor Control with Encoder, Part 2</title><link>/products/arduino/b/blog/posts/simple-arduino-dc-motor-control-with-encoder-part-2</link><description>I would like to have accurate motor control in the robot I am planning. Accordingly, I have been experimenting with encoders attached to the motors that provide feedback to a Proportional Integral controller. This post is a demonstration ...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Simple Arduino DC Motor Control with Encoder, Part 2</title><link>https://community.element14.com/products/arduino/b/blog/posts/simple-arduino-dc-motor-control-with-encoder-part-2</link><pubDate>Tue, 04 Aug 2020 05:43:21 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:b28854a6-a2cb-43db-9732-7c1703ea5f09</guid><dc:creator>gprad</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;A very good and detailed work. I am a hobbyist and not an electronics expert. I was going through the code and need clarification on how input is calculated in Hz. &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;The equation you have used is &lt;span&gt;inputX = (&lt;/span&gt;&lt;span style="font-weight:bold;"&gt;float&lt;/span&gt;&lt;span&gt;) INT_COUNT * &lt;/span&gt;&lt;span&gt;1000&lt;/span&gt;&lt;span&gt; / (&lt;/span&gt;&lt;span style="font-weight:bold;"&gt;float&lt;/span&gt;&lt;span&gt;)(nowTime - startTimeA);&amp;nbsp; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;The equation I know from Google is &lt;strong&gt;Frequency = (RPM X Line Count/60)&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Can you pls elaborate?&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=8529&amp;AppID=145&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Simple Arduino DC Motor Control with Encoder, Part 2</title><link>https://community.element14.com/products/arduino/b/blog/posts/simple-arduino-dc-motor-control-with-encoder-part-2</link><pubDate>Mon, 06 Jan 2020 22:01:35 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:b28854a6-a2cb-43db-9732-7c1703ea5f09</guid><dc:creator>DAB</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Good update.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;DAB&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=8529&amp;AppID=145&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Simple Arduino DC Motor Control with Encoder, Part 2</title><link>https://community.element14.com/products/arduino/b/blog/posts/simple-arduino-dc-motor-control-with-encoder-part-2</link><pubDate>Mon, 06 Jan 2020 16:26:36 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:b28854a6-a2cb-43db-9732-7c1703ea5f09</guid><dc:creator>genebren</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Frank,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Very interesting work!&amp;nbsp; The results are looking very promising.&amp;nbsp; Just as a side note, it would seem that you could also keep a running count of the encoder pulses for each motor using a simple interrupt and make a correction (adjust pwm) when the counts differ.&amp;nbsp; As you start commanding the motors to spin and different speeds (perform turns or such) the PI controller will not be very useful.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Keep up the good work!&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Gene&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=8529&amp;AppID=145&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Simple Arduino DC Motor Control with Encoder, Part 2</title><link>https://community.element14.com/products/arduino/b/blog/posts/simple-arduino-dc-motor-control-with-encoder-part-2</link><pubDate>Mon, 06 Jan 2020 15:05:43 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:b28854a6-a2cb-43db-9732-7c1703ea5f09</guid><dc:creator>dubbie</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;This looks very good. At some point in the future (after all the Christmas present robots have been built and played with) I will have to come back to this and try it for myself.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Dubbie&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=8529&amp;AppID=145&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Simple Arduino DC Motor Control with Encoder, Part 2</title><link>https://community.element14.com/products/arduino/b/blog/posts/simple-arduino-dc-motor-control-with-encoder-part-2</link><pubDate>Mon, 06 Jan 2020 11:44:53 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:b28854a6-a2cb-43db-9732-7c1703ea5f09</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;I&amp;#39;ve been working with the exact same PID library &lt;a class="jive-link-blog-small" href="/challenges-projects/design-challenges/texas-instruments-safe-sound-wearables-design-challenge/b/blog/posts/msp432-and-ti-rtos-pid-library-part-1---intro"&gt;MSP432 and TI-RTOS: PID Library Part 1 - Intro&lt;/a&gt; .&lt;/p&gt;&lt;p&gt;We also reviewed PID as a way to control current in our electronic load but it tends to overshoot before reaching its stability. For a load that isn&amp;#39;t good. We used an opamp integrator instead.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=8529&amp;AppID=145&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>