Make It : Robotics Starter Kit

OK - I can use some ideas…

I have connected four pins for power (+5v, +3.3V, 2x ground) - the board already supplies Vin. I also have connected the Raspberry Pi to the shield for data going through the 5V->3V converter. I know the converter and serial work because looping back either the 3V side or the 5V side I get an echo in Minicom.

However, I’m getting no joy in communicating with the board. The Arduino sketch is pretty simple. For initializing it just sets up a serial port:

Serial.begin(10420); //tell the Arduino to communicate with Make: it PCB

And sends commands to turn on the IR sensors:

  dc_write(DC_CMD_IR_TX1, SW_ON);
  dc_write(DC_CMD_IR_TX2, SW_ON);  

dc_write just sends a 0x56 (send command), followed by ARG1 and ARG2.

The odd thing, is according to the schematic pins 3 and 4 are active, but setting up the serial above it implies 1 and 2. In any case, I tried all combinations and none of them do anything.

Just thinking maybe I messed something up, I put it back together with the Arduberry, and it functioned properly. So somehow there’s a difference between what I’m doing, and what the Arduberry is doing.

One thing that occurs to me is since 10420 baud is non-standard maybe the RPi has difficulty communicating in it?

I appreciate any thoughts. I’m seriously seriously thinking of just chucking the Arduino shield and getting RPi versions, I just don’t generally like letting computers win.

Thanks!

Dion

Hey Dion,
I feel a bit lost here. Can you explain a bit on how you have connected everything (a connection diagram would be best ) and can you send us the link to the program that you are using too.

-Karan

OK fair enough I attached a PDF with the shield and GPIO pins. I wrote a lot :slight_smile:

For hardware I connected on shield connector J5 3.3v, 5v, and 2x ground pins (the top 2 in the GPIO diagram). I attached the equivalent pins on J6 to my voltage converter (3.3v to LV, 5v to HV of course). For data, I connected J4 pins 1 and 2 to the voltage converter and the 3.3v pins to GPIO 14 and 15 (TXD->RXD, RXD->TXD). I also tried J4 pins 3 and 4.

I tested the voltage converter by connecting RXD and TXD on the 3.3 side (Pi) before it went into the voltage converter. As expected I got echo in Minicom. I also connected RXD and TXD on the 5v end after going through the converter with the same result.

