Arduino + Raspberry Pi w/AlaMode

I need confirmation from those who have used the Rover kit from Lynxmotion. I am wondering if I can connect the botboarduino to a raspberry pi via alamode interface connector (I think that’s what you call it). Would all the servos and motors work with this combination? I presented the botboarduino specs to my project advisor and he nearly laughed at the specs. My thought was to pair it up with the raspberry pi to make the botboardino or other arduino more powerful. Is this even possible? My main concern is interfacing the motors and servos with the raspberry pi, botboarduino/arduino. Is this possible? Thank you in advance for any help you can provide.

note I have very little experience with Arduino and none with raspberry pi; just trying to make the Lynxmotion compatibile with the project’s requests (Sensors, camera, etc, 1 controlled robot, 1 autonomous robot that follows the controlled robot).*

I thught I would seek help from you guys! Thank you again for any help you can provide.

If it were me, I would probably simply connect the Botboarduino (or other Arduinos), directly to the Raspberry Pi, by using a USB connector. They could directly communicate using serial port. It would create a device name like: ttyUSB0 on the RPI. As for connecting a standard Arduino including the Botboarduino directly up to the expansion connector of the RPI there are voltage issues. Most Arduinos run at +5v, whereas the RPI runs at 3.3v. Note, there are some Arduino compatibles such as some from Seeeduino that are switchable to run at 5v or 3.3v.

I don’t have any experience with the AlaMode (makershed.com/AlaMode_for_Ra … /mkwy1.htm), but it looks like it it plugs into the expansion connector of the RPI and is itself an Arduino compilable board. It also looks like it has voltage shifters for the IO pins. Did not look carefully enough at the specs to see how this board uses these IO pins.

Not sure how it is you want to connect the botboarduino to the Alamode board. Lots of options, but also not sure why you would need both. That is you should probably be able to connect the motor controller up to the Alamode board, likewise maybe for servos. But again I have not used these, so it is only a guess.

Kurt

Kurte,

Thank you for the prompt reply. My next question for you is this: If I connect the arduino and raspberry pi, will the arduino inherit the properties of the raspberry pi (the increased CPU and memory)? Also, is the arduino able to interface with the motors/servos when connected to the RPI, or will there be compatibility issues with that? I believe the Alamode is an interface connecting the arduino with RPI, without using the usb/serial port connector.

I did check out the seeduino and will certainly keep that as a possibility. Not sure what the difference is exactly, other than it having the voltage controls (5 to 3.3v), but good to know about the voltages.

The first thing to understand, is when you connect up a Raspberry Pi to some form or Arduino, you simply have two different processors connected up to each other, that you need to write programs for. What you do on each one and how or if the two processors communicate is up to you to design.

There are lots of options for how you might setup this stuff to work. A lot of how you do it depends on your needs. currently I have two Rovers. One of which is the Lynxmotion Rover and one by Orion Robotics (Basic Micro). More details up on the thread: forums.orionrobotics.com/topic70.html It has been awhile since I have played with them, but I believe the state I have left them in is:

The Razor (Orion Robotics), has a BeagleBone Black(BBBk) Linux board. I am using one of their motor controllers (basicmicro.com/RoboClaw-2x5A_p_47.html) to control the motors. I have encoders on two of the motors that connect up roboclaw. The BBBk has several USARTS on it, which I am using one of them to talk to the Roboclaw. Note: The IO pins on the BBBk are 3.3v, but I verified with Dale and Nathan at Basic Micro that it was compatible with 3.3v, turns out the XMega on that board also runs at 3.3v). Likewise I have an XBee connected up this robot using another one of the Usarts. I also have a Pan/Tilt/Rotate camera hook on this one. I believe I have the BBBk driving these servos as well. I have them breadboarded on one of the BBBk prototype capes.

The Lynxmotion Rover, has a Raspberry Pi in it. Again I am using a Roboclaw to control the motors. I am using a USB to serial adapter to connect the Roboclaw to the RPI. Alternatively Basic Micro sells a USB version of some of their Roboclaws, like: basicmicro.com/USB-RoboClaw-2x15A_p_281.html. I am also using a USB XBee adapter on this one as well. I don’t have any servos on this one.

