<?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>BeagleBone Control Stepper Motors with PRU - Part 5: It Works</title><link>/products/devtools/single-board-computers/next-genbeaglebone/b/blog/posts/beaglebone-control-stepper-motors-with-pru---part-5-it-works</link><description>I&amp;#39;m trying here is to let the real-time units of the BeagleBone generate the signals for a stepper motor .In this post: it works! Let&amp;#39;s put everything together. www.youtube.com/watch Initialise the Sleep and Reset Signals The pi...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: BeagleBone Control Stepper Motors with PRU - Part 5: It Works</title><link>https://community.element14.com/products/devtools/single-board-computers/next-genbeaglebone/b/blog/posts/beaglebone-control-stepper-motors-with-pru---part-5-it-works</link><pubDate>Sat, 17 Aug 2019 13:27:30 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:c11b0eef-16fa-40ce-8a08-df8c13ff997f</guid><dc:creator>clem57</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I liked the tip about putting motor to sleep and avoid all the heat!&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=7543&amp;AppID=80&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: BeagleBone Control Stepper Motors with PRU - Part 5: It Works</title><link>https://community.element14.com/products/devtools/single-board-computers/next-genbeaglebone/b/blog/posts/beaglebone-control-stepper-motors-with-pru---part-5-it-works</link><pubDate>Sat, 17 Aug 2019 12:14:47 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:c11b0eef-16fa-40ce-8a08-df8c13ff997f</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Here&amp;#39;s a shell script that loads latest PRU firmware and sets all pins.&lt;/p&gt;&lt;p&gt;If you pass --test as parameter, it &amp;#39;ll move the motor 20 steps right and left&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Assumptions: you followed the blog (specific: copied the binaries for SPI and PRU to the /home/debian/bin folder and loaded the SPI overlay).&lt;/p&gt;&lt;p&gt;Be sudo.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;to configure the bb:&lt;/p&gt;&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3ef06e6b-9b7d-4651-b12d-db8be7f5e991:type=text&amp;amp;text=.%2FPRU_STEPPER.sh]&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;to also perform a test, then&lt;/p&gt;&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3ef06e6b-9b7d-4651-b12d-db8be7f5e991:type=text&amp;amp;text=.%2FPRU_STEPPER.sh+--test]&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3ef06e6b-9b7d-4651-b12d-db8be7f5e991:type=text&amp;amp;text=%23%21%2Fbin%2Fbash%0A%0APRU_STEPPER_link%3D%22%24%28readlink+-f+%2Fhome%2Fdebian%2Fbin%2Fbb_PRU_STEPPER.out%29%22%0Afw0_link%3D%24%7BPRU_STEPPER_link%7D%0A%0Aif+%5B+%24%7Bfw0_link%7D+%5D%3B%0Athen%0A+++++echo+%22stop+the+program+if+running%22%0A+++++echo+%27stop%27+%3E+%2Fsys%2Fclass%2Fremoteproc%2Fremoteproc1%2Fstate+2%3E%2Fdev%2Fnull%0A+++++rm+%2Flib%2Ffirmware%2Fam335x-pru0-fw+%26%3E+%2Fdev%2Fnull%0A%0A+++++ln+-s+%24%7Bfw0_link%7D+%2Flib%2Ffirmware%2Fam335x-pru0-fw%0A%0A+++++echo+%22load+the+firmware+to+PRU%22%0A+++++echo+%27am335x-pru0-fw%27+%3E+%2Fsys%2Fclass%2Fremoteproc%2Fremoteproc1%2Ffirmware%0A%0A+++++echo+%22start+the+program%22%0A+++++echo+%27start%27+%3E+%2Fsys%2Fclass%2Fremoteproc%2Fremoteproc1%2Fstate%0A%0A+++++echo+%22%22%0A+++++echo+%22Firmware+is+running%22%0A+++++echo+%22%22%0Aelse%0A+++++echo+%22Firmware+.out+files+does+not+seem+to+exist.+Did+you+place+%22+%24%7BPRU_STEPPER_link%7D+%22%3F%22%0A+++++echo+%22%22%0Afi%0A%0Aecho+%22sleep+on%22%0Aecho+out+%3E+%2Fsys%2Fclass%2Fgpio%2Fgpio30%2Fdirection%0Aecho+0+%3E+%2Fsys%2Fclass%2Fgpio%2Fgpio30%2Fvalue%0A++%0Aecho+%22reset+off%22%0Aecho+out+%3E+%2Fsys%2Fclass%2Fgpio%2Fgpio31%2Fdirection%0Aecho+0+%3E+%2Fsys%2Fclass%2Fgpio%2Fgpio31%2Fvalue%0A%0Aecho+%22set+pin+29+and+31+as+PRU+GPIO+out%22%0Aconfig-pin+P9_31+pruout++++%0Aconfig-pin+P9_29+pruout++++%0A%0Aecho+%22initialise+SPI%22%0A%2Fhome%2Fdebian%2Fbin%2Fbb_LINUX_STEPPER_SPI+%0A%0Aecho+%22stepper+motor+control+ready+from+PRU0%22%0A%0Awhile+test+%24%23+-gt+0%0Ado%0A+++++case+%22%241%22+in%0A++++++++--test%29+%0A+++++echo+%22test+requested%22%0A+++++echo+%22sleep+off%22++%0A+++++echo+1+%3E+%2Fsys%2Fclass%2Fgpio%2Fgpio30%2Fvalue%0A%0A+++++echo+%22motor+move+start%22%0A+++++echo+%27120%27+%3E+%2Fdev%2Frpmsg_pru30%0A+++++echo+%27020%27+%3E+%2Fdev%2Frpmsg_pru30%0A+++++sleep+1s%0A+++++echo+%22motor+move+stop%22%0A%0A+++++echo+%22sleep+on%22%0A+++++echo+0+%3E+%2Fsys%2Fclass%2Fgpio%2Fgpio30%2Fvalue++++++++%0A++++++++++++%3B%3B%0A++++esac%0A++++shift%0Adone]&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;For heat dissipation reasons, I turn the motor in sleep mode when the script exits.&lt;/p&gt;&lt;p&gt;To wake it up, execute:&lt;/p&gt;&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3ef06e6b-9b7d-4651-b12d-db8be7f5e991:type=text&amp;amp;text=echo+1+%3E+%2Fsys%2Fclass%2Fgpio%2Fgpio30%2Fvalue]&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;To make the motor take 20 steps, execute&lt;/p&gt;&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3ef06e6b-9b7d-4651-b12d-db8be7f5e991:type=text&amp;amp;text=echo+%27020%27+%3E+%2Fdev%2Frpmsg_pru30]&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;To make it go back to sleep:&lt;/p&gt;&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3ef06e6b-9b7d-4651-b12d-db8be7f5e991:type=text&amp;amp;text=echo+0+%3E+%2Fsys%2Fclass%2Fgpio%2Fgpio30%2Fvalue]&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I made this script to make development easier. I compile the binary in CCS then move it to the BB. A single command deploys and tests ...&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=7543&amp;AppID=80&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: BeagleBone Control Stepper Motors with PRU - Part 5: It Works</title><link>https://community.element14.com/products/devtools/single-board-computers/next-genbeaglebone/b/blog/posts/beaglebone-control-stepper-motors-with-pru---part-5-it-works</link><pubDate>Sun, 04 Aug 2019 13:29:42 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:c11b0eef-16fa-40ce-8a08-df8c13ff997f</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;The evaluation software for the DRV8711 stepper motor controller kit is very good.&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/611x447/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-c11b0eef-16fa-40ce-8a08-df8c13ff997f/4670.contentimage_5F00_204201.png:611:447]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;You can use it to test the driver IC (you need a &lt;span&gt;&lt;span class="e14-init-shown" id="addProduct-dh8pJ8Hu-linked"&gt;&lt;a class="jive-link-product-addtolist" href="https://www.element14.com/community/view-product.jspa?fsku=1853793&amp;amp;nsku=77R3863&amp;amp;COM=noscript" target="_blank"&gt;&lt;span class="pf-widget-map pf-productlink-cart-icon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;a class="jive-link-product pf-embedded-product-link" href="https://www.element14.com/community/view-product.jspa?fsku=1853793&amp;amp;nsku=77R3863&amp;amp;COM=noscript" target="_blank"&gt;MSP-EXP430G2&lt;/a&gt;&lt;/span&gt;&lt;span class="e14-init-hidden" id="addProduct-dh8pJ8Hu-unlinked"&gt;MSP-EXP430G2&lt;/span&gt;&lt;/span&gt; LaunchPad but that one is cheap)&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;You can set motor control parameters. They are dependent on the (current of the) motor you have,&lt;/p&gt;&lt;p&gt;Several scenarios can be validated and played with.&lt;/p&gt;&lt;p&gt;This helps to better understand the datasheet.&lt;/p&gt;&lt;p&gt;It documents all the register settings and what they do. But getting smooth operation is not that easy by just staring at a PDF.&lt;/p&gt;&lt;p&gt;With the GUI, you can observe the motor behaviour, and then check what configuration settings were applied to the driver:&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/606x435/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-c11b0eef-16fa-40ce-8a08-df8c13ff997f/8865.contentimage_5F00_204202.png:606:435]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;You can also evaluate the other way around. If you know the register values that a particular firmware uses, you can enter those values in the GUI.&lt;/p&gt;&lt;p&gt;The registers are broken up in their meaningful entities. There&amp;#39;s support to show the raw HEX values.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;You can change the registers in the GUI and write them to the driver IC. You can see the motor&amp;#39;s behaviour under the circumstances directly.&lt;/p&gt;&lt;p&gt;This works more intuitive than changing the code and running the firmware again.&lt;/p&gt;&lt;p&gt;It also helps to find out what the maximum reliable speed is for your motor in a particular application and what an acceptable acceleration rate looks like.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I used this program in this blog series to set up a smooth full-step motor pattern and to see what frequencies and accelerations are OK for my motor.&lt;/p&gt;&lt;p&gt;It&amp;#39;s part of the next step in the series, where I&amp;#39;ll try to let the BB PRU calculate a nice smooth trapezoid velocity ramp.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/596x408/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-c11b0eef-16fa-40ce-8a08-df8c13ff997f/4263.contentimage_5F00_204203.jpg:596:408]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Real good evaluation utilities can give a head start. This GUI has done that in the past when I developed for the programmable timer controller of a Hercules MCU.&lt;/p&gt;&lt;p&gt;I&amp;#39;m using (and appreciating) it again now for the BeagleBone&amp;#39;s PRU programming.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=7543&amp;AppID=80&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: BeagleBone Control Stepper Motors with PRU - Part 5: It Works</title><link>https://community.element14.com/products/devtools/single-board-computers/next-genbeaglebone/b/blog/posts/beaglebone-control-stepper-motors-with-pru---part-5-it-works</link><pubDate>Fri, 02 Aug 2019 20:52:53 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:c11b0eef-16fa-40ce-8a08-df8c13ff997f</guid><dc:creator>DAB</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Great finish Jan.&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=7543&amp;AppID=80&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>