For software, I examined the C++ code that comes with the shield (and works). What I noticed is for the hardware I have right now (slightly confusing because the same code has some support for add on packs), it exclusively uses the Arduino serial API (http://arduino.cc/en/Reference/Serial) which implies to me it’s only using the RXD and TXD pins unless the device somehow calls back into the Arduino.

To test it, I basically modified a Python script to open the serial port, and write the byte sequence to turn on a motor or an infrared sensor. Unfortunately I don’t have access to that right now.

The shield support files are at: http://blog.radioshack.com/wp-content/uploads/2014/05/Make-it-Robotics-Starter-Kit-Support-Files.zip

Any thoughts on why connecting through the Arduberry is different than directly?

Thanks,

Dion

Oh BTW, your design on the Arduberry kinda reminds me of the CP/M cartridge I had on the Commodore 64 - it had a Z-80 processor on it and basically took over. Looks like yours is basically an Arduino with a GPIO interface :slight_smile:

Hey Dion,
Looking at their schematic and the code, I am pretty sure that they are using the normal Serial Pin (0 and 1) for comms. A baud rate of 10420 does look pretty strange, but I think you have tried that Baud rate with the Arduberry and that works.

What was the problem with the Python script that you were facing ? I don’t know have a very good answer why the shield it not responding. Try swapping the wires and see if that helps. What I usually do in this kind of situation is use a logic analyzer. I just put it directly on the lines and it helps in two ways, one you can capture the good data packets that are sent with the Arduberry and ask get to know which lines are being used. You can make those same packets in Python and send and verify them with the analyzer too and there is no way you can go wrong with it . I practically use the logic analyzer in almost every project.

Coming back, your best bet would be to put a FTDI chip or something and try to sniff the packets and see if you are making any mistake or maybe get in tough with the customer support from Make and see if they can help you a bit.

Your are right, the Arduberry is a glorified arduino with the GPIO and a level conversion chip but helps a lot reducing the wire clutter and allowing access to all the peripherals directly.

I am from the Pentium generation so have never seen the Commodore 64 myself, though have heard a lot about it. Arduino and Raspberry Pi are the closet that my generation gets to tinkering with hardware.

-Karan

Ugh, I think I may have fried another of the voltage converters…

Good tip for beginners - don’t mess with electronics at 1am.

Anyway, at one point today I was getting echo at 10420 baud, so I’ve pretty much confirmed Python doesn’t mind weird baud rates. At one point, I think I was getting stuff back from the PCB too, but I can’t confirm that.

When I’m less tired (and preferably when I have some more voltage converters) I’ll take a shot at it again (a few days from now).

Thanks for your help - and yeah, your generation missed out. Computers at the beginning were fun, then they went REALLY general purpose (AKA boring) - I’m glad they’re getting fun again…

Dion

OK less tired, and goodies came from Adafruit.

No I didn’t blow up another voltage shifter (yay). I found out apparently that Raspberry Pi’s get unfriendly when you swap RXD and TXD wires.

Unless python is simulating echo for some reason, and I don’t think it is, I am communicating with my board because it’s sending back the command I send. IOW, Serial.Write(b’x56x70x00’) (DC_SEND_HEADER, DC_CMD_IR_RX1, 0) returns 3 for 3 characters written, and Serial.Read(10) right after returns those three characters. What I was expecting was DC_RECV_HEADER, DC_CMD_IR_RX1, and some value.

Essentially Question: “What’s the value of IR1?” Answer: “What’s the value of IR1?” :slight_smile: But hey, it’s an answer!

Starting to think it might save me a lot of pain and agony just to get a board designed for the Raspberry Pi, or at least connect the shield to the Arduberry, and communicate to the RPi through the Arduino API, but I feel like I’m so close, and this source code is SO straightforward :slight_smile:

Edit: original initialized IR1, meant to read it.

OK, question: if you fry a Raspberry Pi through the GPIO pins, would it act erratically or just not at all?

Reason I ask is I’m pretty sure I’ve done bad stuff to it, connecting the wrong power, etc. I’ve gone back so that the only thing it’s providing now is power to the robot board, and it’s crashing on a regular basis, getting some weird results on the multimeter etc.

If I mortally wounded a Raspberry Pi, that’s cool, I have two others. But if you think it’s more likely something systems related (e.g. bad block on the SD card) I’ll keep working it :slight_smile:

Dion

Hey Dion,
Since you were playing with the power supply, you might have damaged the Pi itself or maybe the SD card. The easiest way to find out if anything is wrong is to connect the Pi to the monitor and check if it shows any errors.

-Karan

OK, well first things first. I found out that once I actually learned how to solder - it’s pretty easy :slight_smile: I always applied the solder to the iron, instead of just using the iron to heat the metal and then touch with the solder. Good news, I think I can easily do that in the future, bad news - I think before I fried another voltage switch and that was my problem.

But no more - I thought hey that was fun, learned a lot, but the makes sense factor just isn’t there for me to continue this, so I went and bought a motor control designed for the Raspberry Pi.

As for the Pi issue - I think my SD card image was bad. I copied it to a MicroSD to use in my Raspberry Pi 2, and it didn’t work on that one either. I went ahead and burned your image, updated everything, and it appears to be running OK. I think the kit is still useful because it gave me some sensors, motors, and hardware relatively inexpensively, but adding a voltage converter so you can talk to a weird microcontroller just to turn on two motors and read two IR sensors isn’t quite there.

Thanks for the help! Do you have any interest in the PCB?

Hey Dion,
Sad to hear that your journey came to a premature end but it’s great that you learned a lot. If you want to play with the low level stuff I would really suggest you to get a logic analyzer. This project would have been over long back if you had that.

With the PCB, do you mean a motor controller and some sensors designed for the Pi?

-Karan

Oh my journey isn’t at an end. I’m having too much fun. My journey fighting with a board not designed for the RPi is. Since all the board does is fire motors and read IR sensors not worth the battle.

So what I’m offering is the arduino shield if you want it :slight_smile:

I think you should keep the shield yourself or maybe give it to someone else whom you find worthy. I already have a lot on my plate and the GoPiGo also has a lot of active development going on, and one robotics platform is enough for me to play with.

All the best for your future endeavors and thanks again for the offer.

Happy Hacking,
-Karan

OK, so not so particularly successful at the whole giving up thing…

Took a look at some of the wires, and a number of them were - well deficient, including one of the power wires which was hanging on for dear life. I took off a little bit more of the end, put some solder in it, and what do you know - it was acting normal again. Also, the demise of my RPi B was a bit premature as well. SO - I’m back at the point where I was before - getting echo, not responses.

I still have the motor board on order from Adafruit, so if I really can’t figure it out I’ll just switch to it, but I’d find it very satisfying if I could get this to work, since it’s totally not designed for the Pi.

Anyway, more to follow. I think I may hook up my other Pi, and see if it gets anything back on those other pins on the schematic (I think 3 and 4). I know you keep saying get a logic analyzer, but that’s more than my boss (my wife) will let me spend right now :slight_smile:

Thanks again for the motivation…

Dion

OK, so here’s the latest - apparently at some point I killed my PCB. That’s actually kind of cool because I learned a lot as I went along. Specifically it was kind of like getting lost when you move to a new city… You learn far more than just going the places you know.

Anyway - since I’m running your Raspbian, and your GoPiGo starter kit looks a lot like my robot, do you sell your PCB separately? I think I could pretty easily turn this into a GoPiShack :slight_smile:

Hey dionhouston, unfortunately we can’t sell it separately. We have them made and stored as the GoPiGo base kit:

http://www.dexterindustries.com/site/?product=gopigo-kit

Sorry about that!

OK, I still think you guys are wicked awesome, and will buy more stuff from you, but I’m now good. I got the RTK motor board from Adafruit (https://www.adafruit.com/products/1687) and it connected straight away to the motors. I wish I’d realized a month ago how easy that’d be :slight_smile:

I’m trying to decide if I’m going to hook up the IR sensors or not. I got an ADC (https://www.adafruit.com/products/1085) that I assume it’ll hook up to OK, but the next step is to put an XBox receiver on it so I can move it with a controller :slight_smile:

Needless to say this is wicked awesome - I made a python script to move the robot. Really really cool :slight_smile:

Hey Dion,
The motor controller shield does look nice and should be very simple to control too. Just be a bit careful with it, it does not seem to have any external diodes for back emf protection so just try not to do something too fancy with it, it might damage your Pi. We have the same controller on the GoPiGo and have seen a couple of the chips burn but they were not directly connected to the Pi.

Also, if you are planning to go for a remote control bot, do have a look at the PS3 control bot that we built for the GoPiGo http://www.dexterindustries.com/GoPiGo/projects/python-examples-for-the-raspberry-pi/raspberry-pi-ps3-control-with-gopigo-robot-example/. It was really a lot of fun and it is one of my personal favorites.

-Karan

OK, thanks for the heads-up. To be honest I might switch it out. At least through GPIO the controls are as simple as it gets 100% forward or 100% reverse x2 motors. I’d like to have more fidelity over the power. I haven’t tried it through I2C - the documentation is a little… lacking.

The XBox controller was super easy. I knew the driver was ported to the Pi, what I didn’t know is someone wrote a Python script to simplify it. Since my robot code (and yours!) was already in Python, integrating it was super super easy. BTW, boo on you for going with the PS3 - but as engineers guess I’m not totally surprised :slight_smile: http://www.stuffaboutcode.com/2014/10/raspberry-pi-xbox-360-controller-python.html

Now that it’s a working robot I got two kids interested - my oldest is about to go off to college, and she’s seriously considering computer science engineering now :slight_smile: And my youngest really wants to learn programming again. So I’m accomplishing my main mission with this. I need to get another Pi, though, because I have some little projects I want to make - a cheap mechanism for streaming audio/video and a cell phone detector.

Thanks for being awesome :slight_smile: