Shop OBEX P1 Docs P2 Docs Learn Events
4th & Long - I Don't Wanna Punt - I Need Coaching Advice? — Parallax Forums

4th & Long - I Don't Wanna Punt - I Need Coaching Advice?

ScopeScope Posts: 417
edited 2010-03-22 23:40 in General Discussion

Summary of this post:

Please list steps for the total noob who wants to become proficient w/Propeller


I would appreciate any advice in helping me achieve my robotic goals. Although I have learned much w/the Boe-Bot & WAM, I feel as though I am currently not on a very efficient path, like I'm experiencing HAGWAC syndrome (Hansel & Gretel without any crumbs).

I would be grateful for some advice to get me get on a "fast track" (although the more I realize how much I need to learn, the more I realize there is no such thing as a "fast track"). There are so many things I need to grasp, all seem essential in helping me obtain my goals - I hope the dust will settle and I'll have a clear understanding where I should proceed, what I should do.

My goals:
#1 - To become "proficient" with microcontrollers so I can create projects I really enjoy (like my quadrapod which is under construction)
#2 - I want to be able to effectively introduce my students to microcontrollers, sensors, output devices, programming, mechanical functionality, and so forth so they can "take off" and run with this technology
#3 - (and this really seems daunting to me at this point) To learn how to use the Propeller (are we supposed to pause for a moment of honorable silence whenever the "P" word is encountered? It seems fitting to do so.)

Background:
I went through most of the Boe-Bot & WAM stuff - very enjoyable, occasionally a bit frustrating or challenging. I have never had any experience reading electronic diagrams or learning about electronics of any sort. I used to rewind industrial 3 phase motors (when Elvis was still alive). I have replaced the head on my Honda and rebuilt the carburetor on my Toyota (when they still used carburetors).

Resources:
I don't have "tons of time" to devote to this endeavor, and suffice to say funding is not an issue. I became somewhat proficient with programming Python & Java a couple of years ago - I understand the basic functionality of simple programming. Mechanically, I may be a half-notch ahead of the average person - just a guess. Intellectually, well, let's don't go there - suffice to say I can relate more to an amoeba than I would feel comfy mingling with Mensa folk.

Current Status:
My "diabolical hurdle" was when I obtained the Propeller Robot Control Board. I saw the 24 servo connectors and imagined this tool would be perfect for projects utilizing a wad of servos. I'm still convinced this is true, but I am really challenged by learning how to program the PRCB and I feel "stuck" I also have the new green Propeller book but it seems to go along with the Propeller Demo Board. I'm sure this book would also be quite suitable for anyone who could create the "simple circuitry" using other Propeller-related tools. I don't even know enough about this stuff to create the "simple circuits" that are illustrated in the new green Propeller book. It seems to me, I may really need to obtain a Propeller Demo Board, a video output, a keyboard, and so forth, in order to follow the new green Propeller book. If so, not a problem, I will do that if it's necessary & useful.

In a nutshell, it seems as though I may have a simple case of WRBW (wanna run before walking).

But I have a decent attitude in order to be successful: I'll do anything - I don't care if I have to go back to "square one" and learn the basics of the basics. I know there may not be a single "perfect answer" for this, but would anyone like to provide me with a sequential list of accomplishments that will help me realize my goals? I am beginning to realize this is going to take lots of time - my "instaboticist" mentality is in a landfill somewhere.

I hope this isn't asking too much but I really will not give up and I'm confident that without any help and given "X" amount of time I will probably realize my goals but I don't want to waste more time trying to figure out stuff that I apparently don't have the right hardware &/or basic knowledge to grasp, and even worse, I don't want to get to the point where I become so discouraged that I . . . (gasp) . . . quit. shocked.gifnono.gifsmhair.gif

Sorry for the lengthy nature of my post - I type fast and drink coffee. Probably too much coffee, at times.

Thanks a whole bunch in advance,

Scope

Post Edited (Scope) : 3/21/2010 2:47:09 PM GMT