Note: If I were needing several RC type servos, Alternatively I might hook up an SSC-32 to control the servos. Or I might choose to to use Robotis servos like the AX-12 servos and connect these servos up by using a USB to dynamixel adapter, such as: seeedstudio.com/depot/index. … ax&x=0&y=0.

Again all of these solutions I mentioned, do not use a secondary GP processor such as an Arduino. They could and they might. Earlier I purchased a PiPlus board, but never actually did anything with it.

My 2nd RPI is actually in a T-Hex robot, connected up to a prototype SSC-32 board, that has a USB interface. Hopefully soon that board will be released. There are other thread up here and on Trossen Robotics about this one, as well as others who have also used the RPI.

Not sure if this answers your questions or not.
Kurt

Do you have an objective for the project? An Arduino microcontroller offers great value and flexibility when it comes to connecting sensors, motors and various other digital / analog devices. You can also easily control other simple devices like motor controller, data communication (RF, Bluetooth, WiFi etc) and more.

An Arduino however cannot really do video processing, and is not intended to run a complete operating system. The Pi is also great value when it comes to “bang for the buck” as you can run a complete OS with Linux UI. The downside is that it’s less easy to work with and still needs peripheral devices.

As Kurte mentioned, you could “offload” the more menial tasks like motor control, sensor feedback etc. to the Arduino and have the Pi simply take care of the camera.

Forgot to mention, that depending on your video processing requirements, you may also find that you still want more horsepower than the RPI can give you. There are several threads up on Trossens forums talking about Raspberry Pi and video processing and the like, including a couple of them by KevinO such as: forums.trossenrobotics.com/showt … spberry-Pi

He maxed out the RPI doing some video processing and has since then migrated to an Intel NUC. I also have a NUC as well and I also have an ODroid U2. Another ODroid that would be great is the Xu (hardkernel.com/renewal_2011/ … &tab_idx=2) Has lots of CPU processing available and a lot of IO capabilities.

But again it depends on your requirements. One reason I am looking at the Odroid as well as the NUC, is for the ability to learn and play with ROS. There are already some interesting setups out there that are using ROS like the turtlebot (turtlebot.com/). I know that some of us are starting off by looking at adapting the turtlebot code base to work with our robots. However this stuff makes my head hurt!

Wow, I never expected this sort of response! Thank you guys for your input!

CBenson, my requirements are this: Build 2 robots, 1 remote controlled, the other, autonomous, that follows the remote controlled robot within 10 feet or less, but greater than 1 foot. I thought the Lynxmotion rover would be a great candidate for this position, however, I am not sure if the botboarduino is powerful enough to move, and have say 8 sensors per robot. My main concern was the interfacability of the motors and servos with the botboardunio and possibly RPI combo, with or without the alamode interface.

note, the sensors would not be the Lynxmotion sensors, but rather, another brand.

Do you think the botboarduino meets these specifications?

You did not mention a vision system, so the BotBoarduino should be powerful enough. You need to know that it only runs one line of code at a time though…

Again need to flesh out more of what your requreiements are:

You also did not mention what the 8 sensors are. What are they connected? I2C? 1 or more IO pins each… Also how much processing does each one need? …

As for power. Have had two different rovers that are controlled by remote controls (PS2, XBee, …) run just fine using an Atmega 328P based Arduino (Botboarduino, Uno, …). Again with these I used motor controllers, which were either Sabertooth or RoboClaw. Normally I use the non RC versions and talk to them using serial packets. If you need to know how far a rover has moved, then you may need to use encoders on some of the motors. This is where Roboclaw is great. You can use the Arduino to process the encoders, but if you use the Lynxmotion motors and encoders, it will eat up a whole lot of the CPU. Suppose wheels running at 150 RPM with 30:1 gearing and the encoders have 400qpr, that will give you something like 30000 changes per second per motor…

So again you need to figure out things like: how many IO lines do I need: Arduino has 20 total, 6 can be analog, 2 are taken by USB connection (but can be reused in some cases). Note on Botboarduino, we have 4 others optionally used for buttons and speaker, but these can be disabled.

Talk to sabertooth/Roboclaw: 2 (could go simple serial and ony use 1? ) Could maybe use some motor shield which will takes at least 4

