Shop OBEX P1 Docs P2 Docs Learn Events
Parallax M&M Sorter — Parallax Forums

Parallax M&M Sorter

joe.mckibbenjoe.mckibben Posts: 14
edited 2007-10-26 16:57 in Robotics
Hello,

I have one of Parallax's M&M Sorter Kits. I am using the·MOBO 2P/2PE Motherboard with daughter I/O board and the color sensor daughter board to control the device.

I was wondering if any·one·had a program for this particular setup?

I know I should figure it out myself, but I need to get up and running fairly soon.

Any help is appreciated, Thanks,
Joe McKibben

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-10-22 15:25
    Joe,

    I'm glad to see someone has made the connection between the MoBoStamp-pe and the MSorter! The whole electronics package will mount where the old sensor board mounted before, makng for a very compact assembly. You may need to add an extra 1/16" space or so between the sensor and M&M. Check to make sure the two lights converge when the candy is in place. As long as there's some overlap, you should be okay.

    When you've completed your project, why not post a picure of it here? I thiink you're the first to use these components together.

    As to programming, there were examples available on the Parallax MSorter contest page, but I can't find that page anymore. So I've attached the program that Jon Williams and I wrote years ago. You will need to modify it to accomodate the different pin assignements of the Mobo.

    Good luck!

    -Phil
  • joe.mckibbenjoe.mckibben Posts: 14
    edited 2007-10-22 16:48
    Thanks,

    I have some sample programs, but none of them work exactly for this setup. Yours is the only one I have with a rotor output.

    I changed the pin assignments on your program but the LEDs will not come on.

    I commented out the Enable, AO, S0, and S1 pins.

    I can't find the pin assignments for Enable or AO, I could put those back in if·I·knew what they were. S0 and S1 are already pulled high, so I dont need to specify them in the program.

    And I made S2 pin 1, S3 pin 0, nLights pin 5, and TcsOut pin 7.

    As far as I can tell that is the right pin configuration.

    I will try to put a picture on here as soon as possible.

    Thanks for the help,

    Joe McKibben
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-10-22 17:58
    Be sure to read the docs on the new TCS230-DB. You'll see that there's no longer an EN or A0 input and that the LED logic is inverted from what it used to be. You're right about S0 and S1. They're accessed through the AVR now, but you don't need to touch them since they're pulled high.

    -Phil
  • WhitWhit Posts: 4,191
    edited 2007-10-23 04:04
    Where is the the M&M Sorter on the website?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Whit+


    "We keep moving forward, opening new doors, and doing new things, because we're curious and curiosity keeps leading us down new paths." - Walt Disney
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-10-23 06:39
    Whit,

    It's been discontinued, so there are no longer any links to the product page. You can still see it here, however.

    -Phil
  • WhitWhit Posts: 4,191
    edited 2007-10-23 12:06
    Phil,

    Guess it was my day to catch up on old news!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Whit+


    "We keep moving forward, opening new doors, and doing new things, because we're curious and curiosity keeps leading us down new paths." - Walt Disney
  • joe.mckibbenjoe.mckibben Posts: 14
    edited 2007-10-24 16:58
    Hello,

    Ok I got it to work, but it is not very consisteny on the sorting. Do you have any ideas on why it isn't?



    Thanks for the help,

    Joe McKibben
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-10-24 18:52
    You will need to calibrate it first to get any consistency. Take several readings from different pieces of each color. Using these readings, you will be able to figure out an average for that color that you can include in the EEPROM section of your program (i.e. CBase ff.).

    -Phil
  • joe.mckibbenjoe.mckibben Posts: 14
    edited 2007-10-24 20:53
    OK. I took a single set of readings and plugged those in. So I will try to get more of an average over a few M&M's and at least one reading with the "m" side.

    Your program had two Color Matching routines in it. One was Color_Match and the other was Color_Match_JW is there one you prefer over the other?

    Thanks again for the help,
    Joe McKibben
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-10-24 23:25
    Color_Match picks the best match overall. Color_Match_JW picks the first one it finds that's close enough. I prefer the former.

    -Phil
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-10-25 15:45
    Joe,

    One additional thought: The MSorter program uses white-balanced color sensing. The white balance is obtained at startup from the beige armature that moves the candies. When you calibrate the colors, you will also have to use values obtained after white balancing on the armature, else your colors will be different. The simplest way to do this is to save the sort program under a different name and modify it to output the color values it reads to DEBUG and to just drop each candy in the first vial.

    -Phil
  • joe.mckibbenjoe.mckibben Posts: 14
    edited 2007-10-25 16:35
    Ok, I will try that. I probably won't get to it till tomorrow.
    And I haven't forgot to get picture I'll try to get that tomorrow also.

    Thanks,
    Joe McKibben
  • joe.mckibbenjoe.mckibben Posts: 14
    edited 2007-10-26 16:36
    Hello,

    I want to thank you again·for all of your help.

    Ive got it working pretty well. It is very consistent in sorting, but there are a couple of ·that still need worked out. Sometimes the rotor doesn't go all thway back to get an M&M. Ill try to figure that out later. Also there was problem with it putting the red and browm M&Ms in the same bin. I was able to fix this, it was just the degree variables for those two colors were to close together so·I had to spread those variables out some and·space the·rest of the bins out also.

    I got some pictures of the device. You can see them at this link http://picasaweb.google.com/joe.mckibben/ParallaxMMSorter

    I also I attached the modified program if anyone ever needs it.

    Thanks again,

    Joe McKibben
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-10-26 16:57
    Good going, Joe! And thanks for posting the photos!

    Just a suggestion: If the servo cable interferes with the rotor, you can flip the entire MB/DB assembly around so the PWR-I/O-DB is outboard. To do this you will be using the TCS230-DB holes nearest the motherboard connector to fasten to the MSorter stanchions. This works because the TCS230 optical axis is centered on the daughterboard.

    -Phil
Sign In or Register to comment.