Shop OBEX P1 Docs P2 Docs Learn Events
Is Propeller Up to the Task? — Parallax Forums

Is Propeller Up to the Task?

Peter HannemanPeter Hanneman Posts: 5
edited 2008-06-11 02:46 in Propeller 1
Hey,
I am in the process of creating a small robot and have been in search of a capable micro controller to run my platform with. This chip looks really exciting and blows most everything I've seen out of the water. But before I commit I just had a few questions about the chip as I am unsure if it can handle everything I plan on throwing at it. smilewinkgrin.gif My requirements include: 19 I/O connections for servos, 6 analog connections for force sensors, 1 I2C connection for a CMOS camera and control of one TTL connection in addition to interfacing with a bluetooth module. Does this sound like something Propeller is capable of?

Thanks in advance,
- Peter

Comments

  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2008-06-09 02:16
    The Propeller is suited very well for applications with many different interfaces because it is easy to segment the hardware and, more importantly in my opinion, to segment the software. See, once you get your hardware designed and you start working on the software you can focus on writing drivers just for the I/O connections or the I2C device or the force sensors. Once you get drivers working (probably in their own cogs) then you can focus on a higher level program that interacts with all the drivers. The architecture of the Prop really lends itself to breaking down problems and creating clean solutions. In other micros you need to worry about processor speed and interrupt servicing where with the propeller you do not have such concerns.

    One item to note is how you connect the analog sensors. The Propeller does not have "analog inputs" so depending on your sensor you may have to creating some interfacee circuitry.

    Tell us more about your robot. What are the 19 I/O connections for? What type of force sensor is it?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter

    www.brilldea.com·- uOLED-IOC, RGB LEDs, TLC5940 driver PCB
    www.tdswieter.com
    One little spark of imagination is all it takes for an idea to explode
  • bambinobambino Posts: 789
    edited 2008-06-09 02:38
    32 - 2 for programming port
    28 - 2 for eeprom(which is i2c and could easily take care of your cmos camera concerns by daisy chaining)
    26- 19 servos
    7 - Minimum Rx, Tx,( maximum depending on your radio device)
    approx 5 to 1 pins left for analog.
    Using jumpers for the programming port pins could free them up for use in your TTL as they are free after programming)
    leaves approx 7 to 3 pins left for analog.
    external adc's are easily connected with typically 4 pins(cs, Din, Dout, and Clk)
    Even a max 1270 or 1301 is possible with 7 pins free.
    The really good news is the servo controller boards available would free up enough pins that you could theoritically
    impliment the sigma delta adc circuits for the analog(only 11 pins needed for that) leaving 8 of the 19 pins for connecting to a servo controller.
    Hope this helps.
  • Peter HannemanPeter Hanneman Posts: 5
    edited 2008-06-09 02:43
    Thanks for the quick reply. [noparse]:)[/noparse] The robot is based around a hexapod design and its goal is to function independently, requiring no external calculations to be made meaning that all IK calculations must be made on the fly. 18 of those I/O connections will be reserved for driving the servos which control all the movement of the bot. The TTL connection controls a laser module which is attached to the CMOS camera, which is then mounted on another servo (19th I/O) to perform range finding / environment mapping so that the bot can have spatial awareness and avoid obstacles / navigate intelligently. The force sensors will be located on the feet of the bot so it can decide if it's about to long walk off a short pier. (aka stairs)

    The analog sensors will need to be run through a voltage divider and then through an analog to digital converter, although I haven't finished the design of this module yet. It seems that the hardest part of this design will be making the CMOS camera operate and analyzing the images locally without offloading them to a computer. A HID enabled bluetooth module may later be incorporated allowing for a Nintendo Wii remote to be directly connected in addition to the simplicity of having no wires to worry about whilst programming.

    I'm glad to hear you think that the chip is capable of taking on the project. Gives me a little hope. [noparse];)[/noparse]
  • StefanL38StefanL38 Posts: 2,292
    edited 2008-06-09 19:21
    hello Peter,

    this is a quite ambitious project. I think an etxra servocontroller is a good idea.

    I have a question is it really nescessary to have ADC for the force sensors?
    Would it be enough to know leg touches ground / does not touch ground ?

    What do you think is the resolution of the CMOS-camera ? How many pixels ?
    I'm not a specialist about image-processing but 640x480 pixels as black/white pixels
    is 640*480/8/1024 = 37,5 kB

    What do the camera-specialists say about that ?

    best regards

    Stefan
  • Peter HannemanPeter Hanneman Posts: 5
    edited 2008-06-10 20:49
    Hey again,

    Thanks for the response! I totally agree with your statement about this being ambitious. [noparse];)[/noparse]

    Instead of worrying about trying to fit everything on one chip or interfacing with another controller, what about two Propeller chips? I am going to need to design my own PCB for this project anyways, so why not go the extra step and make the whole solution on one board? Turn one of the chips into a dedicated servo controller which also calculates all the required inverse kinetics while the other acts as a receiver for sensors. That would leave plenty of pins open for expansion in the future. Would connecting the two chips via a pair of I/O pins in a serial configuration work? For programming their Rx/Tx pins could be run through a switch to select which chip could connect to a computer or bluetooth module. Sounds radical, but does anyone think it has the potential to work?

    @Stefan: I would like to have some sense of resolution from the force sensors because the data could be used to determine the robot's center of gravity at any given moment and help dynamically balance it with out expensive accelerometers as well as preventing the bot from walking to its doom down a flight of stairs. As for the camera I have two options: One camera is 640x480, the other is 1300x1040. The higher resolution is much preferred since it will allow for more accurate distance measurements to be taken. I have seen several micro controllers that pale in comparison to the Propeller perform the necessary calculations on color data without breaking a sweat. I even ran across an article where someone was capturing full color CMOS camera data from a Propeller chip and was able to manipulate it using only 2 cogs. I am sure it can handle the task despite the lack of memory.

    @bambino: If I did end up running this new dual chip configuration, how would you suggest I do my analog to digital conversions? Could you recommend any modules? I found spec sheets on the models you suggested earlier, but couldn't find a place to actually purchase them. Also, you mentioned daisy chaining I2C components. Could you elaborate on that? I searched around but couldn't find any articles on how to actually go about doing that. Perhaps now that I have two chips it might not be necessary?

    Thanks for all the help, I couldn't get the project off the ground without you guys. [noparse]:)[/noparse]
    - Peter
  • David E.David E. Posts: 13
    edited 2008-06-10 23:00
    I2C is two wire serial so you can "daisy chain" devices on it. You only need two pins on the prop and you can control or get data from multiple devices. I'm no pro at it by any means, but I've been using the DS1621 temp sensor for a project and have 4 of them connected to the same SDA and SCL pins on the prop. Each device has it's own address, so when you start the I2C object you tell it which address to interface with.

    This way you can have a lot of devices to communicate with the prop and only use two pins.


    Prop SDA
    Device 1 SDA
    Device 2 SDA
    Device 3 SDA
    Device 4 SDA

    Prop SCL
    Device 1 SCL
    Device 2 SCL
    Device 3 SCL
    Device 4 SCL

    You will need pullup resistors to the SDA and SCL lines.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-06-10 23:42
    Some other things to consider ...

    1) The video camera will take a lot of memory for a video buffer.· There's a thread on the PropCAM which discusses some of the issues in getting a CMOS camera to work with a Propeller.· There are tight timing issues as well.· It's doable, but you won't be able to have even a 640 x 480 image with any kind of gray-scale because of memory limitations.· 640 x 480 B&W pixels take 38400 bytes, more than what's available.· There are some CAMs that do frame grabbing and conversion to JPEG.· I don't remember whether you can download the image pixel by pixel, but that would be the best way to handle this.· Again, it's not a matter of computational power so much as that of memory capacity.

    2) You're probably better off using an external ADC.· The Propeller can do it, but only 2 channels per cog using the existing ADC code.· It's possible to slowly and less accurately·do more channels per cog, but it's probably·not worth the effort.· There are existing drivers (objects) for several types of external ADCs as well as an existing multiple servo driver (up to 32 servos).· With an external ADC, you could easily use one Propeller for all the servos and all the sensors and the low level integration of the two (including the laser).

    3) The 2nd Propeller would handle the video and the video analysis, possibly using some kind of external RAM as a video buffer.

    4) I'm not sure where the overall control would reside.· The servo/sensor Propeller would have processing power and memory available, but logically might not be the place to put the high level control.· The video Propeller might be a better place, but for the heavy use of memory and processing power for processing the video.· This might·be one of those issues that needs some design iterations rather than committing too early to a design decision.
  • Peter HannemanPeter Hanneman Posts: 5
    edited 2008-06-11 02:46
    Thanks for the quick responses!

    @David: Thank you very much for the info - that seems almost too easy to implement! :-D

    @Mike: Thanks for the reference to the PropCAM discussion, I'll be sure to keep an eye on that. The CMOS camera I am looking at does in fact support JPEG compression. The algorithm for range finding simply locates the brightest pixel in the red spectrum then does some simple trig to determine the distance to that point so it's not like I am transforming the entire image but I will look into some similar projects to find out how they get away with using even less memory then the Propeller chip has. As for the ADC conversion, I suppose I will search through the object database for some pre-written drivers and choose one from that list. I hope I find one that employ the sigma delta method. What about external DACs? My Hitech 645MG servos still accept analog signals. Is there a good way to accept both to take into account future upgrades? Additionally, I am going to be hard pressed not to commit to a design since I am part way through my PCB design and will be ordering in not too long. I will be sure to take into account your design suggestions. I need to finalize my methodology and weight the memory and processing footprints of each and decide from that where to locate the various "departments".

    Thanks again for the comments. smile.gif Any other suggestions?
    - Peter
Sign In or Register to comment.