Shop OBEX P1 Docs P2 Docs Learn Events
Color Sorter — Parallax Forums

Color Sorter

We are trying to build a color sorter with the activity bot 360, using the BlocklyProp software. The sample code from the tutorial does not work. Yes, everything is hooked up right, corresponding to the code. Why isn't it working. The parts being used are the Propeller Activity Board WX, ColorPal Rev A, and two Feedback 360 High Speed servos. We are also not using the Parallax mechanical design for the color sorter, we are using the Arduino mechanical design for this build. https://howtomechatronics.com/projects/arduino-color-sorter-project/
1440 x 900 - 150K

Comments

  • Welcome to the forums!

    When you say it does not work, you need to be more specific. What exactly does not work?
  • GenetixGenetix Posts: 1,754
    edited 2019-02-27 01:22
    waujon21,

    There are 2 reasons that it doesn't work:
    1.) That web page is for an Arduino which uses different command and a different microcontroller.
    2.) That project uses a STANDARD servo not a continuous rotation servo.

    This is a BlockyProp version of the same thing but you will need to 2 standard servos such as these:
    http://learn.parallax.com/tutorials/language/blocklyprop/candy-sorter-blocklyprop-project
    https://www.parallax.com/product/900-00005
    All of Parallax's servos including the Feedback 360 are made by Futaba which in infamous in the world of Radio Control or R/C.
  • Genetix, waujon21 is using "the activity bot 360, using the BlocklyProp software". They are only using the mechanical design from the Arduino version, not any of the hardware/software.

    waujon21, have you been able to do other BlocklyProp projects with your ActivityBot to confirm that your setup is working correctly?
  • twm47099twm47099 Posts: 867
    edited 2019-02-27 17:57
    If he is using this tutorial, learn.parallax.com/tutorials/language/blocklyprop/candy-sorter-blocklyprop-project
    the software in that tutorial uses standard servos https://parallax.com/product/900-00005 not the 360 feedback servo.


    Ok, looking at the blockly code in the OP I see that he is not using the candy sorting tutorial.

    But I think he should be using this block and set the angle he wants the servo to turn to:
    Feedback 360° servo set
    
    Use this block with the Parallax Feedback 360° High-Speed Servo (#900-00360) and the Activity Board WX, Propeller FLiP, and Other board types. Not available for Badge or Scribbler Robot board types.
    
    The Feedback360° servo setup block sets the value for the servo behavior chosen.
    
        First, set the PIN dropdown to the Propeller I/O pin number connected to the servo's control or feedback signal line — either one will work.
        Then, select behavior from the second drop-down.
            speed: sets the continuous rotation speed in degrees per second. Positive values turn counterclockwise and negative values turn clockwise.  When speed is chosen, insert a value block, or any variable or equation that resolves to a value.  Cap the value used here by the project with the Feedback 360° servo setup block.
            set angle to: sets the servo to the angle specified by the attached value block.  The origin for the angle is the position the servo was in when initialized. Positive values turn counterclockwise and negative values turn clockwise. 
            change position by: rotates the servo by the number of degrees specified by the attached value block. Positive values turn counterclockwise and negative values turn clockwise. 
    

    The servo 360 reference is here:learn.parallax.com/support/reference/propeller-blocklyprop-block-reference/servo

    One issue will be that the servo assumes that the position it is in when powered up is zero degrees. So it will be important that the servo is initially positioned to zero degrees before turning power on and after each movement it should return to zero.

    Tom


  • To clarify, the hardware we are using is all from the Activity Bot 360 kit, besides the ColorPal Rev. A.
  • waujon21 wrote: »
    To clarify, the hardware we are using is all from the Activity Bot 360 kit, besides the ColorPal Rev. A.

    We understand that info. We wish to know exactly what is not working so we can narrow down the problem. Are the servos not reacting the way you want? As has been mentioned, the servos on the Servo 360 are continuous rotation servos, unlike the servos that are used in the Arduino tutorial. While it is possible to rotate the 360 servo to a certain angle, it takes some more programming and setup..
  • waujon21,

    A common technique to find the zero position of a stepper motor is to slowly move it until it hits a 'hard' stop.

    You could also use a 'limit' switch or a light sensor for the "home" position.
    https://homofaciens.de/bilder/technik/rotary-encoder_006.htm
    The leftmost gear has a metal tab that is almost pointing up and about to enter a light sensor which is that black block in the upper right of the gear.
Sign In or Register to comment.