Shop OBEX P1 Docs P2 Docs Learn Events
Programing IzeBot robot....need some help,i`ve stucked... — Parallax Forums

Programing IzeBot robot....need some help,i`ve stucked...

PistuPistu Posts: 10
edited 2009-03-19 15:43 in BASIC Stamp
hey guys
need some hlep
i`m programing an IzeBot vehicle with fuzzy logic.
i`ve started to write the program but i`ve stucked....now i want to make a table to write values of the membership functions and with fuzzy rules i want
with IF..THEN rules to read the recent value from the accelerometer sensor [noparse][[/noparse]Memsic2125] and to find the value in the table and to act.
any idea?

thanx for helping me


sorry for my english.... smile.gif

Comments

  • JDJD Posts: 570
    edited 2009-03-13 17:34
    Pitsu,

    It is unclear which microcontroller that you are using. Can you provide some more details with the BASIC Stamp module being used, and any sample code you have written so far?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Respectfully,


    Joshua Donelson
    www.parallax.com
  • PistuPistu Posts: 10
    edited 2009-03-16 11:04
    i will use rules like...
    IF accel_x=ZE and accel_y=ZE THEN r_motor=Fast_f
    IF accel_x=ZE and accel_y=ZE THEN l_motor=Fast_f
    IF accel_x=ZE and accel_y=NS THEN r_motor=Fast_f
    IF accel_x=ZE and accel_y=NS THEN l_motor=Medium_f .....and so on...
  • JDJD Posts: 570
    edited 2009-03-16 19:54
    Is there a chance you can post the .bs2 program? That way we can look at the entire program, you can do so by using the Attachment Manager?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Respectfully,


    Joshua Donelson
    www.parallax.com
  • JDJD Posts: 570
    edited 2009-03-18 15:22
    Pistu,

    I'm taking a look at the program, and seeing if I can make a suggestion as to a route to take.

    Thank you for your patience,

    Joshua Donelson

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Respectfully,


    Joshua Donelson
    www.parallax.com
  • PistuPistu Posts: 10
    edited 2009-03-18 15:28
    Thank you!...i think that lookup tabel would help but i`m not sure how...i`ve made a few test but nothing...thanx a lot again and waiting your answer.

    Regards,
    Pistu

    Post Edited (Pistu) : 3/18/2009 3:34:05 PM GMT
  • JDJD Posts: 570
    edited 2009-03-18 16:07
    Pitsu,

    It looks like you are always trying to send same duration of the PWM cycle, but change the Duty and Pin; is that correct? Or did you want to change the Pin, Duty and Cycle?

    Joshua Donelson

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Respectfully,


    Joshua Donelson
    www.parallax.com
  • JDJD Posts: 570
    edited 2009-03-18 16:08
    Pistu,

    Are you trying to create a similar project as the following?

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



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Respectfully,


    Joshua Donelson
    www.parallax.com
  • PistuPistu Posts: 10
    edited 2009-03-18 17:03
    in that program i`ve just tested the accelerometer - dc motor comunication.
    something like this i want to make http://forums.parallax.com/showthread.php?p=524063 but in my project the pwm commands is according to fuzzy logic...
    now i want to make from ex. to the Accel_X 3 tabels ZE,Small,Great and to write the values [noparse][[/noparse]pulses] ZE [noparse][[/noparse]1,2,3,4....45]
    then i want that the incoming pulse from the accelerometer to be categorized to a tabel and to respond to the rule IF accel_x=ZE and accel_y=ZE THEN r_motor=Fast_f Fast_F [noparse][[/noparse]pwm comand]
  • JDJD Posts: 570
    edited 2009-03-18 21:15
    Did you want to have the full range of 0-255 for both? or did you want to maintain the same Cycle value but change the Pin and Duty?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Respectfully,


    Joshua Donelson
    www.parallax.com
  • PistuPistu Posts: 10
    edited 2009-03-19 15:35
    i will maintain the duration from the pwm but the cycle and the pins will be changed for both.

    The LOOKUP command in the basic stamp would help me to make tables?..i`m not sure how...
  • JDJD Posts: 570
    edited 2009-03-19 15:43
    The command can be reviewed in the BASIC Stamp Syntax & Reference Manual for clarification. It is using a numerical value index to assign a value to the variable.

    For example:

    Index = 3
    LOOKUP Index, [noparse][[/noparse] 5, 6, 7 ], Variable

    This would make the variable equal to 7

    BASIC Stamp Syntax & Reference Manual [noparse][[/noparse] soft copy ]:
    http://www.parallax.com/Portals/0/Downloads/docs/prod/stamps/web-BSM-v2.2.pdf



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Respectfully,


    Joshua Donelson
    www.parallax.com
Sign In or Register to comment.