Comments

  • John R.John R. Posts: 1,376
    edited 2010-03-21 15:17
    Scope;

    First in terms of classroom use, check out the full offerings of the Parallax Education Program. Lots of stuff. I also don't know what grade level you're working with as far as "students", but I've had good success with 4th graders using Lego Mindstorms with the 4H group I'm involved with. This (mindstorms) wouldn't be my first choice, but they set things up for easy success.

    For yourself, You're actually on track, and probably doing better than you think. The Prop demo board is nice for following some of the materials, and nice for "quick and dirty tests", but once you get more involved, it really doesn't have all the pins exposed that you would like. Whether you need to get that or not is your choice. It's not a bad little board, and I'm glad I have mine, but I wouldn't be "lost" without it.

    As far as general advice, it is real easy to get "overwhelmed" when you start grabbing a board capable of driving 24 servos. Don't fret. Grab one loose servo, hook it up, and make it move. Work one step at a time, don't try and get the whole thing working at once.

    There are lots of sources for basic electronic knowledge, and don't be afraid to go to Radio Shack, and get one of those 100 in 1 project kits. The Electronic Learning Lab would be a great choice. There is also a Sensor Lab to go with it, but you may find that you don't need it (because by the time you start working though the lab, you'll gain enough knowledge not to need it).

    Also, as you transition to the Propeller (good choice), work through the Propeller Education Labs. You don't need to buy the kit, you should be able to work with the board you have, but you may be more comfortable with the lab. It's a great setup not just for learning, but for testing your own ideas. This may be more useful than the Prop Demo Board.

    Another option to the Prop Demo Board would be a Prototype board along with the parts kit to add video, keyboard, mouse, etc.

    So, here's the play for 4th and long. We aren't ready to throw for the touch down, but we can keep the ball, and move forward:

    * Download the materials (books and sample code) for the Propeller Education Lab See if you can work through them with your PRCB. Optionally purchase the Propeller Education Lab Kit. I would go with the DIP version, it's a good exercise to hook up the Prop from "nothing".

    * After looking at the Propeller Education Kit stuff, if you find the "green book" useful to your goals, and still have a difficult time relating to the circuits, etc., get the Prop Demo Board.

    * If you need help with basic electronics, think seriously about the Radio Shack Learning Lab, or other similar type kits.

    * Take things one step at a time.

    * These forums are your friend! There are a ton of people here, and lots of great advice. Occasionally, there is some noise to filter through, but rarely will you not get a useful answer.

    * Most importantly, PLEASE, PRETTY PLEASE, have some FUN with this!

    First Down! and boy you can just that momentum building!

    (PS: If you start doing some fine pitched soldering, you may want to check out decaf...)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John R.
    Click here to see my Nomad Build Log
  • bill190bill190 Posts: 769
    edited 2010-03-21 17:34
    Watch one, do one, teach one!

    Then the biggest block to my learning something new is new words and acronyms. Each time you encounter a new word, look it up.

    As to microcontrollers / microprocessors...

    I first learned basic electricity.

    Then basic electronics. The secret to this is to learn the "words". Learn what each part is for. Resistor, diode, transistor, transformer, capacitor, etc. Know what each part does, and that is a BIG start to understanding this stuff.

    Then next is understanding a bit about digital electronics. This is·on/off computer stuff. Another kind of electronics is analog electronics and that would be radios, TV, etc. (skip that.)

    Read about basic digital electronics or "Logic circuits". This would be AND gates, OR gates, NOT gates, NOR gates, FLIP FLOPS, etc. These are the building blocks of microprocessors.

    http://en.wikipedia.org/wiki/Logic_gate

    Then you might want to read a little about the history of computers. How the first computers were programmed by wiring them! Hundreds of wires needed to be changed to change the programming.

    http://en.wikipedia.org/wiki/Computer

    And might want to read about analog computers as opposed to digital computers. Interesting stuff! Just a little so you know the difference.

    http://en.wikipedia.org/wiki/Analog_computer

    Then read about simple integrated circuit chips. Like a shift register, BCD to decimal decoder, RAM or random access memory chips, etc. Here are a bunch. Just learn what a few of these do...

    http://en.wikipedia.org/wiki/List_of_7400_series_integrated_circuits

    THEN read about microprocessors and you will then understand what is going on...

    http://en.wikipedia.org/wiki/Microprocessor

    And then assembly language programming...

    http://en.wikipedia.org/wiki/Assembly_language

    (The links at the bottom of those pages might be worth exploring.)
  • ScopeScope Posts: 417
    edited 2010-03-21 17:38
    Gee, thanks John.

    I got motivated by your comments and installed Propeller Tool v1.26 on my (windows) computer, reviewed the (only) spin program that seemed servo-related, located my Propeller Robot Control Board, connected a servo and the power supply from my Boe-Bot . . . here goes . . .

    Thanks also to Bill . . .
  • bill190bill190 Posts: 769
    edited 2010-03-21 17:41
    P.S. After you learn a bit about all that, the neatest thing is how a computer subtracts one number from another...

    This is done by adding!

    (And you will see where those logic gates come into play with this...)

    http://www.helpwithpcs.com/courses/adding-subtracting-binary-numbers.htm
  • ScopeScope Posts: 417
    edited 2010-03-21 18:36
    Thanks Bill

    And now, for a brief update

    #1 - the PRCB is working! roll.gif

    #2 - With regard to the following:

        SERVO.Set(ServoCh1,1500)                  'Force Servo to Center 
    
    



    I'm assuming this is what I used to do when programming the Boe-Bot to 750 to center the servo?

    #3 - With regard to the following:
        waitcnt(clkfreq*30+cnt)                   'wait for 30 seconds   
    
    



    How does this translate into 30 seconds?

    #4 - With regard to the following:
             'SetRamp(Pin, Width,Delay)<-- 50 = 1 sec 3000 = 1 min    
        SERVO.SetRamp(ServoCh1,2500,3000)         'Pan Servo to furthest counter clockwise
                                                  'position 
    
    



    Should the description indicate "Pan Servo to furthest counter clockwise position in a 1 minute duration

    #5 - Is there a reference I should be reading before jumping in like this? Perhaps a reference that would help answer my questions so I don't pester the folks at this forum?

    Thanks,

    Scope
    [noparse]:)[/noparse]
  • ScopeScope Posts: 417
    edited 2010-03-21 18:45
    Ok, this is giving me very favorable results - all I have to do now is hook up the other 7 servos I I'll be finished w/step #2 of my robot dog.

    CON
        _clkmode = xtal1 + pll16x                           
        _xinfreq = 5_000_000                                'Note Clock Speed for your setup!!  guessing this is for OEM 5 mhz crystal?
    
        ServoCh1 = 7                                        'Select DEMO servo - Scope connected his demo servo to #07 (lucky number)
    
    
    VAR
        
    OBJ
      SERVO : "Servo32v5.spin"
    
    PUB Servo32_DEMO | temp
    
        SERVO.Start                 'Start Servo handler
        SERVO.Ramp  '<-OPTIONAL     'Start Background Ramping
    
                                    'Note: Ramping requires another COG
                                    '      If ramping is not started (optional)
                                    '      then 'SetRamp' commands within the
                                    '      program are simply ignored
                                    '
                                    'Note: At ANY time, the 'Set' command overides
                                    '      the servo position.  To 'Ramp' from the
                                    '      current position to the next position,
                                    '      you must use the 'SetRamp' command 
    
             'Set(Pin, Width)
        SERVO.Set(ServoCh1,1500)             'Move Servo horn to a clockwise position
    
             'SetRamp(Pin, Width,Delay)<-- 50 = 1 sec 3000 = 1 min    
        SERVO.SetRamp(ServoCh1,1000,250)         'Pan Servo horn to a counter clockwise position
    
        waitcnt(clkfreq*5+cnt)                   'wait for 10 seconds --> guess          
    
        SERVO.SetRamp(ServoCh1,2000,250)          'Pan Servo horn to a clockwise position          
    
        waitcnt(clkfreq*5+cnt)                   'wait for 10 seconds --> guess          
                                                  
        SERVO.SetRamp(ServoCh1,1500,250)          'Force Servo horn to center position
    

    Post Edited (Scope) : 3/21/2010 6:50:05 PM GMT
  • John R.John R. Posts: 1,376
    edited 2010-03-21 19:00
    Scope said...
    Thanks Bill

    And now, for a brief update

    #1 - the PRCB is working! roll.gif

    #2 - With regard to the following:

        SERVO.Set(ServoCh1,1500)                  'Force Servo to Center 
    
    



    I'm assuming this is what I used to do when programming the Boe-Bot to 750 to center the servo?

    Correct. In the case of the SERVO object, the numeric argument is the pulse width and should be between 1000 (1 msec) and 2000. Some servos may respond to values slightly beyond that range. 1500 (or very close to that) should be "centered" (or neutral for a continuous rotation servo).
    Scope said...

    #3 - With regard to the following:
        waitcnt(clkfreq*30+cnt)                   'wait for 30 seconds   
    
    



    How does this translate into 30 seconds?

    waitcnt waits until the "cnt" counter reaches the argument. In this case, we take the clock frequency (clkfreq) [noparse][[/noparse]the number of counts in a second] and multiply this by 30, and add the current value of cnt. so the program (actually just the current COG) "waits" until the cnt is equal to the new value.

    The Prop Education Tutorials are very good about explaining this type of thing.
    Scope said...

    #4 - With regard to the following:
             'SetRamp(Pin, Width,Delay)<-- 50 = 1 sec 3000 = 1 min    
        SERVO.SetRamp(ServoCh1,2500,3000)         'Pan Servo to furthest counter clockwise
                                                  'position 
    
    



    Should the description indicate "Pan Servo to furthest counter clockwise position in a 1 minute duration

    #5 - Is there a reference I should be reading before jumping in like this? Perhaps a reference that would help answer my questions so I don't pester the folks at this forum?

    Thanks,

    Scope
    [noparse]:)[/noparse]

    Yes, that would be the full description. In terms of reference, most of the stuff in the "library" and in the "object exchange" will have documentation in the comments of the code. In most cases, you can also select the "Documentation" option at the top of the editor to see just the documentation. Some of the documentation assumes some prior knowledge, and these cases, you may need to come to the forums.

    Generally, as long as you're trying, I don't think anyone sees asking questions as "pestering". Pestering is more for the guys who come online line with something like "how do I program sensor X" when it is obvious they haven't looked at the data sheet and/or examples. (my personal favorites are along the lines of "I'm doing xxx for my senior project that's due next week. Can you do all the work for me?").

    It's good to see you making progress!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John R.
    Click here to see my Nomad Build Log
  • ScopeScope Posts: 417
    edited 2010-03-21 20:45
    John,

    THANKS a whole bunch!

    I'll update this later - I'm moving back to my robot thread now:

    http://forums.parallax.com/showthread.php?p=888091

    Thanks very much again,

    Scope
  • ElectricAyeElectricAye Posts: 4,561
    edited 2010-03-22 14:16
    Scope said...
    ...I type fast and drink coffee. Probably too much coffee, at times....

    Might that be part of the problem? Perhaps you need to cut down on the caffeine.

    Try reducing your coffee intake to one pot per hour. Calm down. Take a deep breath. Despite what your over-caffeinated brain stem is telling you, the building is not on fire and your village is not under attack. You will have time to make sense of all of this before the barbarians return.

    Have patience with yourself.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Watching the world pass me by, one photon at a time.
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2010-03-22 18:25
    When it comes to the "waitcnt" command you judge time by the following:
    "cnt" must always follow in a waitcnt command exm. waitcnt(clkfreq + cnt)
    "clkfreq" is exactly 1 second. Multipling it by 2 gives you 2 seconds, exm. waitcnt(clkfreq*2 + cnt)
    To get less then a second, just divide. For example, the following gives you 1/20 of a second, or 50 milliseconds: waitcnt(clkfreq/20 + cnt) 
    
    


    This is how I understood the PAUSE to WAITCNT transition. You will find that once you know the Propeller, you will never leave it.

    Micro

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't click on this.....

    Use the Propeller icon!! Propeller.gif

    You had better not start ANOTHER PropII thread.
  • ScopeScope Posts: 417
    edited 2010-03-22 18:40
    THANKS Micro, very helpful . . . and EA, I'll consider your suggestion (as I'm looking out the window watching my village engulfed in flames)
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2010-03-22 19:56
    @Scope: Thanks! You can also just use my BS2 Commands object I just posted in the OBEX......
    Oh, and another problem you might encounter is that you cannot terminate a program with an "outa" command and it be kept. If you want to light an LED, you will need a repeat loop around the "outa" command. This sounds simple but it is disappointing to not even be able to light an LED.... smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't click on this.....

    Use the Propeller icon!! Propeller.gif

    You had better not start ANOTHER PropII thread.
  • ScopeScope Posts: 417
    edited 2010-03-22 20:59
    |
    |__I'm assuming OBEX is this --> obex.parallax.com/ ?
    |
  • ElectricAyeElectricAye Posts: 4,561
    edited 2010-03-22 22:37
    Scope said...
    |
    |__I'm assuming OBEX is this --> obex.parallax.com/ ?
    |

    Don't be silly. The OBEX is where the caudal medulla occurs. It's the point in the human brain at which the fourth ventricle narrows to become the central canal of the spinal cord, the point where the sensory fibers begin to decussate. You're such a joker.
  • ScopeScope Posts: 417
    edited 2010-03-22 23:40
    ElectricAye said...
    You're such a joker.

    Ya, well, don't be jealous - it's a gift.
Sign In or Register to comment.