Remote control: Use lynxmotions PS2 - 4 IO pins. Use XBee based system like our DIY remote or Arbotix Commander (2) but issue of doing serial communications (only 1 usart on USB, can overload but…). Lots of other options as well, BT, Wifi, …

Detect batteries voltage: Botboarduino has voltage dividers for VL and VS, probably need to use at least one of these maybe both…

Sensors…

Also the Atmega328 processors only have about 32K of code space (minus boot-loader). Only 2k of data space, 1k of EEPROM. Can you get your stuff to fit? Note we have hexapods with 18 servos being drivin by one of these, so you can do quite a bit.

Also runs at 16mhz…

Note if you go with the AlaMode on the RPI - You have the same capabilities as other Atmega328 processors. Not sure which IO pins may be tied to Raspberry PI.

Now if you go Raspberry Pi, you have a lot more available to you. like it runs at something like 700mhz (can be overclocked), has something like 512mb of memory on the expansion connector you have something like 8 IO pins, plus a usart, plus I2C, SPI… All of which I believe run at 3.3v. Now depending on your sensors and the like, they may need different voltages. You can always use something like: sparkfun.com/products/11955 … 8-60554477 to do this for you. Also with RPI if you need more capabilities, can plug in USB devices, such as USB to serial devices… Mentioned before… BBBk (mentioned earlier) runs slightly faster, has more IO pins…


As can you do this with just the Botboarduino? Don’t know. May find the remote controlled one can easily be done this way and maybe the one that has to follow may need the RPI, which you may find using a Botboarduino with it to be handy. That way you can use the same code on both rovers to do some of the simple stuff like simply drive the rover. But then again that code is not hard to write for either platform.

Note: last night I looked through the AlaMode users guide, and it looks pretty interesting. It has an SPI, I2C and Serial connection to the RPI. Also a possible plus for it versus using with Botboarduino is that it looks like it mounts with the RPI, so may make easier to lay things out.

But if you are maybe thinking of using one of the new RPI camera units, not sure if you can use them together as I don’t know if the Alamode has the possibility of bringing out another connector to plug the camera in. and B) if they might want some of the same resources.

Another question from my advisor, he was asking: Is there a voltage graph anywhere for the specter controller? He want to know how many volts full throttle is vs. barely touching the accelerator. I think there are 128 different controller positions are there not with the specter controller? The PS2 is too short of range.

I am really leaning towards the arduino board handling the motors for the robot and leaving the sensors for the RPI or other microcontroller platform we use. I am really only familiar with C/C++ programming and I know that RPI is python, but I guess its a good excuse to learn a new language, right? :smiley:

Although, I would also want to program in LISP in the coming year or so.

Side note anyone ever programmed a robot in LISP/Scheme/Clojure?

Back to the main topic

I am also considering the pSoc from Cypress. We are just getting some in class on Tuesday and I cant wait to see how they perform. Anyone here used a cypress pSoc before in robotics or in general?

To confirm, you would be looking to integrate a longer-range R/C system with an Arduino or other microcontroller?

Can’t say I have personally, but I’ll ask around here.

CBenson, that is correct. I’m looking at getting the autonomous robotic rover with microcontroller and another RC rover, with that spectrum 5xe controller (the brick I call it).

I would also like to know if there is any software for the robot for the servos (the ones that control the motors). Our group has a very unique idea as to best approach the algorithm design for our AI unit along with the remote controlled one.

Again, my advisor was asking about a throttle position-voltage output graph. For instance, full throttle may be 5v, where as 20% might only net 2v. Is there a chart anywhere online with this information? I’ve been looking at a lot of different sights but to no avail. This may be where the software may come in handy; I’m hoping there is software that addresses this, or perhaps, relays information from the controller through to the autonomous robot via computer.

Thank you for any help you may have.

The output of the Spektrum R/C receiver is not analog; it is R/C signals which are:
5V pulsed for between 500 and 2500us (depending on the desired position) and repeated every ~30ms.
You won’t get an analog signal from this.
If you are instead looking to open up the remote control to use the raw analog values from the joysticks, that is a different issue. Perhaps you can describe a bit more (in a bit more detail) how you foresee the setup working?

Thank you again for that information. Another question per my adviser. He was saying the last couple of times he has made one, there has been an encoder on each motor which told the # of RPM for each motor. Is the information about the R/C signals pulsed from 500 and 2500 us and repeating every 30ms the format of the R/C pulses? Thank you again for the help.

