tag:blogger.com,1999:blog-61997610531373397832024-03-14T02:22:11.517-07:00Robots and ElectronsBuilding Intelligent robots for everyoneAnonymoushttp://www.blogger.com/profile/16058247556622778678noreply@blogger.comBlogger18125tag:blogger.com,1999:blog-6199761053137339783.post-88701937082323702562014-02-06T20:53:00.001-08:002014-02-06T20:53:50.373-08:00The Dual Motor Controller Cape (DMCC) five months later...<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-agxXRFraesM/UvRhUdoVJOI/AAAAAAAACl4/b6f3Yvyoqt0/s1600/DMCC-Slice.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-agxXRFraesM/UvRhUdoVJOI/AAAAAAAACl4/b6f3Yvyoqt0/s1600/DMCC-Slice.jpg" height="122" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Since we started selling the <a href="http://exadler.myshopify.com/products/dual-motor-controller-cape-dmcc-mk-6">DMCC (Dual Motor Controller Cape)</a> five months ago, I've had the pleasure of talking to several customers who have purchased the DMCC, and boy, do they have interesting uses and projects. We've had people trying to use it to raise/lift TV sets from hidden panels, others trying to build underwater ROV's, and even flying drones! The latest use came in from <a href="http://www.dwavesys.com/en/dw_homepage.html">D-Wave Systems</a>, a maker of quantum computers (now, how cool is that!). Apparently they were using the DMCC with a Beaglebone White<span style="background-color: white; color: #222222; font-family: Tahoma; font-size: 13.63636302947998px;"> </span><span style="background-color: white; color: #222222; font-family: Tahoma; font-size: 13.63636302947998px;">“.. to cryogenically stress-test parts for D-Wave Systems’ quantum computer.”</span><span style="background-color: white; color: #222222; font-family: Tahoma; font-size: 13.63636302947998px;"> </span>(Now that's cool! -- pun intented).</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
Anonymoushttp://www.blogger.com/profile/16058247556622778678noreply@blogger.com0tag:blogger.com,1999:blog-6199761053137339783.post-71077423899178685612013-11-04T11:11:00.001-08:002013-11-04T11:11:23.398-08:00Setting the Correct Date/Time on a BeagleBone BlackI got tired to typing in<br />
<pre style="padding-left: 60px;"><code>ntpdate -b pool.ntp.org</code></pre>
everytime I rebooted my BeagleBone Black. So, I searched around and found the following command will automatically set the correct time/date after every boot.
<br />
<pre style="padding-left: 60px;"><code>/usr/lib/connman/test/set-global-timeservers pool.ntp.org</code></pre>
I'm also collecting these tips on this page: <a href="http://exadler.myshopify.com/pages/beaglebone-black-useful-tips">http://exadler.myshopify.com/pages/beaglebone-black-useful-tips</a>.<br />
Anonymoushttp://www.blogger.com/profile/16058247556622778678noreply@blogger.com0tag:blogger.com,1999:blog-6199761053137339783.post-49205333479893172662013-10-30T16:55:00.005-07:002013-10-30T16:56:38.645-07:00Building more DMCC's (Dual Motor Controller Capes).We were running low on our inventory of <a href="http://exadler.myshopify.com/">DMCC Mk.6 (Dual Motor Controller Capes)</a>, so I had to take some time to build them. I'm now using the stencil cutting technique from<br />
<div>
<a href="http://dangerousprototypes.com/forum/viewtopic.php?f=68&t=5341">http://dangerousprototypes.com/forum/viewtopic.php?f=68&t=5341</a> on my Silhouette Cameo cutter <a href="http://www.silhouetteamerica.com/select-a-silhouette">http://www.silhouetteamerica.com/select-a-silhouette</a>. The results are much better with the gerber2graphtec code from <a href="https://github.com/pmonta/gerber2graphtec">https://github.com/pmonta/gerber2graphtec</a>. </div>
<div>
<div>
<br /></div>
</div>
<div>
Anyways, here's a fun picture of a Beaglebone Black surrounded by DMCC's:</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-mEBbGfBuUwY/UnGb1Fx80eI/AAAAAAAACKA/GF777Kvm_gI/s1600/Beaglebone-Surrounded-by-Dual-Motor-Controller-Capes.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://1.bp.blogspot.com/-mEBbGfBuUwY/UnGb1Fx80eI/AAAAAAAACKA/GF777Kvm_gI/s1600/Beaglebone-Surrounded-by-Dual-Motor-Controller-Capes.JPG" height="265" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Beaglebone Black Surrounded!</td></tr>
</tbody></table>
<div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/16058247556622778678noreply@blogger.com0tag:blogger.com,1999:blog-6199761053137339783.post-19538599701736279682013-10-19T18:28:00.001-07:002013-10-19T18:28:47.604-07:00BeagleBone GPIO in C for iGaging DROI'm currently trying to build a DRO interface to iGaging scales based on Yuriy's work : <a href="http://www.yuriystoys.com/p/android-dro.html">http://www.yuriystoys.com/p/android-dro.html</a>. As a first step, I have to duplicate the signal pulses from the iGaging controller using the BeagleBone Black GPIOs.<br />
<br />
I scoped out my iGaging controller and found that it is providing clock pulses of 24uSec pulse width with a duty cycle of 128uSec. The iGaging protocol is basically a synchronous clock read only protocol with 21 bits.<br />
<br />
After Google'ing many, many sites, (and no, I can't use Python, as I need microsecond level control of the pulses, Python would definitely be too slow), I found some sites that recommend using buffered writes (fopen/fwrite). Attempting that at first led me down an unreliable path. I eventually changed the write methods to use low level unix i/o (open/write), and that gave me much better results.<br />
<br />
Here are some oscilloscope screenshots showing multiple runs of the code. Note that there is a random variable pulse delay that occurs on occasion. That's probably something going on in the Linux O/S (which is why Linux is not meant to be a real time operating system!). I'll eventually rewrite the code to use the BeagleBone's PRU (Programmable Realtime Unit - <a href="http://processors.wiki.ti.com/index.php/Programmable_Realtime_Unit">http://processors.wiki.ti.com/index.php/Programmable_Realtime_Unit</a> ) but I'm going to see if the iGaging scales will work even with the extra pulse delay.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://4.bp.blogspot.com/-ZDj1BOMAhg8/UmMwWwAICYI/AAAAAAAACI0/NB0WTOxGIF4/s1600/GPIO2.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://4.bp.blogspot.com/-ZDj1BOMAhg8/UmMwWwAICYI/AAAAAAAACI0/NB0WTOxGIF4/s1600/GPIO2.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">10 Pulses correctly spaced</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://4.bp.blogspot.com/-L_meI7Qw_7U/UmMwUMNf1SI/AAAAAAAACIg/LYZOUj0Tsq8/s1600/GPIO3.PNG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://4.bp.blogspot.com/-L_meI7Qw_7U/UmMwUMNf1SI/AAAAAAAACIg/LYZOUj0Tsq8/s1600/GPIO3.PNG" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Random delay before last pulse</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/-dJK_9viIZsg/UmMwU0nrWDI/AAAAAAAACIo/2jU830-KnqA/s1600/GPIO4.PNG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://2.bp.blogspot.com/-dJK_9viIZsg/UmMwU0nrWDI/AAAAAAAACIo/2jU830-KnqA/s1600/GPIO4.PNG" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Delay on the high portion of the 2nd pulse</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-6Q6puMN4cXU/UmMwUEp02EI/AAAAAAAACIc/Szp8bhaByv4/s1600/GPIO1.PNG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://1.bp.blogspot.com/-6Q6puMN4cXU/UmMwUEp02EI/AAAAAAAACIc/Szp8bhaByv4/s1600/GPIO1.PNG" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Delay in the middle of the pulse train</td></tr>
</tbody></table>
<br />
<br />
Here's the code I'm using right now to test (feel free to use it as a basis for your GPIO code):<br />
<pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> //
// BB-DRO.c - Read iGaging Scales on a BeagleBone Black
//
// Copyright (C) 2013, Exadler Technologies Inc.
// http://www.exadler.com
//
// Based on a similar work (ArduinoDRO_V2_2) by Yuriy Krushelnytskiy
// http://www.yuriystoys.com
//
// This code is is licensed under
// Creative Commons Attribution-ShareAlike 3.0 Unported License.
//
//
//
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//
// Setup GPIO and return a unix file descriptor handle to
// that GPIO. The user must close that file descriptor when finished
//
int setupGPIO(char *pszGPIO, char *pszDir)
{
int fd;
int len;
int result;
char buf[120];
if (pszGPIO == NULL) {
printf("Error: pszGPIO is NULL!\n");
exit(1);
}
if (pszDir == NULL) {
printf("Error: pszDir is NULL!\n");
exit(1);
}
if ((strcmp(pszDir,"in") != 0) && (strcmp(pszDir,"out") != 0)) {
printf("Error: pszDir must be either 'in' or 'out'\n");
exit(1);
}
len = strlen(pszGPIO);
if ((len < 1) || (len > 40)) {
printf("Error: pszGPIO = %s is too long or too short\n",pszGPIO);
exit(1);
}
// First enable GPIO30
fd = open("/sys/class/gpio/export",O_WRONLY | O_APPEND);
if (fd == -1) {
printf("Cannot open /sys/class/gpio/export to setup GPIO\n");
exit(1);
}
result = write( fd, pszGPIO, len );
if (result != len) {
printf("Cannot write to /sys/class/gpio/export to setup GPIO %s\n",pszGPIO);
printf("Wrote %d bytes\n",result);
close(fd);
// Remove exiting here for now
// as it will fail if the GPIO was already exported
// so just ignore the error
// exit(1);
}
close(fd);
// Now set GPIO 30 direction to output
sprintf(buf, "/sys/class/gpio/gpio%s/direction", pszGPIO);
fd = open(buf,O_WRONLY);
if (fd == -1) {
printf("Cannot open %s to setup GPIO\n",buf);
exit(1);
}
result = write( fd, pszDir, strlen(pszDir) );
if (result != strlen(pszDir)) {
printf("Cannot write to %s setup GPIO\n", buf);
close(fd);
exit(1);
}
close(fd);
// Now open the GPIO value for writing
sprintf(buf, "/sys/class/gpio/gpio%s/value", pszGPIO);
fd = open(buf,O_WRONLY);
if (fd == -1) {
printf("Cannot open %s to write to the GPIO\n", buf);
exit(1);
}
return fd;
}
//
// freeGPIO - release the GPIO port
//
void freeGPIO(char *pszGPIO)
{
int fd;
int len;
int result;
if (pszGPIO == NULL) {
printf("Error: pszGPIO is NULL!\n");
exit(1);
}
// unexport the GPIO
// First open the unexport file
fd = open("/sys/class/gpio/unexport",O_WRONLY );
if (fd == -1) {
printf("Cannot open /sys/class/gpio/unexport to free GPIO\n");
exit(1);
}
len = strlen(pszGPIO);
result = write( fd, pszGPIO, len );
if (result != len) {
printf("Cannot write to /sys/class/gpio/unexport to setup GPIO %s\n",pszGPIO);
printf("Wrote %d bytes\n",result);
close(fd);
// Remove exiting here for now
// as it will fail if the GPIO was already exported
// so just ignore the error
// exit(1);
}
close(fd);
}
inline void tickTock(int fd)
{
int result;
int j;
if (fd == -1) {
printf("Error: tickTock called with bad fd\n");
exit(1);
}
for (j=0;j<1000;j++) ;
result = write( fd, "1" , 1);
if (result != 1) {
printf("Cannot write to fd to set GPIO\n");
close(fd);
exit(1);
}
for (j=0;j<1000;j++) ;
result = write( fd, "0" , 1);
if (result != 1) {
printf("Cannot write to fd to set GPIO\n");
close(fd);
exit(1);
}
}
int main(int argc, char *argv[])
{
int fd30;
// First enable GPIO30
fd30 = setupGPIO("30","out");
int i;
for (i=0; i < 10; i++) {
tickTock(fd30);
}
close(fd30);
// freeGPIO("30");
return 0;
}
</code></pre>
<br />
<br />
<br />
<br />Anonymoushttp://www.blogger.com/profile/16058247556622778678noreply@blogger.com0tag:blogger.com,1999:blog-6199761053137339783.post-34415551763408789892013-10-16T14:23:00.001-07:002013-10-16T14:24:38.336-07:00Laser Cut CR2032 Battery Holder<div class="separator" style="clear: both; text-align: left;">
I had a number of CR2032 lying around (purchased a bunch from Digikey, and the original container broke), so I quickly made a battery holder for them. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-D2CNucc6Cgc/Ul8CDyoCC8I/AAAAAAAACHQ/vjPJKTvemH8/s1600/DSC03695.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-D2CNucc6Cgc/Ul8CDyoCC8I/AAAAAAAACHQ/vjPJKTvemH8/s1600/DSC03695.JPG" height="266" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-jUyyYVBWqPw/Ul8CFSTeUiI/AAAAAAAACHY/KsFY6p1I2i4/s1600/DSC03694.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-jUyyYVBWqPw/Ul8CFSTeUiI/AAAAAAAACHY/KsFY6p1I2i4/s1600/DSC03694.JPG" height="266" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
I created the design using CamBam (<a href="http://www.cambam.info/">http://www.cambam.info/</a>) -- really great CAM software, and it can do really basic CAD as well -- highly recommended. I then exported the file as a DXF from CamBam, imported the file using Visio 2010, and then printed it as an XPS file (the format recognized by the Full Spectrum Laser software). Files are available on thingverse at <a href="http://www.thingiverse.com/thing:166866">http://www.thingiverse.com/thing:166866</a>. The whole project took me about 30 minutes to design, CAD/CAM, Laser Cut, tap the holes, and make, and about 2 hours to take a few pictures, upload it to thingverse, and blog about it. Whew... talk about documentation taking longer than it does to make it!<br />
<div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/16058247556622778678noreply@blogger.com0tag:blogger.com,1999:blog-6199761053137339783.post-14198171754207321072013-10-15T11:12:00.001-07:002013-10-15T11:12:17.011-07:00BeagleBone Black controlling a motor with Python<div class="separator" style="clear: both; text-align: left;">
Finally got the preliminary Python interface done to the DMCC (Dual Motor Controller Cape). Here's a quick YouTube video on how to use it. </div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/9zvqSqpg-Gc?feature=player_embedded' frameborder='0'></iframe></div>
<br />
<br />
The DMCC open source schematics can be found at <a href="https://github.com/Exadler/DualMotorControlCape">https://github.com/Exadler/DualMotorControlCape</a>.<br />
<br />
The DMCC Library can be found at <a href="https://github.com/Exadler/DMCC_Library">https://github.com/Exadler/DMCC_Library</a><br />
<br />
The DMCC boards can be bought at <a href="http://exadler.myshopify.com/">http://exadler.myshopify.com</a><br />
<br />
<br />Anonymoushttp://www.blogger.com/profile/16058247556622778678noreply@blogger.com0tag:blogger.com,1999:blog-6199761053137339783.post-82193312777984879812013-10-13T21:47:00.002-07:002013-10-13T22:09:34.294-07:00Building a Python interface to C for the Beaglebone Black<h2>
Making Python talk to a C library on the Beaglebone Black</h2>
<div>
Since we have a working <a href="http://exadler.myshopify.com/products/dual-motor-controller-cape-dmcc-mk-6">DMCC (Dual Motor Controller Cape)</a> Library in C (see our github repository at <a href="https://github.com/Exadler/DMCC_Library">https://github.com/Exadler/DMCC_Library</a>), now the hard part begins... getting Python to work with it.</div>
<div>
<br /></div>
<div>
<i>Disclaimer: I'm new to Python, and although I have extensive C and C++ experience, this will be a learning exercise for me, so if I make any obvious mistakes, please, please, comment and point me in the right direction!</i></div>
<div>
<i><br /></i></div>
<div>
First step was to hit the python docs returned from a Google search: <a href="http://docs.python.org/2/extending/extending.html">http://docs.python.org/2/extending/extending.html</a>, and ok, good, the first bullet point is <b>"1.1. A Simple Example"</b>.</div>
<div>
<br /></div>
<div>
After reading through the "Simple" example, I'm now really confused. The Intermezzo on Errors and Exceptions threw me off -- Do I, or don't I have to deal with Errors and Exceptions immediately before I can successfully compile a Python extension in C?? After deciding that I should handle the errors, I cut and paste the code from the Intermezzo section 1.2. into my Beaglebone, only to find in Section 1.3. Back to the Example, they don't have the error handling code!! Ok, great, silly detour.</div>
<div>
<br /></div>
<div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://4.bp.blogspot.com/-8TsmdxpYanQ/UltvUfzEFvI/AAAAAAAACG0/VRhuNTk9rEQ/s1600/SpamModule.PNG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="400" src="http://4.bp.blogspot.com/-8TsmdxpYanQ/UltvUfzEFvI/AAAAAAAACG0/VRhuNTk9rEQ/s400/SpamModule.PNG" width="380" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Detour of Simple Example from Python C extension</td></tr>
</tbody></table>
<br />
Fine, keep going. I get down to section <b>"1.4. The Module's Method Table and Initialization Function"</b>. Ok, we have to put in a table of commands -- but where?? Do I put it in a separate file, and there is a main() function?! I thought I was building a library extension, why is there a main? Also, how do I install it in the system?? I'm confused?!!</div>
<div>
<br /></div>
<div>
<i>Note: I decided to write this blog entry as I'm learning the system, because I am finding it very confusing, and hopefully this will help the next person that is just as confused as I am!</i></div>
<div>
<i><br /></i></div>
<div>
Ok, Google time! Searching the web, I get several hits talking about using SWIG, Boost.Python, pyrex, and ctypes. From this stackoverflow.com posting (<a href="http://stackoverflow.com/questions/145270/calling-c-c-from-python">http://stackoverflow.com/questions/145270/calling-c-c-from-python</a>), ctypes look simple enough, and there's the compilation steps!! </div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-w2z1pJIZS6E/UltxmJAno-I/AAAAAAAACHA/GflmjC8gn7o/s1600/python-ctypes.PNG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="275" src="http://1.bp.blogspot.com/-w2z1pJIZS6E/UltxmJAno-I/AAAAAAAACHA/GflmjC8gn7o/s400/python-ctypes.PNG" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">ctypes and python with steps!</td></tr>
</tbody></table>
Ok, try typing in the sample code. I understand enough C++ that this actually makes sense to me. So, I'm thinking, this should be a breeze... Everything compiles and then... BAM! When I get to the steps in python to call the library:<br />
<div>
<br />
<div>
<pre class="default prettyprint prettyprinted" style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; line-height: 18px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;"><code style="border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="kwd" style="background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;">from</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> ctypes </span><span class="kwd" style="background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;">import</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> cdll
lib </span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">=</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> cdll</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="typ" style="background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;">LoadLibrary</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span class="str" style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">'./libfoo.so'</span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">)</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
</span></code></pre>
<div>
I get the following error:</div>
<div>
<blockquote class="tr_bq">
<span style="color: #444444;"><span style="font-family: Courier New, Courier, monospace;">root@beaglebone:~/python# python</span></span></blockquote>
<blockquote class="tr_bq">
<span style="color: #444444; font-family: Courier New, Courier, monospace;">Python 2.7.3 (default, May 29 2013, 21:25:00)</span><span style="color: #444444; font-family: Courier New, Courier, monospace;">[GCC 4.7.3 20130205 (prerelease)] on linux2</span><span style="color: #444444; font-family: Courier New, Courier, monospace;">Type "help", "copyright", "credits" or "license" for more information.</span></blockquote>
<blockquote class="tr_bq">
<span style="color: #444444; font-family: Courier New, Courier, monospace;">>>> from ctypes import cdll</span><span style="color: #444444; font-family: Courier New, Courier, monospace;">Traceback (most recent call last):</span><span style="color: #444444; font-family: Courier New, Courier, monospace;"> File "<stdin>", line 1, in <module></span></blockquote>
<blockquote class="tr_bq">
<span style="color: #444444; font-family: Courier New, Courier, monospace;">ImportError: No module named ctypes</span></blockquote>
<blockquote class="tr_bq">
<span style="color: #444444; font-family: Courier New, Courier, monospace;">>>></span></blockquote>
</div>
<div>
Just great!! I don't have ctypes on the Beaglebone black! Googling the error yields many cryptic pages. Arrggh! </div>
<div>
<br /></div>
<div>
Ok, don't panic, just go back and Google some more. Finally I find this blog entry from Ned Batchelder (<a href="http://nedbatchelder.com/text/whirlext.html">http://nedbatchelder.com/text/whirlext.html</a>), and it actually makes sense! A good step by step guide! I especially liked his slides titled <b>"It really works"</b>. Perfect! The only little thing that was a bit confusing about Ned's guide is whether setup.py was a built in function or whether it was the file from the slide <b>"Building it"</b>. I'm assuming that I had to type it in based upon the comments (what threw me off is his comments about <b>"setup.py knows how to do it with simple declarative.."</b>, and the fact that the slides seems to have too little code. Ok, never mind, just create my setup.py and try typing in "python setup.py". BAM! Another gotcha!</div>
<div>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">root@beaglebone:~# python</span></blockquote>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">Python 2.7.3 (default, Apr 3 2013, 21:37:23)</span><span style="font-family: Courier New, Courier, monospace;">[GCC 4.7.3 20130205 (prerelease)] on linux2</span><span style="font-family: Courier New, Courier, monospace;">Type "help", "copyright", "credits" or "license" for more information.</span></blockquote>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">>>> from distutils.core import setup, Extension</span><span style="font-family: Courier New, Courier, monospace;">Traceback (most recent call last):</span><span style="font-family: Courier New, Courier, monospace;"> File "<stdin>", line 1, in <module></span></blockquote>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">ImportError: No module named distutils.core</span></blockquote>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">>>></span></blockquote>
</div>
<div>
Ok, don't panic, just Google it. Finally found this stackoverflow.com link: <a href="http://stackoverflow.com/questions/3810521/how-to-install-python-distutils">http://stackoverflow.com/questions/3810521/how-to-install-python-distutils</a>, and wow, someone else is also using the Beaglebone black and Angstrom!</div>
<div>
<br /></div>
<div>
Did the opkg update and opkg install python-distutils, and Ned's code worked! Well, almost -- I got this far:</div>
<div>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">root@beaglebone:~/python# python setup.py<br />usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]<br /> or: setup.py --help [cmd1 cmd2 ...]<br /> or: setup.py --help-commands<br /> or: setup.py cmd --help<br />error: no commands supplied<br />root@beaglebone:~/python#</span></blockquote>
</div>
<div>
Hmm... there's a help? Let's try it. First few lines gave me the key:</div>
<div>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">root@beaglebone:~/python# python setup.py --help<br />Common commands: (see '--help-commands' for more)<br /> setup.py build will build the package underneath 'build/'<br /> setup.py install will install the package<br />...</span></blockquote>
</div>
<div>
Let's try the build and install, bingo! It worked!</div>
<div>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">root@beaglebone:~/python# python setup.py build<br />running build<br />running build_ext<br />building 'ext1' extension<br />arm-angstrom-linux-gnueabi-gcc -march=armv7-a -mthumb-interwork -mfloat-abi=softfp -mfpu=neon -mtune=cortex-a8 -D__SOFTFP__ -fno-strict-aliasing -O2 -pipe -g -feliminate-unused-debug-types -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c ext1.c -o build/temp.linux-armv7l-2.7/ext1.o<br />arm-angstrom-linux-gnueabi-gcc -march=armv7-a -mthumb-interwork -mfloat-abi=softfp -mfpu=neon -mtune=cortex-a8 -D__SOFTFP__ -shared -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed build/temp.linux-armv7l-2.7/ext1.o -L/usr/lib -lpython2.7 -o build/lib.linux-armv7l-2.7/ext1.so<br />root@beaglebone:~/python#<br />root@beaglebone:~/python#<br />root@beaglebone:~/python# python setup.py install<br />running install<br />running build<br />running build_ext<br />running install_lib<br />copying build/lib.linux-armv7l-2.7/ext1.so -> /usr/lib/python2.7/site-packages<br />running install_egg_info<br />Removing /usr/lib/python2.7/site-packages/UNKNOWN-0.0.0-py2.7.egg-info<br />Writing /usr/lib/python2.7/site-packages/UNKNOWN-0.0.0-py2.7.egg-info<br />root@beaglebone:~/python#<br />root@beaglebone:~/python#</span></blockquote>
</div>
<div>
Trying to run the extension in the python command line we get</div>
<div>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">root@beaglebone:~/python# python<br />Python 2.7.3 (default, May 29 2013, 21:25:00)<br />[GCC 4.7.3 20130205 (prerelease)] on linux2<br />Type "help", "copyright", "credits" or "license" for more information.<br />>>> import ext1<br />>>> ext1.hello_world()<br /> hello_world called<br />'hello, world!'<br />>>></span></blockquote>
</div>
<div>
Yay!! I works!! Ok, enough working on the code for the day, we got the first steps and now I'm calling it a night. For reference, here is the ext1.c file:</div>
<div>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">// ext1.c: A sample C extension: one simple function<br />#include "Python.h"<br />// hello_world function.<br />static PyObject *<br />hello_world(PyObject *self, PyObject *args)<br />{<br /> printf(" hello_world called\n");<br /> return Py_BuildValue("s", "hello, world!");<br />}<br />// Module functions table.<br />static PyMethodDef<br />module_functions[] = {<br /> { "hello_world", hello_world, METH_VARARGS, "Say hello." },<br /> { NULL }<br />};<br />// This function is called to initialize the module.<br />void<br />initext1(void)<br />{<br /> Py_InitModule3("ext1", module_functions, "A minimal module.");<br />}</span></blockquote>
</div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
Hope this helps someone, because I sure could have used this help many, many, many hours ago! And, for those python gurus out there, let me know if I'm missing something or if I'm on the right track! Thanks.</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/16058247556622778678noreply@blogger.com0tag:blogger.com,1999:blog-6199761053137339783.post-64460730285765624952013-09-23T15:53:00.000-07:002013-09-24T09:08:33.200-07:00Toronto Maker Faire and New ProductsA big thanks to everyone that visited us at the Toronto Maker Faire. We enjoyed meeting everyone.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-BJa-5_iisX8/UkC418VFWDI/AAAAAAAACBw/ahVJR3U67ck/s1600/20130922_172953.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://1.bp.blogspot.com/-BJa-5_iisX8/UkC418VFWDI/AAAAAAAACBw/ahVJR3U67ck/s1600/20130922_172953.jpg" height="225" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Our table at the Toronto Maker Faire</td></tr>
</tbody></table>
<br />
At the Maker Faire, we also brought out a few new products. First we have our Encoder 5132 - a Quadrature encoder that is pin compatible with the US Digital E4P - <a href="http://www.usdigital.com/products/encoders/incremental/rotary/kit/E4P">http://www.usdigital.com/products/encoders/incremental/rotary/kit/E4P</a>. We had originally intended to use the E4P in our robot designs, but a few months ago we tried to order some more E4P's and noticed the following:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-i0leuiC0Pl4/UkC7RqbOKKI/AAAAAAAACB8/hAkMZWf18_w/s1600/USDigital-E4P-Not_recommended_for_new_designs.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-i0leuiC0Pl4/UkC7RqbOKKI/AAAAAAAACB8/hAkMZWf18_w/s1600/USDigital-E4P-Not_recommended_for_new_designs.PNG" height="193" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
The E4P is not recommended for new product development! Yikes! So that revelation led us to design and build the Encoder 5132, making sure that it was a pin for pin replacement for the E4P. You can see more specifications of our encoder at <a href="http://exadler.myshopify.com/products/encoder-5132">http://exadler.myshopify.com/products/encoder-5132</a>. The good news is that we are making it for sale for everyone at a much cheaper price than the E4P ($25 vs $40 -- see <a href="http://www.andymark.com/product-p/am-0174.htm">http://www.andymark.com/product-p/am-0174.htm</a>), and we're throwing in the cable. The bad news is that it actually takes me a long time to lathe the shaft needed for the Encoder 5132, as I needed to get the tolerances under 0.5mm. However, now I have an excuse to CNC convert my lathe!!<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-uG9XYebKmp4/UkDH2dRwcsI/AAAAAAAACCY/f2rqYSCdjZc/s1600/touch+up+of+encorder.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://1.bp.blogspot.com/-uG9XYebKmp4/UkDH2dRwcsI/AAAAAAAACCY/f2rqYSCdjZc/s1600/touch+up+of+encorder.jpg" height="320" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Quadrature Encoder 5132</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
</div>
For those of you who are unfamiliar with quadrature encoders, they are basically rotation sensors that can tell you how many rotations/degrees the shaft has turned. They put out a signal on two wires like this:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-c6LYKo-0YXQ/UkDInEDtcXI/AAAAAAAACCg/LD8QGU1A6hk/s1600/600px-Quadrature_Diagram.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://1.bp.blogspot.com/-c6LYKo-0YXQ/UkDInEDtcXI/AAAAAAAACCg/LD8QGU1A6hk/s1600/600px-Quadrature_Diagram.png" height="132" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Signals from quardature encoder with the shaft rotating clockwise</td></tr>
</tbody></table>
Each pulse is basically one degree of turn. The reason for having two signals (A and B) is so that you can tell whether the shaft is turning clockwise or counter clockwise by observing which signal is rising first. Our DMCC Mk.6 board has two Quadrature Encoder inputs that take the signals and count how many degrees the shaft has rotated. So, with a simple 'C' library call to our <a href="https://github.com/Exadler/DMCC_Library">DMCC Library</a> you can get the exact position (well, to 1 degree) the shaft has turned, or even the velocity of the shaft.<br />
<div>
<br /></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">// -------------------------- </span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">// Quadrature Encoder Interface (QEI) functions </span><span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span><span style="font-family: Courier New, Courier, monospace; font-size: x-small;">// -------------------------- </span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">// getQEI - Gets the QEI for the desired motor </span><span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span><span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">// Prints an error if QEI for motor is not received </span><span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span><span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">// Parameters:</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">// fd - connection to the board (value returned from DMCCstart) </span><span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span><span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">// motor - motor number desired </span><span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span><span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">// Returns: QEI for given motor </span><span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span><span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">// always returns 0 if an error occurs </span><span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span><span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">unsigned int getQEI(int fd, unsigned int motor); </span><span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span><span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"><br /></span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">// getQEIVel - Gets the QEI velocity for the desired motor </span><span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span><span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">// Prints an error if QEI velocity for motor is not received </span><span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span><span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">// Parameters: </span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">// fd - connection to the board (value returned from DMCCstart) </span><span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span><span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">// motor - motor number desired </span><span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span><span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">// Returns: QEI velocity for given motor </span><span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span><span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">// always returns 0 if an error occurs </span><span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span><span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">int getQEIVel(int fd, unsigned int motor);</span><span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span><br />
<br />
After we got the encoder replacement working, we needed something to showcase at the Toronto Maker Faire, so we built <a href="http://exadler.myshopify.com/products/orbit-robot-assembled">Orbit the robot</a>! (also avaliable in <a href="http://exadler.myshopify.com/products/orbit-robot-unassembled">kit form</a>).<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://4.bp.blogspot.com/-kF7thmBd1Us/UkDFzyG4S2I/AAAAAAAACCM/SVJC4pXLzTw/s1600/DSC03645.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://4.bp.blogspot.com/-kF7thmBd1Us/UkDFzyG4S2I/AAAAAAAACCM/SVJC4pXLzTw/s1600/DSC03645.JPG" height="265" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Orbit Robot</td></tr>
</tbody></table>
The top plate, bottom plate, large gears, and small gears are all Laser cut from 1/8" acrylic. The white vertical pieces are CNC milled Delrin plastic, and the rest of the mechanical parts and motor is from Vex Robotics. We added in a Beaglebone Black and our DMCC Mk.6 Dual Motor Controller Cape, and voila! - Instant Robot.<br />
<br />
We had sold our assembled Orbit Robot on the first day of the show, so we were scrambling to quickly build another demo robot. It was a lot harder to build when we realized we forgot to bring the proper screwdriver (small phillips) to the show!<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://4.bp.blogspot.com/-Ns5D2vo52V4/UkDOuB-9VYI/AAAAAAAACCw/dWFJ3RYLV_4/s1600/Sam-soldering_Sarah-building_robot.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://4.bp.blogspot.com/-Ns5D2vo52V4/UkDOuB-9VYI/AAAAAAAACCw/dWFJ3RYLV_4/s1600/Sam-soldering_Sarah-building_robot.jpg" height="300" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Building a new Orbit Robot at the Toronto Maker Faire</td></tr>
</tbody></table>
<br />
<br />
<br />
<br /></div>
Anonymoushttp://www.blogger.com/profile/16058247556622778678noreply@blogger.com0tag:blogger.com,1999:blog-6199761053137339783.post-13310236104452951072013-09-18T09:01:00.001-07:002013-09-18T09:01:35.034-07:00<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-mH5-9DJNBeo/UjnOAiXHlLI/AAAAAAAAB-o/00u7Ec3IkKk/s1600/toronto_mmf_logos_wordpress.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-mH5-9DJNBeo/UjnOAiXHlLI/AAAAAAAAB-o/00u7Ec3IkKk/s1600/toronto_mmf_logos_wordpress.png" height="72" width="400" /></a></div>
<div>
<br /></div>
<div>
We'll be at the Toronto Maker Faire <a href="http://makerfairetoronto.com/">http://makerfairetoronto.com/</a>, showing our DMCC and a few robots. We hope to see you there.</div>
Anonymoushttp://www.blogger.com/profile/16058247556622778678noreply@blogger.com0tag:blogger.com,1999:blog-6199761053137339783.post-83250589470301730372013-09-15T09:58:00.003-07:002013-09-15T09:59:15.217-07:00<b>opkg upgrade </b>on a Beaglebone black is officially evil. Just don't do it. Bad things happen. Just flash to the latest image and do an <b>opkg update. </b>You should be good to go on your Beaglebone black.<br />
<br />Anonymoushttp://www.blogger.com/profile/16058247556622778678noreply@blogger.com0tag:blogger.com,1999:blog-6199761053137339783.post-70002904494939888442013-09-14T16:18:00.000-07:002013-09-14T21:20:48.243-07:00Updating Beaglebone black out of the box using ethernet and ssh seems to run into problems with opkg update; opkg upgrade step.<br />
<br />
Steps to reproduce:<br />
<br />
<ol>
<li> Get a brand new Beaglebone black out of the box</li>
<li>Upgrade the image to the 06-20-2013 image using an MMC card</li>
<ul>
<li>Used the link from <a href="http://beagleboard.org/latest-images">http://beagleboard.org/latest-images</a></li>
<li>Grabbed the eMMC flasher image</li>
<li>Uncompressed the image and burned a MicroSD card</li>
<li>Followed <a href="http://learn.adafruit.com/beaglebone-black-installing-operating-systems/flashing-the-beaglebone-black">http://learn.adafruit.com/beaglebone-black-installing-operating-systems/flashing-the-beaglebone-blac</a>k</li>
</ul>
<li>rebooted Beaglebone connected via Ethernet</li>
<li>ssh'ed into the Beaglebone black</li>
<li>ran "opkg update", everything ok</li>
<li>did "opkg upgrade", things work for a while and then you get<br /><blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">Downloading <a href="http://www.angstrom-distribution.org/feeds/unstable/ipk/glibc/armv7a//Packages.gz" style="border: 0px; color: #6611cc; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;" target="_blank">http://www.angstrom-<wbr></wbr>distribution.org/feeds/<wbr></wbr>unstable/ipk/glibc/armv7a//<wbr></wbr>Packages.gz</a>.</span><span style="font-family: Courier New, Courier, monospace;">wget: bad address '<a href="http://www.angstrom-distribution.org/" style="border: 0px; color: #6611cc; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;" target="_blank">www.angstrom-distribution.org</a><wbr></wbr>'</span><span style="font-family: Courier New, Courier, monospace;">Downloading <a href="http://feeds.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/base/Packages.gz" style="border: 0px; color: #6611cc; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;" target="_blank">http://feeds.angstrom-<wbr></wbr>distribution.org/feeds/v2012.<wbr></wbr>12/ipk/eglibc/armv7a-vfp-neon/<wbr></wbr>base/Packages.gz</a>.</span><span style="font-family: Courier New, Courier, monospace;">wget: bad address '<a href="http://feeds.angstrom-distribution.org/" style="border: 0px; color: #6611cc; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;" target="_blank">feeds.angstrom-distribution.<wbr></wbr>org</a>'</span><span style="font-family: Courier New, Courier, monospace;">Downloading <a href="http://feeds.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/machine/beaglebone/Packages.gz" style="border: 0px; color: #6611cc; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;" target="_blank">http://feeds.angstrom-<wbr></wbr>distribution.org/feeds/v2012.<wbr></wbr>12/ipk/eglibc/armv7a-vfp-neon/<wbr></wbr>machine/beaglebone/Packages.gz</a><wbr></wbr>.</span><span style="font-family: Courier New, Courier, monospace;">wget: bad address '<a href="http://feeds.angstrom-distribution.org/" style="border: 0px; color: #6611cc; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;" target="_blank">feeds.angstrom-distribution.<wbr></wbr>org</a>'</span><span style="font-family: Courier New, Courier, monospace;">Downloading <a href="http://feeds.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/debug/Packages.gz" style="border: 0px; color: #6611cc; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;" target="_blank">http://feeds.angstrom-<wbr></wbr>distribution.org/feeds/v2012.<wbr></wbr>12/ipk/eglibc/armv7a-vfp-neon/<wbr></wbr>debug/Packages.gz</a>.</span><span style="font-family: Courier New, Courier, monospace;">wget: bad address '<a href="http://feeds.angstrom-distribution.org/" style="border: 0px; color: #6611cc; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;" target="_blank">feeds.angstrom-distribution.<wbr></wbr>org</a>'</span></blockquote>
...</li>
</ol>
<div>
Steps to fix:</div>
<div>
<br /></div>
<div>
My quick hack is to edit /etc/hosts and add in the IP address of feeds.angstrom-distribution.org</div>
<blockquote class="tr_bq">
<blockquote class="tr_bq">
140.211.169.179 feeds.angstrom-distribution.org</blockquote>
</blockquote>
So, my /etc/hosts file now looks like<br />
<br />
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">root@beaglebone:~# cd /etc<br />root@beaglebone:/etc# vi hosts<br />root@beaglebone:/etc# cat hosts<br />127.0.0.1 localhost.localdomain localhost<br />140.211.169.179 feeds.angstrom-distribution.org<br />127.0.0.1 beaglebone<br />root@beaglebone:/etc#</span></blockquote>
<div>
Now, opkg upgrade seems to work fine.</div>
<div>
<br /></div>
<div>
Please note that this is a HACK. Please remove the line from your /etc/hosts after the upgrade is done.</div>
<blockquote class="tr_bq">
<br /></blockquote>
<div>
UPDATE:<br />
<br />
The upgrade finished, but had lots of errors of not enough space, and then it dropped the ssh connection. Rebooting it and attempting to restart opkg upgrade fails.<br />
<br />
I'm beginning to think the correct way is to avoid opkg upgrade, or as <a href="http://www.circuidipity.com/getting-started-with-beaglebone-black.html">http://www.circuidipity.com/getting-started-with-beaglebone-black.html</a> put it:</div>
<blockquote class="tr_bq">
<h3 style="font-family: YanoneKaffeesatzRegular, sans-serif; font-size: 1.2em; line-height: 24.625px;">
'opkg upgrade'</h3>
<div style="color: #333333; font-family: MerriweatherRegular, serif; font-size: 18px; line-height: 24.625px;">
<strong>Fix:</strong> Do not run this command or else Bad Things Will Happen.</div>
</blockquote>
<br />
<br />Anonymoushttp://www.blogger.com/profile/16058247556622778678noreply@blogger.com0tag:blogger.com,1999:blog-6199761053137339783.post-61274340856106467072013-09-12T23:32:00.000-07:002013-09-12T23:32:45.813-07:00<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-NtIQ87M8BJY/UjKxaJx8RtI/AAAAAAAAB-Y/oVcvhL5J_WE/s1600/2013-09-13+01.40.47-DMCC.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="245" src="http://2.bp.blogspot.com/-NtIQ87M8BJY/UjKxaJx8RtI/AAAAAAAAB-Y/oVcvhL5J_WE/s320/2013-09-13+01.40.47-DMCC.jpg" width="320" /></a></div>
<br />
First few boards have been built. Calling it a night and building more tomorrow.Anonymoushttp://www.blogger.com/profile/16058247556622778678noreply@blogger.com0tag:blogger.com,1999:blog-6199761053137339783.post-9546692442751635032013-09-12T07:56:00.000-07:002013-09-12T07:56:21.318-07:00Our web store is now launched at <a href="https://exadler.myshopify.com/">https://exadler.myshopify.com</a>, where you can actually buy the Dual Motor Controller Capes (DMCC Mk.6).<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-QQykouJ2Ug4/UjHV7oNwsBI/AAAAAAAAB7c/THSGZ5oiTMc/s1600/ExadlerShopify.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="http://4.bp.blogspot.com/-QQykouJ2Ug4/UjHV7oNwsBI/AAAAAAAAB7c/THSGZ5oiTMc/s400/ExadlerShopify.PNG" width="361" /></a></div>
<br />Anonymoushttp://www.blogger.com/profile/16058247556622778678noreply@blogger.com0tag:blogger.com,1999:blog-6199761053137339783.post-6237809326394271402013-09-11T20:47:00.000-07:002013-09-11T20:48:31.604-07:00<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-BADkp2uxlt0/UjE4hTLCPhI/AAAAAAAAB7E/zcMFgsebsiQ/s1600/20130910_192916.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="225" src="http://1.bp.blogspot.com/-BADkp2uxlt0/UjE4hTLCPhI/AAAAAAAAB7E/zcMFgsebsiQ/s400/20130910_192916.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">100 DMCC Mk.6 Boards</td></tr>
</tbody></table>
Got another shipment of DMCC Mk.6 blank boards. Time to start assembling them!<br />
<br />
Our store is also open now at <a href="https://exadler.myshopify.com/">https://exadler.myshopify.com</a> if you want to buy one of these assembled boards.<br />
<br />
<br />
<br />Anonymoushttp://www.blogger.com/profile/16058247556622778678noreply@blogger.com0tag:blogger.com,1999:blog-6199761053137339783.post-4368342967225486652013-07-25T13:23:00.001-07:002013-07-25T13:23:21.483-07:00DMCC Mk.5 does LED Lights!!<div class="separator" style="clear: both; text-align: left;">
We do lights!! Here we have two banks of LED lights controlled by the DMCC Mk.5 turning on and off using a PWM control program on the Beaglebone black.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/Ff58mhZMyWs?feature=player_embedded' frameborder='0'></iframe></div>
<br />
We were prompted to do this quick breadboard wiring when someone asked us if we could control a long string of LED lights. Our estimate based upon the current draw from this circuit is that we could control 800 LEDs (two sets of 400 LEDs) on a single DMCC (Dual Motor Controller Cape) board.<br />
<br />Anonymoushttp://www.blogger.com/profile/16058247556622778678noreply@blogger.com1tag:blogger.com,1999:blog-6199761053137339783.post-12609445858327493782013-07-10T15:29:00.000-07:002013-07-10T15:29:19.215-07:00The Mark 5 DMCC (Dual Motor Controller Cape) has been built! We are hoping to be able to sell these boards at the <a href="http://makerfairetoronto.com/">Toronto Maker Faire (http://makerfairetoronto.com)</a> on September 21-22.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-vZSGj4xLX-E/Ud2ql_r8BKI/AAAAAAAABcY/SqKMtvAg6Gg/s1600/20130710_140108.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="360" src="http://1.bp.blogspot.com/-vZSGj4xLX-E/Ud2ql_r8BKI/AAAAAAAABcY/SqKMtvAg6Gg/s640/20130710_140108.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">DMCC Mk.5 working!<br />(CR2032 coin cell left in picture accidentally - not used on board)</td></tr>
</tbody></table>
<br />
Here are the details on the connections of the board:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-fm_Jcbqv29M/Ud3S4I87hWI/AAAAAAAABeY/fPvAlhZtuuU/s1600/DMCC-Mk5-Layout.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="404" src="http://2.bp.blogspot.com/-fm_Jcbqv29M/Ud3S4I87hWI/AAAAAAAABeY/fPvAlhZtuuU/s640/DMCC-Mk5-Layout.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<br />
<ul>
<li><b>Quadrature Encoder Inputs 1 and 2:</b></li>
<ul>
<li>The connector is compatible with US Digital E4P encoders (used by FIRST robotics teams - <a href="http://www.usdigital.com/products/e4p">http://www.usdigital.com/products/e4p</a>)</li>
</ul>
<li><b>Cape ID Selector:</b></li>
<ul>
<li>Used to select a different cape ID for stacking up to 4 capes on the same Beaglebone black</li>
</ul>
<li><b>Motor Power LED:</b></li>
<ul>
<li>Indicates that there is power from the Motor Power Connector. The motors are powered from the Motor Power Connector instead of the Beaglebone black. This allows the DMCC (Dual Motor Controller Cape) to power motors of a different voltage rating (up to +28V DC)</li>
</ul>
<li><b>Motor 1 and 2 LED:</b></li>
<ul>
<li>These LEDs are dark (off) when the motors are not being powered. They light up GREEN when the motors are powered in forward motion, and they light up RED when the motors are powered in reverse motion.</li>
</ul>
<li><b>Motor 1 and 2 Connectors:</b></li>
<ul>
<li>Molex Micro-Fit (<a href="http://www.molex.com/molex/products/family?key=microfit_30&channel=products&chanName=family&pageTitle=Introduction">http://www.molex.com/molex/products/family?key=microfit_30&channel=products&chanName=family&pageTitle=Introduction</a>) connectors for the motors. The Micro-Fit connectors were used because they were the only connectors that would fit (height-wise) on the stackable capes.</li>
</ul>
<li><b>Motor Power Connector:</b></li>
<ul>
<li>This is the input power that powers the motors. A four pin Micro-Fit connector was used to provide the current required for driving two motors.</li>
</ul>
</ul>
<div>
<br /></div>
<div>
Here is a video showing the DMCC Mk.5 working:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/34xJIR-mD4A?feature=player_embedded' frameborder='0'></iframe></div>
<div class="separator" style="clear: both; text-align: center;">
DMCC Mk. 5</div>
<div>
<br /></div>
<div>
<br /></div>
<br />
<br />
<br />
<br />
<br />
<br />Anonymoushttp://www.blogger.com/profile/16058247556622778678noreply@blogger.com0tag:blogger.com,1999:blog-6199761053137339783.post-56994441036706966892013-06-05T19:00:00.001-07:002013-06-05T19:00:22.835-07:00<span style="font-family: Trebuchet MS, sans-serif;">Dual Motor Cape Version 4 is in!!</span><div>
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-orCc-HPzOEs/Ua_os1AvCmI/AAAAAAAABCY/Aq900dLCaC8/s1600/20130605_171838.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-orCc-HPzOEs/Ua_os1AvCmI/AAAAAAAABCY/Aq900dLCaC8/s1600/20130605_171838.jpg" height="180" width="320" /></a></div>
<div>
<br /></div>
<div>
<span style="font-family: Trebuchet MS, sans-serif;">I'm using the Silhouette Cameo Stencil cutting technique I found from <a href="http://www.idleloop.com/robotics/stencil/index.php">http://www.idleloop.com/robotics/stencil/index.php</a>. The results were good enough to use:</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-UWMguQ1mcB0/Ua_pZ-Z1i6I/AAAAAAAABCs/9PZTK_H9Fu0/s1600/20130605_171953.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-UWMguQ1mcB0/Ua_pZ-Z1i6I/AAAAAAAABCs/9PZTK_H9Fu0/s1600/20130605_171953.jpg" height="180" width="320" /></a></div>
<div>
<span style="font-family: Trebuchet MS, sans-serif;">Minor variations I found was that I had to set the physical cutter depth to 3 instead of 1 as indicated in Cathy Saxon's article.</span></div>
<div>
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Trebuchet MS, sans-serif;">Populating the board (except for missing J4, still in transit from Mouser):</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-jijKuIbgYPk/Ua_p8ieFw7I/AAAAAAAABC0/B6gtojfXLBo/s1600/20130605_213816.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-jijKuIbgYPk/Ua_p8ieFw7I/AAAAAAAABC0/B6gtojfXLBo/s1600/20130605_213816.jpg" height="640" width="360" /></a></div>
<div>
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Trebuchet MS, sans-serif;">One of the things you'll notice that I've changed is the motor and power connectors. I've using Molex Microfit connectors </span><span style="font-family: Trebuchet MS, sans-serif;"><a href="http://www.molex.com/molex/products/family?key=microfit_30&channel=products&chanName=family&pageTitle=Introduction">http://www.molex.com/molex/products/family?key=microfit_30&channel=products&chanName=family&pageTitle=Introduction</a>, instead of the screw terminals. The reason for the change is that I felt that using the screw terminals might be unreliable when using this board on a mobile robot. The only downside is that the Microfit connectors are rated at 5A max. I think I will have to leave it at that spec when I sell the boards (although you could always solder wires directly to the board to get a higher current -- the ST Micro HBridge chips are rated for up to 30A if you add a few heat sinks in). I'll probably keep the spec at 5A continuous, and 10A peak (violating the Microfit spec a bit -- they do spec the two circuit connector at 7A, but I want a little leeway).</span></div>
<div>
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/16058247556622778678noreply@blogger.com0tag:blogger.com,1999:blog-6199761053137339783.post-81651409941697441192013-05-02T11:53:00.003-07:002013-05-02T11:53:48.635-07:00Bringing up a new cape for the Beaglebone Black, i2c-1 is actually I2C2<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/-Q0qOGXRx9ds/UYKwQ3jgeRI/AAAAAAAAA1o/48fPICfSQac/s1600/DSC02976.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="213" src="http://2.bp.blogspot.com/-Q0qOGXRx9ds/UYKwQ3jgeRI/AAAAAAAAA1o/48fPICfSQac/s320/DSC02976.JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Dual Motor Controller Cape on top of Beaglebone Black!</td></tr>
</tbody></table>
<span style="font-family: Trebuchet MS, sans-serif;">I am currently trying to bring up the Dual Motor Controller Cape on the brand new Beaglebone Black, and finding out the gotchas along the way.</span><br />
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span>
<span style="font-family: Trebuchet MS, sans-serif;">First off, when I attempted to find all the i2c interfaces using i2cdetect, I got the following screen:</span><br />
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-QcZEysNzTIw/UYKydXngwrI/AAAAAAAAA1w/RuYB90sQW_c/s1600/Capture1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="245" src="http://4.bp.blogspot.com/-QcZEysNzTIw/UYKydXngwrI/AAAAAAAAA1w/RuYB90sQW_c/s320/Capture1.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<span style="font-family: Trebuchet MS, sans-serif;">Where is I2C2 ?? The Beaglebone is supposed to have 3 I2C interfaces, and I2C2 is supposed to be the one connected to the EEPROM of the capes.</span><br />
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span>
<span style="font-family: Trebuchet MS, sans-serif;">Fortunately, with help from panto on the IRC channel (freenode/#beagle), I found out that i2c-1 is actually I2C2. Executing the command 'i2cdetect -r 1' and monitoring on the scope actually proves that i2c-1 is actually I2C2!</span><br />
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-WHXX3w2yn9M/UYK0Qn1DrsI/AAAAAAAAA14/4Q9Zv0jyGhY/s1600/Capture2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="244" src="http://2.bp.blogspot.com/-WHXX3w2yn9M/UYK0Qn1DrsI/AAAAAAAAA14/4Q9Zv0jyGhY/s320/Capture2.PNG" width="320" /></a></div>
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/-Lhmh-yDnYYU/UYK1gFCtIwI/AAAAAAAAA2A/7yzx7D5YKQw/s1600/DSC02978.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="213" src="http://3.bp.blogspot.com/-Lhmh-yDnYYU/UYK1gFCtIwI/AAAAAAAAA2A/7yzx7D5YKQw/s320/DSC02978.JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">I2C2 SDA and SCLK</td></tr>
</tbody></table>
<br /><span style="font-family: Trebuchet MS, sans-serif;"><br /></span>Anonymoushttp://www.blogger.com/profile/16058247556622778678noreply@blogger.com1