jonititan
Posts: 30
Joined: Sat Aug 06, 2011 2:05 pm
Contact: Website

Re: Using RPi as a Standard Robotics Interface

Fri Sep 30, 2011 8:47 am

http://alanwinfield.blogspot.c.....rface.html

You could use the Robotic Operating System and have the raspberry pi as subnodes. Each RasPi controlling a motor or sensor cluster

tntexplosivesltd
Posts: 72
Joined: Fri Sep 30, 2011 8:08 am
Contact: Website

Re: Using RPi as a Standard Robotics Interface

Fri Sep 30, 2011 9:15 am

This would work better if the RPi had some sort of breakout connector for UART or I2C pr something like that. What does it have?

tntexplosivesltd
Posts: 72
Joined: Fri Sep 30, 2011 8:08 am
Contact: Website

Re: Using RPi as a Standard Robotics Interface

Fri Sep 30, 2011 9:19 am

Owait, it has GPIO, I2C, UART, SPI and JTAG. That makes me a lot happier.
i2c or UART look like pretty feasible options for modules. Have motor/sensor clusters connected to a small mocrocontroller each and have them act as slaves.

jonititan
Posts: 30
Joined: Sat Aug 06, 2011 2:05 pm
Contact: Website

Re: Using RPi as a Standard Robotics Interface

Fri Sep 30, 2011 11:19 am

With the Raspi sending sensor data and receiving commands over ethernet

tntexplosivesltd
Posts: 72
Joined: Fri Sep 30, 2011 8:08 am
Contact: Website

Re: Using RPi as a Standard Robotics Interface

Fri Sep 30, 2011 11:45 am

Yes! TCP/IP for the win!

gbulmer
Posts: 52
Joined: Wed Sep 28, 2011 9:11 pm

Re: Using RPi as a Standard Robotics Interface

Fri Sep 30, 2011 5:22 pm

Quote from jonititan on September 30, 2011, 09:47
http://alanwinfield.blogspot.c.....rface.html

You could use the Robotic Operating System and have the raspberry pi as subnodes. Each RasPi controlling a motor or sensor cluster

What are your use cases or scenario's?

Short of something like vision, many of the robots that hobbyists and children in school make are just about within the capability of an Arduino.