If he used an encoder, that’s likely with a DC gear motor, which operates very differently that a servo motor. Yes, R/C pulses operate as you describe. The duration of he pulse is related to the position (there are electronics usually located at the bottom of the servo which wait for timed pulses and relate them to positions / angles.

You are correct about the encoder. He did mention that. Let me post a statement from his previous email that I think may help direct the course of this conversation.

“we need to find a way to, through our control S/W on the chase [autonomous] robot, set the motor speeds to follow the piloted [controlled] robot. On the VEX kit with the old MC there was an easy way to command (an “EASY C” command - [the previous project leader] can tell you about this) the motor speeds and also with encoders on each wheel get the current motor speed (either RPM or command level - according to the website with the graph sent earlier this digital range is 0…100 for our motor). Is there a way to do this (command motor speed without a joystick and determine current motor speed) with the lynx system?”

This seems to be the deciding factor for our group. I do apologize for the length of this conversation, but I really do appreciate all of your help.

Simple answer yes it is doable… What I have is Raspberry Pi hooked up to Roboclaw. Easiest way is one with USB that you simply plug in (lynxmotion.com/p-448-quadrat … cable.aspx)

The encoders plug into the Roboclaw, which gives you the ability to do things like tell it to go so fast and/or go so far… You can also do queries to find out things like how fast am I going, How far have I gone… The information is in encoder units, so for example if one rover has bigger tires or the like you need to adjust your code to compensate for this. There are details up at the Orion Robotics link, including the manual as well as example code for several platforms including the RPI…

Kurt

It makes even my head hurt sometimes!

I would LOVE to have a platform that could run a full ROS setup and didn’t cost an “arm” and a leg. I am looking at the UDOO, which so far seems to have the best of both worlds (ARM for Linux and Arduino Due for Arduino stuff). They are a bit pricy though, at $135.00 for a quad core board. I’m going to tinker with having my Arduinu (true blue) and BotBoarduino be an I2C slave to one of my ARM platforms (PandaBoard ES, BeagleBone Black, and Raspberry Pi (x2)). I need to get some expansion connectors soldered to the PandaBoard ES though. :frowning: I may aquire another BeagleBoard-xM - I always did like these.

I’ve been buying a lot of I2C based stuff from Adafruit. I created a little project on a breadboard that has a 4 digit seven segment display, 8x8 matrix display, a 10 DOF IMU, and a DS1307 real time clock (with battery backup) on it. Right now, it’s running off Chip (one of my rPi boards), but I ran it from my Arduino first. I also have a project running on my Arduino that can detect which side a sound came from using two electret mics. I’m going to expand this to four mics for front/back sound detection on W.A.L.T.E.R. The mics have tweakable gain. :slight_smile:

I’ve got some nice 4 channel level bi-directional shifter breakouts from Adafruit that are I2C safe, so I’m not afraid of this sort of thing anymore. :slight_smile: I’ve been having a great time tinkering with stuff and am looking forward to adding some of this to W.A.L.T.E.R. I’ve got two motors, motor controller, and a few sensors wired up now, and a pan/tilt on the front with two sensors. I have the sensors wired to my BotBoarduino, and I think I’ll put Pod (rPi) on W.A.L.T.E.R. too. I love the rPi, because everything on it just works - it’s like the Arduino of small Linux computers. I still need to get I2C working on Stargazer (BBBlack).

I’m looking forward to putting in new orders to Lynxmotion and Adafruit soon, so I can get W.A.L.T.E.R. fully operational. :slight_smile:

8-Dale

Sounds like you are having some fun. Looking forward to seeing Walter up and running again.

The UDOO looks interesting, but for a strict combination like board, I think I will wait for the Arduino Tre to come out. It will be an official Arduino board that has a BeagleBone Black merged with it.

For my next Linux box to try, I have now on order a new Odriod U3 board (hardkernel.com/main/products … 8760240354), which has an Atmega328 on it that you can use Arduino to program (20 IO pins), plus a Toshiba I2C GPIO expander chip which gives you 16 more digital pins. Will ship later in January. Their prices are pretty good, but you also have to factor in that they charge $30 for shipping.