Sunday 10 April 2016

A LONG long time ago !

SO, it's been a while since I blogged last. For reasons I might go into, I've been a little busy, learning about the Raspberry Pi, and building different things with it. My latest is a Hive camera, which I have a video for now (But won't post until tomorrow).

I've also successfully built a couple of rovers that can be controlled over a wi-fi connection. I've also tried to control them over the popular (and cheapish --in Cairo) nrf24L01+ radio transceiver, with little luck (But only because I'm very impatient as you might expect).

Also there is the programming, quite a steep curve.

So anyhow, here are some pictures of the inventions/copies.

This is the KodiBot. Basically the Legopi running Kodi. I had to make it a little more friendly for my Nephew.
I decided to also do some more experimentation using the GPIOs of the Raspberry. Was quite fun. I bought this from ElNekheily in BabEl Louk. I was done obviously, as I paid 18LE for it. You can buy the parts from Future Electronics for a much more reasonable price. Anyway. The build went well and I managed to get it working the next day.


Below and Right-- The Prototype pIRcam Rover:
I mounted the Raspberry in a lego block and taped it to the battery packs(total 8x 1.5v) A single motor driver, 4 motors(2 and 2 connected in parallel). Each side controlled by half the motor driver. I controlled it by the Wi-fi dongol, and remote desktop connection. I was also successful in writing a pygame script to control it via keyboard and PS2 joystick. Quite neat really. I also (as you can see to your left) added an IR camera to the raspberry. so that I could see in the dark. I also added a separate USB power supply to the Raspberry

By the end of the night I was exhausted so I took some photo's and decided It looked very Robocop like.

The next day I decided that I didn't like it's too rugged look.  So after looking like this:
I decided to make it a little prettier. Put some LEDs, Head-lights, reverse, and stop lights etc (Not shown). But I couldn't stop there so I made a bodykit!






Meet the Lambogreeni (Strike II)




Made from Recycled cardboard and Lego.








The Spoiler is obviously just decorative. I later added a switch and the LEDs. They even responded to the Rover when being controlled by the PS2 controller. (But ate up the batteries)

As this was just a prototype, there has to be a real deal. Which came into being when I saw the Dagu Thumper in store. (Which was QUITE expensive)... SO, after comming into some money I went and Bought it. (Now remember that availability is an issue sometimes in Egypt, so this was about a month or two later).
And Lo and Behold... the Thumper....  

Now let me just say that this isn't your run of the mill hobby. This is expensive shit! Which doesn't always work the first time around. So before I started mucking about with wiring, I needed a Motor driver, something that could handle the 6.6Amp stall current required for EACH of the motors on this bad boy. And as things are limited, I decided to spend my money on the T-REX motor driver... also by Dagu.

Sooo, with the motor driver in place, and the raspberry relocated, I pulled out my battery packs from the prototype hooked everything up, loaded up the scripts, and ................................   Nothing.

The motors barely moved! I couldn't understand what I'd done wrong.  What mistakes, if any (or how many) had I made? I was disgusted at my lack of information.
Basically my battery packs weren't providing the current required for the thing to go! I needed a Lipo! Being the chemical expert that I am , I inquired about where to obtain such a device. I searched high and low, to no avail. I asked the oracle, Facebook, and was told that these things are very far and few between... Which basically meant I had to either wait to get one from abroad, or pay an arm and a leg for one.

SO I decided to wait.
While I waited I decided to make use of the rest of the lost toys. I was after all, a lost boy. How could I voluntarily just give up my arm and leg for a lipo. It wasn't going to happen. It shouldn't... It couldn't!
As my creative juices flowed, I decided to get to know the T-REX a little better. A couple of motors were purchased for a whopping 20LE (I got 4 motors and wheels for that price). Cannibalized my home made combine-harvester mechano toy, and made instead a tractor with a single battery pack (4x1.5v) and the T-REX on the trailer.


Now, ladies and gentlemen, I don't know if you know, or perhaps even understand the meaning of frustration.

Frustration is a state of mind, so debilitating, that it causes you to doubt even the fabric of reality itself. It is doubly so when you have no idea how to program in C.

The T-REX motor driver is the definition of frustration. 

So as the fabric of space-time seemingly disintegrated around me, (if that is at all possible or even detectable by my senses, or anyone else's senses) I was lost in an eternity of semicolons, and void loops.
Though I've no doubt the program provided with the T-REX is a masterpiece far far away from the fabric of reality I live in... It is just that, virtually impossible for me to accept at face value. SO in an attempt to justify what Albert Einstein defined as madness, I set forth to repeat the same code in order to get different results.

Which was of course futile.

Here are some of the reasons.

1- T-REX is trying to be too much at the same time.
2- The Raspberry pi's I2C clock is somewhat defective when talking to arduino like devices.
3- Error handling code SUCKS.
4- I'm a/was a Bio- major... They teach us to grow mold (which isn't that difficult).

After a long long LONG time (remember, the time space continuum disintegrated.... And no, I was not sadly stuck in a time bubble), and some help from the folks at the raspberrypi forums, I was able to get the raspberry to communicate with the T-REX via bit-banging through Pigpio.
I got rid of the error checking crap in the T-REX software, and everything worked fine!

Magically, during the disintegration of my consciousness, and the discombobulation of the soulless universe, it's recombination with the miniature fabric, what just happened to reappear in the portion of it that isn't dark matter, or that which isn't spontaneously being converted to dark energy... a Lipo appeared! It also came coupled with a B-MAX Lipo charger, and (cruelly) a used autopsy saw (not pictured for obvious reasons)...


Meanwhile, The tractor got a IR receiver upgrade via an old apple I-mote, and an Arduino uno brain in the trailer. (I forgot to mention that the universe had also endowed me with new C skills for programming arduinos, specially when they don't want/need to talk to Raspberries!)


The PiRover is now a reality. With my TP-link Wifidongle, I'm able to drive into the kitchen, scare my mum, terrorize the dogs outside, right up to the point where the wifi connection drops, causing the thing to knock into the palm tree at the bottom of the garden, and try to keep going... no doubt a glitch from the reconstruction of the space part of the space-time continuum...

All is well that ends well ...

Now where is that autopsy saw......

No comments:

Post a Comment