In fact, the UK Micromouse Junior Line Follower champion used a Freeduino Nano to win UK Micromouse Junior Line follower 2010 and UK Micromouse Junior Line follower 2011. That mouse was 2x faster than any mouse built by any adult, so IMHO it is a reasonable example. (He's a person I had the privilege of introducing to programming, using Arduino, and we still chat most weeks.)

Certainly even more robots are within the capability of an ARM Cortex-M3. I am told STM32F1 is in the majority of world class competition micromice.

Of course Micromouse is only one 'data point', but it is worth considering that a world class mouse moves several mm in one millisecond. It is a real-time system. High-speed, high-precision motors may generate as many as 100,000 pulses/second (which would be interrupts on R-Pi), feeding back position information. They might also be sampling analogue distance sensors at more than 10Ksps, and gyros, to detect and correct for drift and slip as they accelerate and corner. Some of those mice can accelerate at faster than 1g.

You might use ROS, but I don't understand why you'd like to put a non-real-time system between it and real-time hardware? Would you explain?

IMHO, a Cortex-M4, for example a STM32F4-DISCOVERY with no OS, might actually be easier for beginners to get to grips with than R-Pi for a robot.
It has fast analogue input for sensors, and PWM to control motor speed autonomously, which AFAICT are both missing from the R-Pi.
It probably has enough calculation power for a large range of robotic control problems.

To put it into context, one of those STM32F4 could control 8 DC motors with quadrature decoding (to track motor velocity and position), read 16 analogue sensors at about 500ksps/sensor, and talk to multiple gyros and accelerometers purely using its built-in hardware peripherals and DMA. It is a different beast from an R-Pi processor.

I am not opposed to using an R-Pi for robotics. I'd use one for development, testing, analysis and experiments (it seems like a 'no brainer' to use R-Pi as a development host when the robot uses an ARM MCU). Also I might want to use R-Pi for vision, environment modelling, collaboration and co-ordination. But I don't think it is well suited to motor control or sensors, and IMHO there are very good alternatives.

tntexplosivesltd
Posts: 72
Joined: Fri Sep 30, 2011 8:08 am
Contact: Website

Re: Using RPi as a Standard Robotics Interface

Fri Sep 30, 2011 10:16 pm

The RPI looks like a suitable alternative, and I don't see why it couldn't be used in most hobby applications. It's an all-in-one unit, and remember it's a computer, not a mocrocontroller, so of course things like ADC are missing. PWM is easy enough to reproduce. So yes, in some applications it might not be the best thing, but for the general hobbyist it looks fine.

gbulmer
Posts: 52
Joined: Wed Sep 28, 2011 9:11 pm

Re: Using RPi as a Standard Robotics Interface

Sat Oct 01, 2011 4:22 pm

Quote from tntexplosivesltd on September 30, 2011, 23:16
The RPI looks like a suitable alternative,
a suitable alternative to what?

The original post at the start of this thread said:
have the raspberry pi as subnodes. Each RasPi controlling a motor or sensor cluster
I explained that R-Pi had neither ADC for sensors, nor PWM to control motor speed, and it is easier to implement many classes of robot when those capabilities are available. If that is the case, an off-the-shelf microcontroller would do those jobs better, for less cost, and less complexity.

AFAIK the R-Pi is not a hard real-time system. IMHO, robotic sensing and motor control are easier to develop, debug and use within hard-real time systems.

and I don't see why it couldn't be used in most hobby applications.
to do what?
We are discussing robots still, right?
Would you please explain what you see as "most hobby (robot) applications"?

It's an all-in-one unit,
It hasn't got ADC, which is a very useful peripheral in robotics, nor PWM/timers, which are also very valuable. Nor has it sensors, and it can't directly drive ordinary electric motors, so there will be at least one more chunk of electronics needed to make a robot.

So In what sense is it an "all-in-one-unit", and why is this important? I don't understand.

and remember it's a computer, not a mocrocontroller, so of course things like ADC are missing.
Lack of ADC is one reason why I don't think R-Pi is a good fit for the original posters proposition.
So how do you propose that is mitigated?

PWM is easy enough to reproduce.
On a Linux system? To what quality?
How consistent and reproducible do you feel is good enough? How would you do that, and how would you debug it?
So yes, in some applications it might not be the best thing,
The original post was suggesting a specific role:
have the raspberry pi as subnodes. Each RasPi controlling a motor or sensor cluster
Do you think R-Pi is a good fit for that vs a microcontroller like the STM32F4, or even an Arduino?
but for the general hobbyist it looks fine.
How are the missing features which robot-building general hobbyists might expect, like ADC and PWM provided?

In what way is the robot architecture proposed at the top of this thread adequately implemented with a R-Pi?

I still suggest that a microcontroller is a better, cheaper and easier solution to
the original posters proposition. I think I explained how all of the R-Pi's shortcomings could be satisfied by a microcontroller. I think the microcontroller has more than enough 'horsepower' to implement the original posters architecture. At that point, the R-Pi is unnecessary. I don't think an R-Pi is a good fit for those tasks,

I think I also explained that I wouldn't use an R-Pi for those tasks, but I would use it to implement other functionality in a robotic system.

User avatar
abishur
Posts: 4477
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
Contact: Website

Re: Using RPi as a Standard Robotics Interface

Sat Oct 01, 2011 9:38 pm

I actually agree with gbulmer, most microcontrollers have a start up cost very close to the r-pi's cost (i.e. the cost of the cable to program the chip). That said, I do think that there are many applications that the r-pi could be used for hobbyist-wise, perhaps not in direct application to the OP, but in the broad hobbyist community (IE, to provide a web-interfacable relay controller for a sprinkler system). I also know that software can emulate hardware and I wouldn't be surprised at all if people who just really wanted to use the r-pi would be able to use software to fix any shortcomings the r-pi is lacking... but it would be easier just to use the microcontroller for such situations ;)
Dear forum: Play nice ;-)

tntexplosivesltd
Posts: 72
Joined: Fri Sep 30, 2011 8:08 am
Contact: Website

Re: Using RPi as a Standard Robotics Interface

Sat Oct 01, 2011 10:54 pm

At any rate, I hope use thr RPi for robotics, as it is cheaper than many microcontroller solutions. Each to their own I guess. Planning on making an ADC expansion board too.

tntexplosivesltd
Posts: 72
Joined: Fri Sep 30, 2011 8:08 am
Contact: Website

Re: Using RPi as a Standard Robotics Interface

