Shop OBEX P1 Docs P2 Docs Learn Events
XMMC Memory model with ActivityBot — Parallax Forums

XMMC Memory model with ActivityBot

djgsi974djgsi974 Posts: 16
edited 2014-03-20 13:45 in Robotics
Hello everybody.

I've spent a little time to learn programming my activitybot with the tutorials related to it.
I love this robot, especially the easy way we can program it. Parallax did a very good job.
Now i would like to make my own program, using and combine all that i've learned.
The problem is that the activitybot as insufficient memory to make all that i want.
So, i've searched for tutorials that explain how to use the xmm memory model, but i didn't find something that is understandable for me (i'm a beginner, sorry).
Is there a tutorial somewhere (or a documentation) that i can use for that ?
Perhaps i must learn Spin, but in that case, where can i find tutorial to learn this language ?
But honestly, I prefer the C language.

Thanks a lot.

Comments

  • edited 2014-03-19 13:51
    The current incarnation of XMMC requires that that code for other cogs get executed from Cog RAM. In other words, use COG C or PASM (Propeller assembly language). Most of the code you have been working with launches cogs with code written for the CMM/LMM memory model, which is not compatible. There is a new version of XMMC that will be compatible in development, and we'll post as soon as it's ready for testing, but it'll probably be a while. However, a tutorial on writing COGC libraries will come out pretty soon. Send me a PM if you want to be one of the reviewers.

    For prototyping, I'd recommend ditching the abdrive library, and use servodiffdrive.h instead. That should make enough room for your other libraries. The servodiffdrive library doesn't read the encoders, but neither does the Spin version.

    To use servodiffdrive:

    Remove the screws that hold the battery pack to the chassis and set it aside. Don't disconnect it or anything, we just need screwdriver access to the adjusting holes in the servos.

    > Run a program that includes servodiffdrive.h and uses drive_speeds(0, 0) to send the stay still signal.

    > Then, use a Phillips screwdriver to adjust the Pot behind the hole in the servo case to adjust each servo so that it stays still with that stay still signal.

    > Experiment with servodiffdrive.h and use drive_speeds for speed control.

    Also PM me if you are interested in testing a smaller footprint abdrive library when its ready for testing.
  • djgsi974djgsi974 Posts: 16
    edited 2014-03-20 04:38
    The current incarnation of XMMC requires that that code for other cogs get executed from Cog RAM. In other words, use COG C or PASM (Propeller assembly language). Most of the code you have been working with launches cogs with code written for the CMM/LMM memory model, which is not compatible. There is a new version of XMMC that will be compatible in development, and we'll post as soon as it's ready for testing, but it'll probably be a while. However, a tutorial on writing COGC libraries will come out pretty soon. Send me a PM if you want to be one of the reviewers.

    For prototyping, I'd recommend ditching the abdrive library, and use servodiffdrive.h instead. That should make enough room for your other libraries. The servodiffdrive library doesn't read the encoders, but neither does the Spin version.

    To use servodiffdrive:

    Remove the screws that hold the battery pack to the chassis and set it aside. Don't disconnect it or anything, we just need screwdriver access to the adjusting holes in the servos.

    > Run a program that includes servodiffdrive.h and uses drive_speeds(0, 0) to send the stay still signal.

    > Then, use a Phillips screwdriver to adjust the Pot behind the hole in the servo case to adjust each servo so that it stays still with that stay still signal.

    > Experiment with servodiffdrive.h and use drive_speeds for speed control.

    Also PM me if you are interested in testing a smaller footprint abdrive library when its ready for testing.
    Hi Andy. Thanks for your answer.
    I will test the servodiffdrive library, and i sent you the PMs.
    So, if the tests are ok for me, can i remove the wheel encoders ? You said that the servodiffdrive doesn't read the encoders, but does it mean that they are unnecessary in this case ?
    (this allow me to have more connexions.
    thank you in advance.
  • edited 2014-03-20 13:45
    Great, I got your PM & replied. ...and thank you in advance for participating!

    Yes, the servodiffdrive library does not use or need the encoders, so you could remove them. You may need to experiment with drive levels to get the servos to go the same speed. For example, if drive_speeds(100, 100) makes the bot curve left slightly, try slowing down the right wheel with drive_speeds(100, 90).

    A side note, mainly for others who might read this thread:

    IMPORTANT: If you follow the manual servo calibration procedure in post #2, and then decide to go back to using abdrive, make sure to re-run the automatic calibration procedure on this page: http://learn.parallax.com/activitybot/calibrate-your-activitybot
Sign In or Register to comment.