tag:blogger.com,1999:blog-43099853821690138992024-03-14T09:10:41.220+01:00The Transparent RobotThe Arduino, Raspberry Pi and robot tinkering logÖlsöl en ölblogghttp://www.blogger.com/profile/17053931768398856946noreply@blogger.comBlogger80125tag:blogger.com,1999:blog-4309985382169013899.post-91685474715885694572018-02-11T13:13:00.001+01:002018-02-11T13:13:09.306+01:00Solar Panel Monitoring<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://img.dxcdn.com/productimages/sku_449087_1.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="700" data-original-width="700" height="320" src="https://img.dxcdn.com/productimages/sku_449087_1.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><a href="http://www.dx.com/p/gy-471-3a-range-max471-current-module-detection-sensor-purple-449087#.WoAxFHXOX0o" style="font-size: medium; text-align: start;">http://www.dx.com/p/gy-471-3a-range-max471-current-module-detection-sensor-purple-449087#.WoAxFHXOX0o</a></td></tr>
</tbody></table>
<br />
<br />
I found the following pinout:<br />
<br />
<br />
<blockquote class="tr_bq">
<strong style="background-color: white; border: 0px; box-sizing: border-box; color: #666666; font-family: titilliumweb, Arial, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Pinout </strong><br />
<strong style="background-color: white; border: 0px; box-sizing: border-box; color: #666666; font-family: titilliumweb, Arial, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Sensor</strong><span style="background-color: white; color: #666666; font-family: "titilliumweb" , "arial" , sans-serif; font-size: 15px;">RS+.........Load positive supply (3 to 36V)</span><span style="background-color: white; color: #666666; font-family: "titilliumweb" , "arial" , sans-serif; font-size: 15px;">RS-..........Connect to load or charger</span><br />
<strong style="background-color: white; border: 0px; box-sizing: border-box; color: #666666; font-family: titilliumweb, Arial, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Interface:</strong><span style="background-color: white; color: #666666; font-family: "titilliumweb" , "arial" , sans-serif; font-size: 15px;">RS+.........Alternative load positive supply (3 to 36V)</span><span style="background-color: white; color: #666666; font-family: "titilliumweb" , "arial" , sans-serif; font-size: 15px;">GND.........Connect to loads 0V/GND supply</span><span style="background-color: white; color: #666666; font-family: "titilliumweb" , "arial" , sans-serif; font-size: 15px;">OUT..........Current sensor output (1V / Amp, 3V max)</span><span style="background-color: white; color: #666666; font-family: "titilliumweb" , "arial" , sans-serif; font-size: 15px;">SIGN........Current flow direction. An open-collector logic output (low = current flow from RS+ to RS-).</span><span style="background-color: white; color: #666666; font-family: "titilliumweb" , "arial" , sans-serif; font-size: 15px;">GND.........Alternative GND (Connect to loads 0V/GND supply)</span><span style="background-color: white; color: #666666; font-family: "titilliumweb" , "arial" , sans-serif; font-size: 15px;">RS-...........Alternative load/charger connection.</span></blockquote>
From : <a href="http://hobbycomponents.com/sensors/900-max471-gy-471-3a-current-sensor-module">http://hobbycomponents.com/sensors/900-max471-gy-471-3a-current-sensor-module</a><br />
<br />
<br />Ölsöl en ölblogghttp://www.blogger.com/profile/17053931768398856946noreply@blogger.com0tag:blogger.com,1999:blog-4309985382169013899.post-57548919462826997772015-02-08T19:25:00.003+01:002015-07-01T08:55:49.838+02:00LPC1114FN28Ever since I saw <a href="http://blog.adafruit.com/2012/03/13/32-bit-meet-dip-arm-cortex-m0-in-dip-packages/" target="_blank">a posting on adafruit blog</a> posting on LPC1114FN28 I have wanted to get my hands on those ICs.<br />
<br />
Earlier this week I ordered one from <a href="http://www.electrokit.com/lpc1114fn28-dip28w-armm0-32k-50mhz.52789" target="_blank">Electrokit</a>.<br />
<br />
<span style="color: #f3f3f3;">(<a href="https://docs.google.com/presentation/d/1ubCu5-JhVtLTSAsKfd2CR4JhaNhtebAj0y-0kIjH_Qc/edit?usp=sharing" target="_blank">I</a>)</span><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/-jHQMQqKCZII/Ue1Eh-eG9qI/AAAAAAAALqE/22bThm8Z7b8/s1600/lpc1114fn28_pinout_2013jul2201.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="340" src="http://4.bp.blogspot.com/-jHQMQqKCZII/Ue1Eh-eG9qI/AAAAAAAALqE/22bThm8Z7b8/s1600/lpc1114fn28_pinout_2013jul2201.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><a href="http://4.bp.blogspot.com/-jHQMQqKCZII/Ue1Eh-eG9qI/AAAAAAAALqE/22bThm8Z7b8/s1600/lpc1114fn28_pinout_2013jul2201.jpg">Image source</a></td></tr>
</tbody></table>
<h3>
<br />Tutorials and stuff:</h3>
<br />
<ul>
<li>Linux tutorial <a href="http://www.meatandnetworking.com/tutorials/lpc1114fn28-with-open-source-tools/">http://www.meatandnetworking.com/tutorials/lpc1114fn28-with-open-source-tools/</a></li>
<li>Windows tutorial <a href="http://vilaca.eu/lpc1114/">http://vilaca.eu/lpc1114/</a></li>
<li>interesting projects <a href="http://www.pittnerovi.com/jiri/hobby/electronics/lpc1114/">http://www.pittnerovi.com/jiri/hobby/electronics/lpc1114/</a></li>
<li>mbed <a href="http://developer.mbed.org/users/ytsuboi/notebook/getting-started-with-mbed-lpc1114/">http://developer.mbed.org/users/ytsuboi/notebook/getting-started-with-mbed-lpc1114/</a></li>
</ul>
<br />
<br />
<br />
<h3>
Toolchain:</h3>
Download bare metal on the bottom of: <a href="http://www.linaro.org/downloads/">http://www.linaro.org/downloads/</a><br />
Linux bare metal direct link: <a href="http://launchpad.net/gcc-arm-embedded/4.7/4.7-2013-q1-update/+download/gcc-arm-none-eabi-4_7-2013q1-20130313-linux.tar.bz2">http://launchpad.net/gcc-arm-embedded/4.7/4.7-2013-q1-update/+download/gcc-arm-none-eabi-4_7-2013q1-20130313-linux.tar.bz2</a><br />
I extracted the files to to: :~/programming/gcc-arm-none-eabi-4_7-2013q1<br />
<br />
Must export path so that we can use it<br />
<blockquote class="tr_bq">
PATH=$PATH:~/programming/gcc-arm-none-eabi-4_7-2013q1/bin<br />
export PATH</blockquote>
<br />
I downloaded the lpc21isp<br />
git clone https://github.com/Zuph/lpc21isp.git<br />
<br />
And an example code:<br />
<div>
git clone https://github.com/Zuph/lpc1114-blink.git<br />
<br />
run make in the lpc1114-blin<br />
<br />
And then upload sketch to IC, dont forget to reset the device and an resistor to ground on pin 24</div>
<div>
<br /></div>
./lpc21isp ~/programming/lpc1114-blink/out/lpc1114_blink_led.hex /dev/ttyUSB0 115200 12000<br />
<div>
<br /></div>
Ölsöl en ölblogghttp://www.blogger.com/profile/17053931768398856946noreply@blogger.com0tag:blogger.com,1999:blog-4309985382169013899.post-60099502581998648522015-01-27T19:10:00.002+01:002015-01-27T19:10:41.999+01:00DFRobot LCD 1602 screenI got my DFRobot LCD 1602 screen today and tested it.<br />
<br />
<a href="http://www.aliexpress.com/item/1602-LCD-Keypad-Shield-for-Arduino-Duemilanove-UNO-MEGA2560-MEGA1280-Free-Shipping-Dropshipping/1366737137.html">http://www.aliexpress.com/item/1602-LCD-Keypad-Shield-for-Arduino-Duemilanove-UNO-MEGA2560-MEGA1280-Free-Shipping-Dropshipping/1366737137.html</a><br />
<br />
The Liquid Chrystal library example needs to be modified<br />
<a href="http://arduino.cc/en/Tutorial/LiquidCrystal">http://arduino.cc/en/Tutorial/LiquidCrystal</a><br />
<br />
There is no pinout on the board so I searched and found this page<br />
<br />
<a href="http://www.dfrobot.com/wiki/index.php/Arduino_LCD_KeyPad_Shield_(SKU:_DFR0009)">http://www.dfrobot.com/wiki/index.php/Arduino_LCD_KeyPad_Shield_(SKU:_DFR0009)</a><br />
<br />
which includes code for the buttons and the pins.<br />
<br />
The correct pin-values for this LCD is:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-VBidaJdPKQY/VMfUmgFpuWI/AAAAAAAAMm0/e8SPl9Of3sU/s1600/20150127_190958.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-VBidaJdPKQY/VMfUmgFpuWI/AAAAAAAAMm0/e8SPl9Of3sU/s1600/20150127_190958.jpg" height="180" width="320" /></a></div>
<br />
<pre style="background-color: #f9f9f9; border: 1px solid rgb(221, 221, 221); font-family: monospace, Courier; font-size: 12.8000001907349px; line-height: 1.3em; padding: 1em;">LiquidCrystal lcd(8, 9, 4, 5, 6, 7); </pre>
Ölsöl en ölblogghttp://www.blogger.com/profile/17053931768398856946noreply@blogger.com0tag:blogger.com,1999:blog-4309985382169013899.post-13391217335010380002015-01-20T22:29:00.004+01:002015-01-25T12:45:42.606+01:00Multiple MCUs on one serial lineI find myself in constant shortage of USB to serials and/or USB ports. On my breadboard setup I intend to have one permanently mounted home-built Arduino board and it would be nice to be able to use the same serial port for other things and just being able to swap MCU with a switch, while remaining power to both MCU's.<br />
<br />
Another issue I have is that I want to be able to run the USB to serial in 3V3 and not 5V, so I want to build a 5V->3.3V converter with two switchable outputs.<br />
<br />
<h2>
Parts</h2>
2 x <a href="http://www.electrokit.com/74hc125n.43053">74HC125N</a> DIP-14 Quad bus buffer, negative enable <a href="http://www.electrokit.com/productFile/download/1491">data sheet</a><br />
1 x <a href="http://www.electrokit.com/ld1117v33.45678">LD1117V33</a> 3.3V voltage regulator <a href="http://www.electrokit.com/productFile/download/855">data sheet</a><br />
<div>
1 x Arduino Serial </div>
<div>
1 x Switch<br />
1 x 547B Transistor<br />
2 x 10Kohm resistors<br />
<br /></div>
<div>
<br /></div>
<div>
The 74HC125 is kind of nice for this since it has ideal properties for voltage convertions between 3.3V and 5V, power it by 3.3V and it is not sensitive to 5V output. Also a 3.3V output from the 74HC125 is interpreted as a high on the 5V arduino.</div>
<div>
<br /></div>
<div>
Also the 74HC125 has a "Output Enable" or OE on each buffer so that we can shut it off.</div>
<h2>
Connections</h2>
<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://gif.datasheetbank.com/image/NXP/74HC125.gif" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://gif.datasheetbank.com/image/NXP/74HC125.gif" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><a href="http://gif.datasheetbank.com/image/NXP/74HC125.gif">http://gif.datasheetbank.com/image/NXP/74HC125.gif</a></td></tr>
</tbody></table>
<br />
Connect all Output Enables (OE) together on one 74HC125. When pulling those 4 OE low the buffer is enabled for the first serial connected MCU. Pulling high puts the 74HC125 in a high impedance state(not transmitting).</div>
<div>
Connect RX on the USB to serial to 4Y and TX to 2A. Connect 4A to the first MCU TX and 2Y to the first MCU RX.</div>
<div>
<br /></div>
<div>
Connect all Output Enables (OE) together on the other 74HC125 but not together with the first 74HC125. pulling this low would enable connection to the other serial connected MCU. Pulling high puts the 74HC125 in a high impedance state(not transmitting).</div>
<div>
Connect RX on the USB to serial to 4Y and TX to 2A same as with the other MCU. Connect 4A to the second MCU TX and 2Y to the second MCU RX.</div>
<div>
<br /></div>
<div>
I have this working on a breadboard now, but I intend to put a switch on it by connecting the second 74HC125 OE line to a not gate circuit so that it goes low when the input is high and connecting the second OE line to the other side of the not gate. Only one chip can now be active at the same time... connect to a switch voila...</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://www.elperfecto.com/wp-content/uploads/on-semiconductor-transistor-BC547B.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://www.elperfecto.com/wp-content/uploads/on-semiconductor-transistor-BC547B.jpg" height="400" width="262" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The 547B can be used as a not gate using a transistor</td></tr>
</tbody></table>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.electronics-tutorials.ws/logic/log47.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://www.electronics-tutorials.ws/logic/log47.gif" /></a></div>
<br /></div>
<div>
To be continued...</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://lh3.ggpht.com/-f4cmXWEmKiE/VL7M2WcHixI/AAAAAAAAMkg/z97IbwFNUpQ/s1600/1421790389282.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"> <img border="0" src="http://lh3.ggpht.com/-f4cmXWEmKiE/VL7M2WcHixI/AAAAAAAAMkg/z97IbwFNUpQ/s640/1421790389282.jpg" /> </a> </div>
Ölsöl en ölblogghttp://www.blogger.com/profile/17053931768398856946noreply@blogger.com0tag:blogger.com,1999:blog-4309985382169013899.post-34966426277699621342015-01-17T16:27:00.001+01:002015-01-17T16:27:25.002+01:00Breadboard deluxe <div dir="ltr">
I'm starting to be a bit annoyed by the mess on my desk. The small breadboard that are connected to a rpi or an arduino is not easily moved. <br />
Thus I want a better setup with a more permanent breadboard that can be lifted of the table in one piece.</div>
<div dir="ltr">
What I want: </div>
<ul>
<li>Large breadboard, two 840holes should be enough. </li>
<li>Power supply with shutoff switch. 3.3 and 5 v.</li>
<li>Hidden permanent raspberry pi with pins close to the breadboard. WiFi and separate shutoff switch. Access to the sd-card.</li>
<li>Hidden permanent arduino with usb connection and broken out pins. Also shutoff switch. </li>
<li>Voltage measure probe with screen. </li>
<li>Led light </li>
<li>Programmer</li>
<li>USB hub with single connection to computer</li>
<li>Common ground for everything.</li>
</ul>
<br />
<div dir="ltr">
I'm thinking that it would be nice to have a wooden board to connect everything on and mount the arduino and rpi on the underside. </div>
<div dir="ltr">
<br /></div>
<div dir="ltr">
To be continued...</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://lh4.ggpht.com/-bBbfD2WrRaU/VK6afhGzm0I/AAAAAAAAMd8/P4XQrjgeGJI/s1600/1420728933713.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"> <img border="0" src="http://lh4.ggpht.com/-bBbfD2WrRaU/VK6afhGzm0I/AAAAAAAAMd8/P4XQrjgeGJI/s640/1420728933713.jpg" /> </a> </div>
Ölsöl en ölblogghttp://www.blogger.com/profile/17053931768398856946noreply@blogger.com0tag:blogger.com,1999:blog-4309985382169013899.post-44988687886803711502015-01-08T15:39:00.002+01:002015-01-08T15:41:24.538+01:00Raspberry Pi playing audio through a HXJ8002<h2>
Introduction</h2>
I need a speaker on my make my own raspberry pi handheld gaming console.<br />
<br />
Here is the documentation from my experiment to connect a amplifier to the headphone audio output on the raspberry pi.<br />
<br />
<br />
<h4>
Amplifier HXJ8002</h4>
<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://img.dxcdn.com/productimages/sku_291705_1.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://img.dxcdn.com/productimages/sku_291705_1.jpg" height="320" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">HXJ8002. image from <a href="http://www.dx.com/p/hxj8002-mini-audio-amplifier-module-deep-blue-291705#.VK6ULM2G_3A">dx.com</a></td></tr>
</tbody></table>
<br />
I bough this amplifier since it is single channel and has a working voltage range from 2-5.5 V.<br />
<a href="http://www.dx.com/p/hxj8002-mini-audio-amplifier-module-deep-blue-291705#.VK6Oe82G_3A">http://www.dx.com/p/hxj8002-mini-audio-amplifier-module-deep-blue-291705#.VK6Oe82G_3A</a><br />
<br />
<blockquote class="tr_bq">
"On-board HXJ8002 single channel 3W, BTL bridge connected audio power amplifier chip; Working voltage: 2.0~5.5V; Standby current: 0.6uA (Typical value); Maximum distortion is 0.5% under output average power is 1W, 1kHz input signal frequency and 8ohm load; When THD + D<10% and the input frequency is 1kHz, output power is 3W (3ohm), 2.5W (4ohm), 1.5W (8ohm)." - <a href="http://www.dx.com/p/hxj8002-mini-audio-amplifier-module-deep-blue-291705#.VK6ULM2G_3A">dx.com</a></blockquote>
Pin connections<br />
<br />
<ul>
<li>VCC to +5v on RPi</li>
<li>GND to GND on Rpi</li>
<li>L to Left channel </li>
<li>R to Right Channel</li>
<li>V1 to speaker black</li>
<li>V2 to speaker red</li>
</ul>
<div>
I soldered simple pin headers to the pinouts</div>
<h3>
Speaker 18mm Speaker: 4 Ohm, 2.0 W</h3>
<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://www.lawicel-shop.se/shop/assets/prod_images/pPOL-1258n.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://www.lawicel-shop.se/shop/assets/prod_images/pPOL-1258n.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Image from <a href="http://www.lawicel-shop.se/prod/18mm-Speaker-4-Ohm-20-W_675760/Pololu_55653/SWE/SEK">lawicel-shop.se</a></td></tr>
</tbody></table>
<div>
<br /></div>
<div>
<a href="http://www.lawicel-shop.se/prod/18mm-Speaker-4-Ohm-20-W_675760/Pololu_55653/SWE/SEK">http://www.lawicel-shop.se/prod/18mm-Speaker-4-Ohm-20-W_675760/Pololu_55653/SWE/SEK</a></div>
<div>
<br /></div>
<blockquote class="tr_bq">
"This small, 2W speaker is a compact way to add loud, high-fidelity sound (compared to typical units this size) that can bring your project to life. It includes four 1.0mm-diameter mounting holes." - <a href="http://www.lawicel-shop.se/prod/18mm-Speaker-4-Ohm-20-W_675760/Pololu_55653/SWE/SEK">lawicel</a></blockquote>
<br />
I soldered cables to the red and black solder areas on the back<br />
<h4>
3.5mm plug stereo</h4>
<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="https://cdn.sparkfun.com//assets/parts/6/6/0/4/11143-02.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://cdn.sparkfun.com//assets/parts/6/6/0/4/11143-02.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Left and right are the short pins and GND is the long one. Image from <a href="https://www.sparkfun.com/products/11143">sparkfun</a></td></tr>
</tbody></table>
<div>
<br /></div>
<div>
<a href="http://www.electrokit.com/3-5mm-plugg-stereo.44804">http://www.electrokit.com/3-5mm-plugg-stereo.44804</a></div>
<div>
<a href="https://www.sparkfun.com/products/11143">https://www.sparkfun.com/products/11143</a></div>
<div>
<br /></div>
<div>
I soldered red wire to left and right and a black wire to the gnd</div>
<br />
<h4>
play wav</h4>
<a href="http://www.raspberrypi-spy.co.uk/2013/06/raspberry-pi-command-line-audio/">http://www.raspberrypi-spy.co.uk/2013/06/raspberry-pi-command-line-audio/</a><br />
<h4>
Play mp3</h4>
<a href="http://www.raspberrypi.org/documentation/usage/audio/">http://www.raspberrypi.org/documentation/usage/audio/</a><br />
<br />Ölsöl en ölblogghttp://www.blogger.com/profile/17053931768398856946noreply@blogger.com0tag:blogger.com,1999:blog-4309985382169013899.post-75178699687257790542015-01-02T21:50:00.001+01:002015-01-02T21:50:01.744+01:00Freescale KL25Z FRDM-KL25Z Bootloader issues<h2>
Beginning with trouble</h2>
I recently bought a KL25Z board out of curiosity, they have Arduino form factor, are super-cheap and boasts an ARM Cortex-M0+ MCU!<br />
<br />
I got the board home today so naturally I wanted to test it right away.<br />
<br />
I plugged it in and the board lighted up with a bright RGB-LED shifting colors, nice! A helpful usb-drive was connected for me to inspect...<br />
<br />
Unfortunately I followed the quick start guide from <a href="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=FRDM-KL25Z&tid=vanFRDM-KL25Z">here</a>! Which told me to update the MSD (mass storage device), it said "It is likely that the version provided in this package is newer than what was preprogrammed on your FRDM-KL25Z."... I fell for that easy trap... upgrade something that works... well I followed the instructions and upgraded the MSD by dragging and dropping it onto the BOOTLOADER OpenSDA. Restarted the board happily and BAM! no more drive.<br />
<br />
No freaking drive!<br />
<br />
I could still access the Bootloader drive and after a while I found the link to <a href="http://www.pemicro.com/opensda/index.cfm">http://www.pemicro.com/opensda/index.cfm</a> where you can read under <a href="http://www.pemicro.com/opensda/faqs/faqs.cfm">http://www.pemicro.com/opensda/faqs/faqs.cfm</a> that the old bootloader version does not handle Linux and has to be upgraded on an old Windows 7 PC... Well I registered on pemicro to be able to download the drivers <a href="http://www.pemicro.com/downloads/download_file.cfm?download_id=378">http://www.pemicro.com/downloads/download_file.cfm?download_id=378</a>, loaded the board in bootloader mode and dragged the new bootloader software to the board. restarted and also updated the MSD driver. Reconnected the board on linux and now it works... time to test another program...<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/-Y9fB5U0d8uQ/VKcEZlQcRZI/AAAAAAAAMWU/D0YUPldhx9M/s1600/20150102_143110.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://1.bp.blogspot.com/-Y9fB5U0d8uQ/VKcEZlQcRZI/AAAAAAAAMWU/D0YUPldhx9M/s1600/20150102_143110.jpg" height="225" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">unpacking!</td></tr>
</tbody></table>
<br />
<br />
<br />Ölsöl en ölblogghttp://www.blogger.com/profile/17053931768398856946noreply@blogger.com0tag:blogger.com,1999:blog-4309985382169013899.post-6106925341008781382014-03-30T16:54:00.004+02:002014-03-30T16:54:55.322+02:00More work on the Roomba platform<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;"><img border="0" src="http://lh6.ggpht.com/-uNY_RckqocM/Uzfo3kww5jI/AAAAAAAAHdg/hkQqNAR5U8I/s640/1396172948196.jpg" style="margin-left: auto; margin-right: auto;" /></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Testing the motordriver and step-up power converter</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://lh6.ggpht.com/-uNY_RckqocM/Uzfo3kww5jI/AAAAAAAAHdg/hkQqNAR5U8I/s1600/1396172948196.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"> </a> </div>
Ölsöl en ölblogghttp://www.blogger.com/profile/17053931768398856946noreply@blogger.com0tag:blogger.com,1999:blog-4309985382169013899.post-47269999038525216342014-03-20T09:38:00.000+01:002014-03-20T09:38:00.407+01:00Parts for floorvac robot platform<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></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;"><img border="0" src="http://lh3.ggpht.com/-WNlWW7Gv-V0/UynsCm6fcoI/AAAAAAAAHZM/giLcjeqnYd8/s640/1395254139216.jpg" height="239" style="margin-left: auto; margin-right: auto;" width="400" /></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: small; text-align: start;">New step up converter and motor driver arrived today... Here seen together with a rpi, mini arduino board. These components will be placed on the old Roomba robotic floorvac that I intend to replace the current robot platform with.</span></td></tr>
</tbody></table>
<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/-9kzFMfXmWX4/UyqoIYbToKI/AAAAAAAAHZc/P-zOqvPQiHA/s1600/IMAG0369.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto; text-align: center;"><img border="0" src="http://4.bp.blogspot.com/-9kzFMfXmWX4/UyqoIYbToKI/AAAAAAAAHZc/P-zOqvPQiHA/s1600/IMAG0369.jpg" height="238" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The Roomba floorvac, dirty broken robot vacumcleaner...</td></tr>
</tbody></table>
<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/-IFUH927S2pg/UyqoNhUShaI/AAAAAAAAHZk/2jD68QL_6wU/s1600/IMAG0370.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto; text-align: center;"><img border="0" src="http://4.bp.blogspot.com/-IFUH927S2pg/UyqoNhUShaI/AAAAAAAAHZk/2jD68QL_6wU/s1600/IMAG0370.jpg" height="238" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Most components removed and testing the motors with 12V battery</td></tr>
</tbody></table>
<br />
<div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://lh3.ggpht.com/-WNlWW7Gv-V0/UynsCm6fcoI/AAAAAAAAHZM/giLcjeqnYd8/s1600/1395254139216.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"> </a> </div>
<div>
<br /></div>
</div>
Ölsöl en ölblogghttp://www.blogger.com/profile/17053931768398856946noreply@blogger.com0tag:blogger.com,1999:blog-4309985382169013899.post-11935257365602736012014-03-11T20:28:00.003+01:002014-03-11T20:32:47.290+01:00TFT01-2.2SP 2.2 SPI 240 x 320 TFT LCD Module <table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><img border="0" src="http://lh4.ggpht.com/-hlup8DvCQe0/Ux9kb499SHI/AAAAAAAAHYE/JoW7p_Qq47I/s640/IMAG0373.jpg" style="margin-left: auto; margin-right: auto;" /></td></tr>
<tr><td class="tr-caption" style="font-size: 13px;">The TFT connected to an arduino through an 4050B, the arduino ethernet is just there for its 3.3V</td></tr>
</tbody></table>
I bought a cheap color TFT screen on dx.com, first I thought I broke it, connecting it to +5V logic, but it seems the examples where broken and not using the correct interface. Now I use a 4060B level converter<br />
<br />
With the library found on arduino forum it works...<br />
<br />
I intend to connect this to a Raspberry pi later on together with a joystick and some buttons to create a robot remote control.<br />
<h3>
Links</h3>
Dx <a href="http://dx.com/p/elecfreaks-tft01-2-2sp-2-2-spi-240-x-320-tft-lcd-module-for-arduino-red-black-236037">product page</a><br />
Library download <a href="http://forum.arduino.cc/index.php?PHPSESSID=gmdo3f9gc28d8v4amun017ljk5&action=dlattach;topic=181679.0;attach=55282">http://forum.arduino.cc/index.php?PHPSESSID=gmdo3f9gc28d8v4amun017ljk5&action=dlattach;topic=181679.0;attach=55282</a><br />
Found here: <a href="http://forum.arduino.cc/index.php?topic=181679.15">http://forum.arduino.cc/index.php?topic=181679.15</a><br />
4050B Datasheet <a href="http://www.electrokit.com/productFile/download/1166">here</a><br />
<br />
<h3>
Pin connections</h3>
<blockquote class="tr_bq">
D5 : CS<br />
D4 : RESET<br />
D6 : D/C<br />
D11 : MOSI<br />
D13 : SCK<br />
D7 : LED<br />
D12 : MISO</blockquote>
<br /><div class="separator" style="clear: both; text-align: center;">
<a href="http://lh4.ggpht.com/-hlup8DvCQe0/Ux9kb499SHI/AAAAAAAAHYE/JoW7p_Qq47I/s1600/IMAG0373.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"> </a> </div>
Ölsöl en ölblogghttp://www.blogger.com/profile/17053931768398856946noreply@blogger.com0tag:blogger.com,1999:blog-4309985382169013899.post-16653976826051179072014-03-03T21:20:00.001+01:002014-03-03T21:20:11.535+01:00Testing the new GP2Y0A710K0F sensors<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: left;">
I just received two GP2Y0A710K0F sensors. These are a bit more expensive and has a range from 100 to 500cm. They will work together with the smaller pair of GP2Y0A02YK0F that I have on the robot right now. The smaller sensor has a range from 16 cm to 150 cm (or roughly 180 cm). </div>
<div class="separator" style="clear: both; text-align: left;">
Since my plan is to use these for indoor mapping the combined long range and short range sensors will provide 16-500 cm range measurements. </div>
<div class="separator" style="clear: both; text-align: left;">
<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://3.bp.blogspot.com/-0MiWgcHLM5o/UxTfVhop6HI/AAAAAAAAHVI/9_qb9XiKDnw/s1600/IMAG0363.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://3.bp.blogspot.com/-0MiWgcHLM5o/UxTfVhop6HI/AAAAAAAAHVI/9_qb9XiKDnw/s1600/IMAG0363.jpg" height="238" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">New sensors packaged with a 220uF cap and cable</td></tr>
</tbody></table>
<br />
The sensors are pretty noisy and comes with a 220uF electrolytic capacitor.<br />
<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://3.bp.blogspot.com/-dn7jSZDTxuU/UxTeP10ADQI/AAAAAAAAHVE/5sIFSrLzea8/s1600/1393876505702.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://3.bp.blogspot.com/-dn7jSZDTxuU/UxTeP10ADQI/AAAAAAAAHVE/5sIFSrLzea8/s1600/1393876505702.jpg" height="238" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The IR light is only visible on camera... seems really strong...</td></tr>
</tbody></table>
After soldering connectors, I modified the AnalogReadSerial sketch(bottom of post) and tested the sensors... yay, I get readings...<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/-MGTIsyfxOkA/UxThqnI2mqI/AAAAAAAAHVc/AeNVnrFg1Yw/s1600/IMAG0365.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://4.bp.blogspot.com/-MGTIsyfxOkA/UxThqnI2mqI/AAAAAAAAHVc/AeNVnrFg1Yw/s1600/IMAG0365.jpg" height="238" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Test setup with one sensor...</td></tr>
</tbody></table>
Next step is to replace the ultrasonic sensors on the robot with these, calibrate and adapt the software... I anticipate some powering problems since these sensors can be very demanding. 330ma peak!<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://2.bp.blogspot.com/-GTwLMZvigFk/UxTfvrbHtEI/AAAAAAAAHVQ/KR1tewh4exc/s1600/IMAG0356.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto; text-align: center;"><img border="0" src="http://2.bp.blogspot.com/-GTwLMZvigFk/UxTfvrbHtEI/AAAAAAAAHVQ/KR1tewh4exc/s1600/IMAG0356.jpg" height="400" width="238" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The sensor is going to replace the ultrasonic sensor for long range measurements.</td></tr>
</tbody></table>
The SLAM software has undergone a few changes. I felt the need for easier debugging, reproducible tests so I wrote a simple robot simulator. This allows me to simulate noisy input from a simulated robot moving in a world loaded from a bitmap image.<div>
</div>
</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/-SSUg9L329Qs/UxTi9B1ekyI/AAAAAAAAHVo/p8CYouVckrc/s1600/simulation.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://1.bp.blogspot.com/-SSUg9L329Qs/UxTi9B1ekyI/AAAAAAAAHVo/p8CYouVckrc/s1600/simulation.jpg" height="323" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The SLAM software, simulated data from bitmap data. To the left map generated from several measurements, red dot is best estimated position, to the right simulated input from the latest measurement.</td></tr>
</tbody></table>
<div>
<br /></div>
<div>
The Arduino test-sketch to test the two sensors...</div>
<div>
<br /></div>
<pre><span style="color: #cc6600;">void</span> <span style="color: #cc6600;"><b>setup</b></span>() {
<span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">begin</span>(9600);
}
<span style="color: #cc6600;">void</span> measure(<span style="color: #cc6600;">int</span> analogPin) {
<span style="color: #7e7e7e;">//remove analog lag</span>
<span style="color: #cc6600;">analogRead</span>(analogPin);
<span style="color: #cc6600;">int</span> sensorValue = <span style="color: #cc6600;">analogRead</span>(analogPin);
<span style="color: #cc6600;">float</span> voltage = 5.0f * (<span style="color: #cc6600;">float</span>)sensorValue / 1024.0f;
<span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(<span style="color: #006699;">"Analog pin "</span>);
<span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(analogPin);
<span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">print</span>(<span style="color: #006699;">" : "</span>);
<span style="color: #cc6600;"><b>Serial</b></span>.<span style="color: #cc6600;">println</span>(voltage);
}
<span style="color: #cc6600;">void</span> <span style="color: #cc6600;"><b>loop</b></span>() {
measure(A0);
measure(A1);
<span style="color: #cc6600;">delay</span>(1000);
}
</pre>
Ölsöl en ölblogghttp://www.blogger.com/profile/17053931768398856946noreply@blogger.com5tag:blogger.com,1999:blog-4309985382169013899.post-91559284080639151852014-02-15T22:59:00.000+01:002014-02-15T23:02:25.225+01:00Raspberry LCD-5110 Shield notesMy LCD-shield for raspberry pi is finally starting to show some promise.<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://2.bp.blogspot.com/-faeh5JnfKV0/Uv_R1SFc0oI/AAAAAAAAG60/_xRAAPqFhbk/s1600/1392497064791.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://2.bp.blogspot.com/-faeh5JnfKV0/Uv_R1SFc0oI/AAAAAAAAG60/_xRAAPqFhbk/s1600/1392497064791.jpg" height="380" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Nokia 5110 on rpi shield made out of Arduino shield protoboard, featuring some buttons, leds and a Attiny85</td></tr>
</tbody></table>
<br />
<h3>
The Attiny85</h3>
On the shield I placed one attiny85 to use as analog to digital converter. It is placed on the little surface mount area and is programmed using the ICSP header next to it. I connected the SCK, MISO and MOSI to 13,12, 11 on the arduino shield. The reset is connected to the reset button.<br />
<br />
I used the <a href="http://highlowtech.org/?p=1695">High-Low Tech tutorial </a>for bootloading the attiny85.<br />
<br />
I must not program the attiny when it is attached to the RPi since the programmer provides dangerous 4.8V to the 3.3 rails. And I also need to remove the LCD when I program it.<br />
<br />
I intend to communicate with serial to the attiny from the pi.<br />
<a href="http://www.instructables.com/id/Easy-ATTiny-Serial-Communication-with-Tiny-AVR-Pro/">http://www.instructables.com/id/Easy-ATTiny-Serial-Communication-with-Tiny-AVR-Pro/</a><br />
<br />
This contains instructions on how to use the pi's serial port<br />
<a href="http://wyolum.com/projects/alamode/">http://wyolum.com/projects/alamode/</a><br />
<a href="http://raspberrypihobbyist.blogspot.se/2012/08/raspberry-pi-serial-port.html">http://raspberrypihobbyist.blogspot.se/2012/08/raspberry-pi-serial-port.html</a><br />
<a href="http://www.hobbytronics.co.uk/raspberry-pi-serial-port">http://www.hobbytronics.co.uk/raspberry-pi-serial-port</a><br />
<br />
I run minicom to communicate with my program...<br />
<blockquote class="tr_bq">
minicom -b 9600 -o -D /dev/ttyAMA0</blockquote>
The current programming approach is quite painful so I think I will need to rethink it. maybe its time to get a 3.3V programmer or levelconvert the programmers signal?<span style="background-color: white; color: blue; font-family: Arial, Helvetica, sans-serif; font-size: 12px;"><br /></span>
<br />
<br />
Right now I remove the shield and LCD from the shield, connect the programmer, run arduino as sudo, write my changes and then removes the programmer, attach shield to rpi, bootup rpi and login through ssh, connect to shield through minicom to find some minor error... phew...shut down pi, start over...<br />
<br />
<br />
<br />
<script src="https://gist.github.com/dntoll/9025126.js"></script>Ölsöl en ölblogghttp://www.blogger.com/profile/17053931768398856946noreply@blogger.com0tag:blogger.com,1999:blog-4309985382169013899.post-65182657557603727382014-02-07T20:10:00.000+01:002014-02-07T20:14:07.312+01:00More work on the headless RPi with LCD and buttonsI intend to run my RPi headless, here is a collection of good resources so I can find them again...<br />
<br />
To build and interact with buttons...<br />
<a href="https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/robot/buttons_and_switches/">https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/robot/buttons_and_switches/</a><br />
<br />
Run scripts on startup and shutdown, not sure if they mixup /etc/rc0.d with /etc/rc6.d<br />
<a href="http://en.kioskea.net/faq/3348-ubuntu-executing-a-script-at-startup-and-shutdown">http://en.kioskea.net/faq/3348-ubuntu-executing-a-script-at-startup-and-shutdown</a><br />
<br />
Spawn subprocesses in python and interact with them<br />
<a href="http://docs.python.org/2/library/subprocess.html#module-subprocess">http://docs.python.org/2/library/subprocess.html#module-subprocess</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://2.bp.blogspot.com/-_1ncq2Mz-cw/UvUuvYMqA-I/AAAAAAAAG1M/sJWGsBktAlQ/s1600/IMAG0325%257E2.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://2.bp.blogspot.com/-_1ncq2Mz-cw/UvUuvYMqA-I/AAAAAAAAG1M/sJWGsBktAlQ/s1600/IMAG0325%257E2.jpg" height="380" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">I added a button to the circuit...</td></tr>
</tbody></table>
<br />Ölsöl en ölblogghttp://www.blogger.com/profile/17053931768398856946noreply@blogger.com0tag:blogger.com,1999:blog-4309985382169013899.post-72196075565743919062014-02-06T19:48:00.000+01:002014-02-06T20:09:40.762+01:00Screen for the robotMy robot contains a Raspberry Pi model A. Right now I always ssh into it in order to start the robot application and I need to remotely ssh all commands.<br />
I intend to create a simple userinterface in the form of a LCD and a few buttons to make it easier to turn on and off and perhaps reboot and reload the applications.<br />
<br />
I have a 5110 that I have used together with arduino boards before.<br />
I found this tutorial: <a href="https://github.com/XavierBerger/pcd8544">https://github.com/XavierBerger/pcd8544</a><br />
<br />
This is built using wiringPi<br />
<a href="http://wiringpi.com/download-and-install/">http://wiringpi.com/download-and-install/</a><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-E7WAObUuHhE/UvPY5bsmhQI/AAAAAAAAGyk/c0CC3RfO7v0/s1600/IMAG0319.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-E7WAObUuHhE/UvPY5bsmhQI/AAAAAAAAGyk/c0CC3RfO7v0/s1600/IMAG0319.jpg" height="191" width="320" /></a></div>
<br />
<br />
The tutorial did not work fully, apparently I need wiringpi2, since I get the message "ImportError: No module named wiringpi2"<br />
<br />
<a href="http://raspi.tv/how-to-install-wiringpi2-for-python-on-the-raspberry-pi#install">http://raspi.tv/how-to-install-wiringpi2-for-python-on-the-raspberry-pi#install</a><br />
"<span style="background-color: #f7f7f7; font-family: 'Courier New', Courier, Monaco, 'Lucida Console', monospace; font-size: 14px; line-height: 22.27199935913086px;">sudo pip install wiringpi2</span>"<br />
<br />
Worked the second time...<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/-h94aemjy6U8/UvPd2XLTW5I/AAAAAAAAGzM/SAJ7BN84prM/s1600/IMAG0320.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://1.bp.blogspot.com/-h94aemjy6U8/UvPd2XLTW5I/AAAAAAAAGzM/SAJ7BN84prM/s1600/IMAG0320.jpg" height="238" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Yay...</td></tr>
</tbody></table>
<br />Ölsöl en ölblogghttp://www.blogger.com/profile/17053931768398856946noreply@blogger.com0tag:blogger.com,1999:blog-4309985382169013899.post-37381824083998139222014-01-21T19:03:00.000+01:002014-01-21T19:07:47.811+01:00New servo for robot head<div>
Problem: The old servo is not strong enough to turn the robots head when there is a lot of cables attached to the head.</div>
<div>
<br /></div>
<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><img border="0" src="http://lh3.ggpht.com/-wOty_xlBvYo/Ut60iYhfPlI/AAAAAAAAGjE/tmLjZF10P7k/s640/1390326853549.jpg" height="239" style="margin-left: auto; margin-right: auto;" width="400" /></td></tr>
<tr><td class="tr-caption" style="font-size: 13px;">I bought a new larger servo yesterday, the black large one in the background should provide much more power than the old blue micro servo I used before.</td></tr>
</tbody></table>
</div>
<div>
Solution: Buy new stronger servo.</div>
<div>
<br /></div>
<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><img border="0" src="http://lh5.ggpht.com/-8eaj_5zMji0/Ut609fRhCMI/AAAAAAAAGjM/f84qgrA27c8/s640/1390326981466.jpg" height="400" style="margin-left: auto; margin-right: auto;" width="239" /></td></tr>
<tr><td class="tr-caption" style="font-size: 13px;">The servo should turn the robots head so that distance sensors can make measurements in all directions, problem was that the old servo was not strong enough to turn the head with the resistance of the cables.</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://lh5.ggpht.com/-8eaj_5zMji0/Ut609fRhCMI/AAAAAAAAGjM/f84qgrA27c8/s1600/1390326981466.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"></a></div>
</div>
<div>
<br /></div>
<div>
New problem: new servo creates a lot of electrical disturbance. </div>
<div>
<br /></div>
<div>
Solution: Add more and bigger caps!</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://lh3.ggpht.com/-wOty_xlBvYo/Ut60iYhfPlI/AAAAAAAAGjE/tmLjZF10P7k/s1600/1390326853549.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"> </a> </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;"><img border="0" src="http://lh5.ggpht.com/-lWW1CqxYmxY/Ut60_GfCPvI/AAAAAAAAGjU/b5nBy_jZ3R8/s640/1390326997705.jpg" height="400" style="margin-left: auto; margin-right: auto;" width="239" /></td></tr>
<tr><td class="tr-caption" style="text-align: center;">There is a lot of cables coming out of the sensors (4+4+3+3) making the head a lot heavier to turn. </td></tr>
</tbody></table>
<div>
All those cables makes the head difficult to work with, I think I need to make a custom Arduino board and attach it to the head.</div>
Ölsöl en ölblogghttp://www.blogger.com/profile/17053931768398856946noreply@blogger.com0tag:blogger.com,1999:blog-4309985382169013899.post-12281668021823686712013-12-28T21:09:00.001+01:002013-12-28T21:09:47.623+01:00Todays project, garage distance sensor with LED array<div class="separator" style="clear: both; text-align: center;"> <a href="http://lh3.ggpht.com/-BXymsu5I8Bw/Ur8wBuDR8uI/AAAAAAAAGU0/9IPTHbIwCeM/s1600/1388261274430.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"> <img border="0" src="http://lh3.ggpht.com/-BXymsu5I8Bw/Ur8wBuDR8uI/AAAAAAAAGU0/9IPTHbIwCeM/s640/1388261274430.jpg"> </a> </div>Ölsöl en ölblogghttp://www.blogger.com/profile/17053931768398856946noreply@blogger.com0tag:blogger.com,1999:blog-4309985382169013899.post-27606234001236763452013-12-25T12:29:00.001+01:002013-12-25T12:29:13.428+01:00Ordered a raspberry pi camera<p>Today I ordered a pi cam. And also another rpi model A. I have some ideas for another robot. </p>
Ölsöl en ölblogghttp://www.blogger.com/profile/17053931768398856946noreply@blogger.com0tag:blogger.com,1999:blog-4309985382169013899.post-69317523963330366022013-07-10T13:43:00.003+02:002013-07-10T13:43:43.190+02:00Pictures of the new platform<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/-0orGgqGT8Es/Ud1IWmiyrUI/AAAAAAAAE4c/mdeX4YQsXDU/s1600/IMAG2163-MOTION.gif" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="238" src="http://2.bp.blogspot.com/-0orGgqGT8Es/Ud1IWmiyrUI/AAAAAAAAE4c/mdeX4YQsXDU/s400/IMAG2163-MOTION.gif" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">New platform based on 4mm plywood, plenty of room for more stuff </td></tr>
</tbody></table>
<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/-fU_d0h3eQ4c/Ud1IWg-6EAI/AAAAAAAAE4c/aPTqmqhq7FA/s1600/1372581429994.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="238" src="http://4.bp.blogspot.com/-fU_d0h3eQ4c/Ud1IWg-6EAI/AAAAAAAAE4c/aPTqmqhq7FA/s400/1372581429994.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Central sensor turnable "tower"</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/-UpLzoJmBkx4/Ud1IWhOKJvI/AAAAAAAAE4c/m3kt-1yavus/s1600/IMAG2182.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="238" src="http://1.bp.blogspot.com/-UpLzoJmBkx4/Ud1IWhOKJvI/AAAAAAAAE4c/m3kt-1yavus/s400/IMAG2182.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Raspberry Pi and USB-hub</td></tr>
</tbody></table>
<br />Ölsöl en ölblogghttp://www.blogger.com/profile/17053931768398856946noreply@blogger.com0tag:blogger.com,1999:blog-4309985382169013899.post-76575282572899740672013-06-29T19:53:00.003+02:002013-06-29T19:53:47.666+02:00Larger Arduino robot platformI started to build a larger platform for my robot. The old platform has three levels and is quite packed with sensors and cables. Since most cables are connected to the Arduino board, I need to dismantle most of the robot when I make changes. Also I wanted to be able to make distance readings in all directions<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/-Xlqlkg64feg/Uc8Z7Vq9yzI/AAAAAAAAEtw/w6HXIFDwED8/s1600/IMAG2078.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="191" src="http://1.bp.blogspot.com/-Xlqlkg64feg/Uc8Z7Vq9yzI/AAAAAAAAEtw/w6HXIFDwED8/s320/IMAG2078.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The old robot is packed with sensors.</td></tr>
</tbody></table>
I made cardboard templates for most of the hardware to be able to play with layout a bit easier. I decided to make the robot round-ish but ended up making it an octagonal-ish. With centered wheels so it will turn around its center. <div>
The third wheel is placed on one side and weight is distributed accordingly.</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://3.bp.blogspot.com/-3cc8vuIuvuc/Uc8Ym8uT4rI/AAAAAAAAEtI/ygCe82B_-Ew/s1600/IMAG2137.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="191" src="http://3.bp.blogspot.com/-3cc8vuIuvuc/Uc8Ym8uT4rI/AAAAAAAAEtI/ygCe82B_-Ew/s320/IMAG2137.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Plywood with cutouts for wheels and cardboard templates for parts</td></tr>
</tbody></table>
Parts:</div>
<div>
<ul>
<li>Plywood 30*30 cm</li>
<li>Raspberry Pi Model A</li>
<li>Arduino Duemilanove</li>
<li>LiPo battery</li>
<li>H-bridge 7.4V 3300</li>
<li>Power converter</li>
<li>2 * 6V geared motors</li>
<li>Servo</li>
<li>2 * IR Sensors Sharp GP2Y0A02YK0F</li>
<li>2 * Ultrasonic sensors HC-SR04</li>
<li>Compass HMC5883L</li>
<li>Accelerometer and Gyro MPU6050</li>
<li>USB-Hub</li>
</ul>
<div>
<br /></div>
</div>
<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/-ueMQw457TPA/Uc8Ymx4_AAI/AAAAAAAAEtI/_NBtW9XOL3w/s1600/IMAG2138.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="191" src="http://2.bp.blogspot.com/-ueMQw457TPA/Uc8Ymx4_AAI/AAAAAAAAEtI/_NBtW9XOL3w/s320/IMAG2138.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Before dismantling the old robot </td></tr>
</tbody></table>
<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/-trJbvIpS4pk/Uc8Ym3EFPrI/AAAAAAAAEtI/WyWTLXvgj7E/s1600/IMAG2141.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="191" src="http://4.bp.blogspot.com/-trJbvIpS4pk/Uc8Ym3EFPrI/AAAAAAAAEtI/WyWTLXvgj7E/s320/IMAG2141.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Lots of parts and cables, My Raspberry Pi model A to the right</td></tr>
</tbody></table>
The old robot was dismantled in order to find more precise measurements for drilling.<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://2.bp.blogspot.com/-Yuog6JUmDhI/Uc8Ym2GXsvI/AAAAAAAAEtI/8pyGcDyqu8k/s1600/IMAG2140.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="191" src="http://2.bp.blogspot.com/-Yuog6JUmDhI/Uc8Ym2GXsvI/AAAAAAAAEtI/8pyGcDyqu8k/s320/IMAG2140.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Testing layout with real hardware instead of cardboard<br /></td></tr>
</tbody></table>
I intend to make distance measurements in all directions. I have mounted two IR-distance sensors and two ultrasonic sensors on a piece of wood. It is going to be placed on top of a servo. An unsolved problem is that I must be able to shut the sensors on and off independently since I have noticed that they interfere with each other.<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/-hX1Iegk3jEY/Uc8Ym8kI-vI/AAAAAAAAEtI/7V_pzf_bjxk/s1600/IMAG2142.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="http://2.bp.blogspot.com/-hX1Iegk3jEY/Uc8Ym8kI-vI/AAAAAAAAEtI/7V_pzf_bjxk/s320/IMAG2142.jpg" width="191" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The new two directional sensor IR and ultrasonic<br /></td></tr>
</tbody></table>
Most parts are assembled and I have glued the support for the third wheel as well as the servo.</div>
<div>
<br /></div>
<div>
Now waiting for the glue... to be continued...<br /><br />
<br /></div>
Ölsöl en ölblogghttp://www.blogger.com/profile/17053931768398856946noreply@blogger.com0tag:blogger.com,1999:blog-4309985382169013899.post-633485330486109812013-06-20T16:45:00.001+02:002013-06-20T16:48:36.786+02:00Odometry Sensor<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/-SL8uucqYO24/UcMRofJWHTI/AAAAAAAAEe4/sZhtxBMuXwQ/s1600/IMAG2106.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="382" src="http://2.bp.blogspot.com/-SL8uucqYO24/UcMRofJWHTI/AAAAAAAAEe4/sZhtxBMuXwQ/s640/IMAG2106.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Home made optical encoder odometry sensor.</td></tr>
</tbody></table>
I want to improve the dead reckoning ability of my robot and I intended to build my own odometry sensor for this. A rotary encoder seemed simplest and i bought a IR-<a href="http://dx.com/p/tcrt5000-infrared-reflectance-2-channel-tracking-sensor-module-for-arduino-blue-151608">cheap sensor</a> for the purpose.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://img.dxcdn.com/productimages/sku_151608_3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://img.dxcdn.com/productimages/sku_151608_3.jpg" width="320" /></a></div>
<br />
<br />
The sensor has been tuned so it senses the relative color of the backside of the wheel and I drew a black and white circle encoder for the backsides of the wheel.<br />
<br />
Unfortunately I get very bad results. The sensor is not really intended for this. I have adjusted it so its very sensitive to the black and white color changes but I guess the motors interfere with the measurements.<br />
<br />
I think I'm going to buy a better sensor and perhaps new motors.<br />
<br />
I also found <a href="http://autsys.aalto.fi/fsr/attach/Material/Odometry_sensors.pdf">this resource</a> giving a good overview of odometry sensors.Ölsöl en ölblogghttp://www.blogger.com/profile/17053931768398856946noreply@blogger.com2tag:blogger.com,1999:blog-4309985382169013899.post-88704465807904274152013-06-19T16:33:00.000+02:002013-06-19T21:18:17.343+02:00SLAM with imperfect sensors<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/-dJikcF2NCLY/UcG880eYH2I/AAAAAAAAEdI/aalEZOdX-wE/s1600/slam.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="640" src="http://2.bp.blogspot.com/-dJikcF2NCLY/UcG880eYH2I/AAAAAAAAEdI/aalEZOdX-wE/s640/slam.jpg" width="610" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">SLAM from 5 positions joined into a best belief map. Red is particle filter position likelihood estimation. Green lines are Sonar and yellow are IR distance readings. Rectangles + line shows old and current poses. Circles are 10 cm apart.</td></tr>
</tbody></table>
I have been very sparse with my blogging but I'm actually getting somewhere with my SLAM attempts. I can now combine sensor-readings from multiple location and the robot moves between poses.<br />
<div>
<br /></div>
<div>
The sensor-readings consists of IR and Ultrasonic distance sensors on a servo taking readings 1 degree apart. resulting in 170 distance readings per pose. I have a compass but I'm not using it right now. These sensor-readings are used to estimate the new position using a particle filter.</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://4.bp.blogspot.com/-u-EtYfNg2C0/UcG-tfxeUWI/AAAAAAAAEdc/EEnUmlv3jXM/s1600/1371651733682.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="400" src="http://4.bp.blogspot.com/-u-EtYfNg2C0/UcG-tfxeUWI/AAAAAAAAEdc/EEnUmlv3jXM/s400/1371651733682.jpg" width="238" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Robot with LiPo battery. IR-sensor and Ultrasonic sensor on a servo in the front.</td></tr>
</tbody></table>
My biggest problem right now is that the sensors behave a bit uncertainly, not just noisy but also depending on material, angle and size of the object you get different readings. I have tried to mediate this by combining the IR with the ultrasonic.<br />
<div>
<br /></div>
<div>
IR has small angle but is sensitive to reflective, transparent and luminescent materials. It also behaves badly on striped materials. And my IR sensor also works ok between 20 and 100 cm.</div>
<div>
<br /></div>
<div>
Ultrasonic sensor has wide angle 15-20 degrees, is quite precise, works on most materials that I know of but is sensitive to steep angles.<br />
<div>
<br /></div>
</div>
Ölsöl en ölblogghttp://www.blogger.com/profile/17053931768398856946noreply@blogger.com1tag:blogger.com,1999:blog-4309985382169013899.post-86507561260690985632013-05-25T17:50:00.000+02:002013-05-25T17:51:07.576+02:00Combining sensor input into maps<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/-5890U_jBszU/UaDZVXCqv0I/AAAAAAAAELc/LvYXn_GVU2w/s1600/calibrated.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="640" src="http://1.bp.blogspot.com/-5890U_jBszU/UaDZVXCqv0I/AAAAAAAAELc/LvYXn_GVU2w/s640/calibrated.jpg" width="638" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Combined heading from compass sensor with distance readings from ultrasonic (green) and IR (red), black lines are robot headings</td></tr>
</tbody></table>
Today I started to try and combine several measurements from different sensors into a single picture. I scan the environment using the ultrasonic sonar and IR distance sensors and draw a picture of the robots environment. Currently I do not account for position.<br />
<br />
The ultrasonic sensor has really wide angles of 15 degrees making it ideal to scan the environment fast. It also has better range than the IR sensors around 2 meters while the IR sensor starts to give inaccurate readings after a meter or so.<br />
<br />
The compass gives really crappy values, but I started on an algorithm to correct it based on linear mapping. I measured 45 degree angles and it seems to work OK. All sensors have a lot of noise on them, some of which I can remove using multiple measurements and making sure to add delays after using servos and motors. I'm thinking of moving all sensor calibration to the Rpi board in order to better calculate noise distributions.<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://3.bp.blogspot.com/-lC75C6jNuVc/UaDdHSQRJYI/AAAAAAAAELs/z_3kzZCkSEE/s1600/IMAG2060.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="640" src="http://3.bp.blogspot.com/-lC75C6jNuVc/UaDdHSQRJYI/AAAAAAAAELs/z_3kzZCkSEE/s640/IMAG2060.jpg" width="380" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Compass Calibration </td></tr>
</tbody></table>
<br />
<br />Ölsöl en ölblogghttp://www.blogger.com/profile/17053931768398856946noreply@blogger.com0tag:blogger.com,1999:blog-4309985382169013899.post-62820579861470530632013-05-08T19:22:00.002+02:002013-05-08T19:22:44.234+02:00Separate power-source for the motors solved the Rpi brownouts.<h3>
Background</h3>
I have had problems with my RPi rebooting when I run my motors. And I have been told the raspberry pi is very sensitive to power problems. The hypothesis is that the batteries cannot provide enough current to keep all components running. The<br />
<div>
<h3>
Experimental setup</h3>
<div>
Today I added a second power source directly connected to the H-bridge to test the hypothesis. I hooked up an a 9 Volt battery on the back of the robot. Not the optimal solution since the single battery will probably quickly run out of juice.</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://1.bp.blogspot.com/-eOuYXXferWI/UYqFObc0W3I/AAAAAAAAD-4/SFYN6uhZnW0/s1600/IMAG2034.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="238" src="http://1.bp.blogspot.com/-eOuYXXferWI/UYqFObc0W3I/AAAAAAAAD-4/SFYN6uhZnW0/s400/IMAG2034.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">9v battery directly connected to the H-bridge</td></tr>
</tbody></table>
</div>
<h3>
Results</h3>
<div align="center">
<iframe allowfullscreen="" frameborder="0" height="315" src="http://www.youtube.com/embed/_QY2snpWHIw" width="420"></iframe>
</div>
</div>
<br />
The robot can drive at full speed without any brownouts. The accurracy of the turning is quite bad. The robot turns slightly when it should be driving forward. It also runs in an arc instead of turning on the spot.<br />
<h3>
Future Work</h3>
<div>
Next step is to work on improving the predictability of movements for <a href="http://en.wikipedia.org/wiki/Dead_reckoning">dead reckoning</a>.<br />
<br />
Ideally I should give the robot an relative position in meters and the robot moves to that position or very close. For example: Go 0.5 m forward, turn 30 degrees to the right, Go 0.2 m forward.<br />
<br />
One of the motors turns a little stiffer than the other. In order to improve the predictability I will first remove the motors and add some oil to the gears. Hopefully both motors will run better. After that I will do a series of tests to try and use PWM to get similar drive on both motors. When that is done another series of experiments to find the error distributions.<br />
<br />
<br />
<br />
<br />
<br /></div>
Ölsöl en ölblogghttp://www.blogger.com/profile/17053931768398856946noreply@blogger.com0tag:blogger.com,1999:blog-4309985382169013899.post-5216104462844950032013-05-07T20:28:00.001+02:002013-05-07T20:28:04.775+02:00Finally driving my robot, but it reboots the raspberry pi!<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/-JU1A1okJUgE/UXQzA6cnkKI/AAAAAAAADzA/KGyvbYqHu2k/s1600/IMAG2013.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="382" src="http://3.bp.blogspot.com/-JU1A1okJUgE/UXQzA6cnkKI/AAAAAAAADzA/KGyvbYqHu2k/s640/IMAG2013.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Finally driving, remote controlling the driving through serial commands over wireless network.</td></tr>
</tbody></table>
<div class="tr_bq">
<br /></div>
<div class="tr_bq">
Tonight I started to work on code that is driving the H-bridge. The Arduino board is controlling the H-Bridge and I program the Arduino using the Arduino IDE <a href="http://transparentrobot.blogspot.se/2013/04/finally-reliable-ssh-and-vnc-to-my-robot.html">remotely on the robot using VNC</a>. The intended approach is that a program on the Raspberry Pi sends commands to the Arduino over the serial port.</div>
<br />
I wrote a little sketch that receives "aswd" letters and drives the H-bridge. The letter 'a' results in 200 milliseconds of turning left, the letter 'd' results in similar time of turning right,'w' is forward, and 's' is backwards.<br />
<br />
A first problem is that when I run the motors for a little time the RPi is rebooting, I guess it must be due to current drop or something. I do run the robot directly from the same battery pack as all the other components. Maybe a large cap can solve this? Another solution would be to have another battery just for the motors. For now it seems I can run the robot with lower PWM...<br />
<br />
A second problem is that the motors seem to have uneven resistance, this results in the robot turning slightly. I can adjust this by giving the different engines different PWM signals but in order to get good results this must be tuned by experiments. The third wheel also interfers, its a turn-able wheel so when it is in the wrong direction it requires more resistance to turn.<br />
<br />
For this project I use github repository, Im not very used to the shell commands so here they are for documentation<br />
<blockquote>
git repo <a href="https://github.com/dntoll/robot/tree/master/H_bridge">https://github.com/dntoll/robot/tree/master/H_bridge</a><br />cd sketchbook<br />git add H_bridge/*<br />git commit -m "some comment"<br />git push origin master</blockquote>
Ölsöl en ölblogghttp://www.blogger.com/profile/17053931768398856946noreply@blogger.com0tag:blogger.com,1999:blog-4309985382169013899.post-38590339843206694252013-04-30T22:52:00.001+02:002013-04-30T22:53:09.259+02:00Order placed on Gyroscope + Accelerometer and new webcamI just placed an order for a <a href="http://dx.com/p/gy-521-6dof-mpu6050-module-3-axis-gyroscope-accelerometer-for-mwc-arduino-148190">Gyroscope/Accelerometer chip</a>. I intend to use it on my robot to provide better movement readings.<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://cloud5.lbox.me/images/384x384/201211/gy-521-mpu6050-3-axis-acceleration-gyroscope-6dof-module-blue_vhfxyc1353647782253.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="http://cloud5.lbox.me/images/384x384/201211/gy-521-mpu6050-3-axis-acceleration-gyroscope-6dof-module-blue_vhfxyc1353647782253.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Gyroscope and Accelerometer chip(image <a href="http://www.miniinthebox.com/gy-521-mpu6050-3-axis-acceleration-gyroscope-6dof-module-blue_p473285.html">src</a>)</td></tr>
</tbody></table>
I also ordered a <a href="http://dx.com/p/compact-usb-pc-webcam-300k-pixel-25948">mini webcam</a>, the one I currently sometimes produce distorted images when connected to the RPi. Not having my hopes so high on this one but you never know...Ölsöl en ölblogghttp://www.blogger.com/profile/17053931768398856946noreply@blogger.com0