Sat Oct 01, 2011 11:11 pm

Besides, for the above architecture described, each sensor/motor node could have its own microcontroller (e.g. PIC12F683 or something like that, which could control that sensor/motor. These could then talk back to the RPi which could be the central control unit. This means there is still the ability to use ADC and PWM, but the RPi is the central node. Then, as suggested by gbulmer, mayge have image processing/vision, etc. if desired.
Depends on how much you want to spend, and the level of sophistication you want.

gbulmer
Posts: 52
Joined: Wed Sep 28, 2011 9:11 pm

Re: Using RPi as a Standard Robotics Interface

Sun Oct 02, 2011 1:18 am

Quote from abishur on October 1, 2011, 22:38
I actually agree with gbulmer, most microcontrollers have a start up cost very close to the r-pi's cost (i.e. the cost of the cable to program the chip).
Thank you :-)
That said, I do think that there are many applications that the r-pi could be used for hobbyist-wise, perhaps not in direct application to the OP, but in the broad hobbyist community (IE, to provide a web-interfacable relay controller for a sprinkler system).
Yes, I can go along with that.
As long as it isn't sub-sub-millisecond-jitter real-time, ADC, PWM, R-Pi is very likely fine. It is an insane amount of computer power compared to most microcontrollers, so it "jolly well should work":)

I have three concerns (not aimed at you):
1. The architecture proposed in the OP isn't a good fit to R-Pi, why debate this any further?
2. Asserting "A is as good as or better than B", without specifying the problem or criteria isn't analysis, engineering, or science.
3. PC Linux distributions are not for hard-real-time, or even soft-real-time,. Systems which are hard-real-time, will use orders of magnitude less headroom to meet requirements.
Sigh :-(

I also know that software can emulate hardware and I wouldn't be surprised at all if people who just really wanted to use the r-pi would be able to use software to fix any shortcomings the r-pi is lacking
Agree.
If the MIPS and Watts are available for the software, then it might easily match the hardware solution's KIPS and Milliwatts.
But it might be fun to try the R-Pi way :-)
I'd prefer people to acknowledge it is curiosity, interesting, challenging or fun, but not a rationale based engineering decision.

... but it would be easier just to use the microcontroller for such situations ;)
Agree. I don't normally like chips over 64-pins (need big boards), but a Cortex-M4 looks like a "gob-smacking" robot controller. One of those for low-level stuff, and a R-Pi for 'strategy' - yum :D

IMHO, an obvious solution to lack of PWM and ADC is to get an ATmega168 (as used on Arduino), for £1.72+VAT each 2-off (rs-online), and use that for ADC and PWM.

Put it on a little board (veroboard will do) connect the R-Pi SPI to its SPI plus one GPIO to trigger the ATmega RESET (you can then program the ATmega over SPI), hack one of the existing Arduino's SPI loader programs (e.g. used by one Arduino to program another), maybe to load a hacked Firmata (hacked to use SPI), and you're good to go.

It could probably run off its internal 8MHz oscillator at 3,3V, so no crystal and maybe no power regulator. Cost about £5+VAT for two.

Not trivial, but IMHO easier to use and debug than trying to get an R-Pi to emulate the same capabilities.

gbulmer
Posts: 52
Joined: Wed Sep 28, 2011 9:11 pm

Re: Using RPi as a Standard Robotics Interface

Sun Oct 02, 2011 1:38 am

Quote from tntexplosivesltd on October 2, 2011, 00:11
Besides, for the above architecture described, each sensor/motor node could have its own microcontroller (e.g. PIC12F683 or something like that, which could control that sensor/motor. These could then talk back to the RPi which could be the central control unit. This means there is still the ability to use ADC and PWM, but the RPi is the central node. Then, as suggested by gbulmer, mayge have image processing/vision, etc. if desired.
Depends on how much you want to spend, and the level of sophistication you want.

I'm happy. You have described an implementation of the architecture I proposed using microcontrollers for sensors/motors and not R-Pi, and hence you also disagree with the OP that R-Pi would be good for sensors/motors.

Drinks all round, eh? :D

jonititan
Posts: 30
Joined: Sat Aug 06, 2011 2:05 pm
Contact: Website

Re: Using RPi as a Standard Robotics Interface

Tue Oct 04, 2011 1:06 pm

Essentially my Idea was to use the raspberry pi as the intelligent unit which interfaces with the faster real time controllers.
An Analogue would be the Human central nervous system.
Fast reactions to stimuli through local loops(Real time Microcontroller control)
But also sending sensor data up and receiving mission commands from a more intelligent system.

User avatar
TonyD
Posts: 447
Joined: Thu Sep 08, 2011 10:58 am
Location: Newcastle, UK
Contact: Website

Re: Using RPi as a Standard Robotics Interface

Tue Oct 04, 2011 1:53 pm

Yes you could use the RPi as a intelligent unit with I2C/SPI based sensors or additional microcontrollers providing real world analog and digital interfaces and sensor data.

For big robotic machines you could use the UART with a RS485 transceiver to connect to distributed I/O microcontroller units.
Tony

jonititan
Posts: 30
Joined: Sat Aug 06, 2011 2:05 pm
Contact: Website

Re: Using RPi as a Standard Robotics Interface

Tue Oct 04, 2011 8:28 pm

I can think of some sensors where certain signals would require instant action but there are more subtle signals which would need a RasPi to discover them.
Whisker sensors are one example. Gross deflection due to contact with an obstacle is easy for a small microcontroller to ascertain and comand a robot to reverse. Feature and texture information from a whisker dragging along a floor could only be obtained by further signal processing in something like a RasPi. The advantage is that this information is not time critical but is still useful to the mission planning and path planning sections of the robot controller.

Essentially this is a Hybrid Architecture I'm describing.

Fast Real Time micro controllers providing the Sense-Act and the RasPi doing the planning.
Perhaps also with the ability to change the gains and other constants used by the microcontroller.

thassler
Posts: 5
Joined: Wed Sep 28, 2011 1:54 pm

Re: Using RPi as a Standard Robotics Interface

Wed Oct 05, 2011 8:43 pm

My approach would be to use the RasPi in conjunction with a UBW or a cheap microcontroller with some extra components. Use the microcontroller or UBW for ADC, PWM, etc. and take advantage of the cheap USB peripherals we could add without extra coding attached to the RasPi. For instance, a Wifi, GPRS, ethernet or USB shield for arduino would cost around US$20-US$50 but a wifi USB dongle (<US$10), 3G USB modem (<US$30 or free), bluetooth USB dongle (US$2), ethernet (free with B type RasPi) could be attached directly to the RasPi and interact via some serial interface with the microcontroller.

gururise
Posts: 2
Joined: Sat Oct 08, 2011 6:07 am

Re: Using RPi as a Standard Robotics Interface

Sat Oct 08, 2011 7:12 am

Quote from thassler on October 5, 2011, 21:43
My approach would be to use the RasPi in conjunction with a UBW or a cheap microcontroller with some extra components. Use the microcontroller or UBW for ADC, PWM, etc. and take advantage of the cheap USB peripherals we could add without extra coding attached to the RasPi. For instance, a Wifi, GPRS, ethernet or USB shield for arduino would cost around US$20-US$50 but a wifi USB dongle (<US$10), 3G USB modem (<US$30 or free), bluetooth USB dongle (US$2), ethernet (free with B type RasPi) could be attached directly to the RasPi and interact via some serial interface with the microcontroller.

I think this is a great way of building a robot and I was thinking of a similar approach.

The rasberry Pi would run openCV connected to a webcam to perform SLAM navigation and/or face/person detection. It would also allow for speech synthesis (something very difficult on a microcontroller, but easy on Linux).

The UBW would allow the rasberry Pi to interface to the motors and the sensors.

slurp
Posts: 16
Joined: Sun Oct 16, 2011 8:40 pm
Contact: Website

Re: Using RPi as a Standard Robotics Interface

Sun Oct 23, 2011 9:53 pm

I've worked with the PICAXE controller for small robotics, it's also aimed at the educational market. The RPI may give some a low cost means of programming it - if the the Linux Axe-Pad software and the USB drivers will run.

It may be interesting to use PICAXE with RPI. The RPI dealing with the higher order tasks like navigation, GPS interface and the like, while the PICAXE gives the interface to motors and sensors. I'm looking forward to getting my hands on a RPI but I'm not sure my coding it up to producing SPI drivers!

Best regards,
Colin

Here's a link to the PICAXE community: http://www.picaxeforum.co.uk/forum.php

User avatar
mkopack
Posts: 242
Joined: Mon Nov 07, 2011 8:46 pm

Re: Using RPi as a Standard Robotics Interface

Mon Nov 07, 2011 10:15 pm

Depending on what you want to do, you could use the RPi as a ROS "host" node (ie, the brains) and hook it to an Arduino to have it act as a sensor interface node (see http://www.ros.org/wiki/rosser.....al_arduino).

I've done similar things with ROS-nxt interface talking over USB to a Lego Mindstorms NXT Brick and reading it's sensors + controlling it's motors from code on the Ubuntu/Ros host machine, and allowing that data then to interact with other ROS nodes...

The arduino is a great little board with nice IO interfaces, but doesn't have quite the amount of memory + CPU performance that the RPi has. So leverage each to their strengths....

slayer
Posts: 1
Joined: Fri Dec 30, 2011 4:33 pm
Contact: Website

Re: Using RPi as a Standard Robotics Interface

Fri Dec 30, 2011 6:12 pm

mkopack said:


The arduino is a great little board with nice IO interfaces, but doesn"t have quite the amount of memory + CPU performance that the RPi has. So leverage each to their strengths....


Exactly what I was thinking.  One problem that I've found with robotics applications is that everyone raves about how easy it is to perform simple functions, but for any complex behavior, you run into "[hook it up] | [controlled by] | [integrated with] a computer".  Immediately, the power-weight-complexity increases dramatically.

Arduino is great for programming specific routines, but any decision process needs more computing power than available.  On the other hand, Cellbots.com has made great strides in integrating phones (a portable computer) with robotics--but you still have to put out several hundred dollars for a nice general-purpose computing platform.  (And you're generally not using all of its capabilities--wasted potential).

I have two usage scenarios in mind for the Pi with respect to robotics:


Every year I teach a "short course introducing robotics to elementary kids.  Having a small, inexpensive, and exposed platform to control Arduino-connected servos and sensors would take out of a lot of the mystery of computer control


I'm working on a project integrating multiple sensors into a navigation system.  Having an inexpensive development platform to do the basic data transformation and nav calculations would go a long way towards proving the feasibility of this approach.

jonititan
Posts: 30
Joined: Sat Aug 06, 2011 2:05 pm
Contact: Website

Re: Using RPi as a Standard Robotics Interface

Mon May 28, 2012 12:13 pm

Since we have now heard that we will be able to run the debian variant of ROS on the Pi this is looking very acheivable.

http://www.raspberrypi.org/phpBB3/viewt ... ros#p84607

Stateside
Posts: 66
Joined: Sun May 13, 2012 12:26 pm

Re: Using RPi as a Standard Robotics Interface

Mon May 28, 2012 12:43 pm

What do you need to do with the Raspberrypi to make it work with the Scrbbler robot ?

The Scribbler Robot- a tool for teaching programming

Can The Raspberrypi replace the IPRE Fluke Add-On Board ?

http://find.botmag.com/508125
http://www.parallax.com/go/S2
http://www.betterbots.com/
http://wiki.roboteducation.org/Main_Page
PyCon 2011: Python and Robots: Teaching Programming in High School
http://blip.tv/pycon-us-videos-2009-201 ... ol-4898767


User avatar
mkopack
Posts: 242
Joined: Mon Nov 07, 2011 8:46 pm

Re: Using RPi as a Standard Robotics Interface

Thu May 31, 2012 3:46 am

Stateside wrote:What do you need to do with the Raspberrypi to make it work with the Scrbbler robot ?

The Scribbler Robot- a tool for teaching programming

Can The Raspberrypi replace the IPRE Fluke Add-On Board ?

http://find.botmag.com/508125
http://www.parallax.com/go/S2
http://www.betterbots.com/
http://wiki.roboteducation.org/Main_Page
PyCon 2011: Python and Robots: Teaching Programming in High School
http://blip.tv/pycon-us-videos-2009-201 ... ol-4898767

Hmm... interesting... I have the IPRE Fluke and a Scribbler 2, but haven't really messed with them in over a year (time). The thing with the Fluke is that it talks across Bluetooth to a host computer which does all the processing / your code runs on. So, it's conceivable that you could use the Rpi + Bluetooth adaptor to be that host computer - cheap, small, python right there.

I don't know that you'd be able to replace the Fluke board though, at least not without a LOT of code to take over control+sensing of the Scribbler's motor+sensors over the serial interface. Doesn't mean it can't be done though...

Return to “Automation, sensing and robotics”