Shop OBEX P1 Docs P2 Docs Learn Events
Help — Parallax Forums

Help

AhmadAhmad Posts: 2
edited 2009-04-27 18:24 in BASIC Stamp
Dear guys,

I'm a PhD student and responsible for some master student working on a project to control a vehicle with facial expression.

I help them in image processing task and we are totally unfamiliar with BS2. We have a BS2 and MMC board at LAB. The aim of project is using a webcam to track face through MATLAB. MMC board is connected with serial port to PC. The X and Y coordinates of face is determined with image processing techniques and it should goes through serial port to BS2. The motor with an actuator can rotate webcam.

So when we send a position (between -180 to 180) degrees according to face coordinates, we want the webcam goes to new position.

Can anybody help us in the following problems:

1 - What is the program that should be uploaded to BS2? (The student don;t know anything about it, they are bio-engineer students)
2 - I'm familiar with MATLAB but I don;t know is there any specific routine to communicate through MATLAB with board real time or not or we can use regular commands (such as s = serial('s') , etc) here.

Any help/source code are completely welcome!

Best

Ahmad

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2009-04-27 17:40
    Ahmad,

    This sounds like an interesting project!

    Without a diagram of your general hardware setup, I can only guess at the relationship between all the parts. But, assuming the signal processing allows the PC to send the position to the Stamp. The Stamp will then drive the webcam's servo to the desired position.

    There is no particular program to load into the Stamp. Someone will have to program the Stamp using PBASIC to receive the serial data then issue the appropriate commands to the webcam servo. Luckily, the language is easy to learn and has only 60 or so commands. In your case, the most important will be SERIN and PULSOUT to read the serial data and talk to the servo, respectively.

    When the development environment is loaded onto your laptop, there is an extensive Help file which has lots of detail.

    As you run into specific problems, post them in the forum.

    Cheers,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • AhmadAhmad Posts: 2
    edited 2009-04-27 18:09
    Dear Tom,

    Thanks for the reply. The aim of project is to help elderly people who cannot talk very much and by using face (eye, lips, ...) features, the machine helps them to do their tasks.

    I have figured out that is should be at least one program loaded in BS2. Is n't t? If yes, can you let me know which one is suitable for our project?

    I can write on serial port with very simple commands:

    S = serial('COM1', 'baudrate', 9600)

    fopen(S)
    fprintf(S,'%d\n',[noparse][[/noparse]650])
    fclose(S)

    and as I said I have a dc motor connected to MMC board( http://www.solutions-cubed.com/Solutions Cubed/MMC_BS2.htm) but when I write something to serial port, I did not see any change. I've just tried to copy/paste some sample codes for BS2 but it takes no difference to send a different value to serial port and the speed is not changed.

    To have a open loop control on position, as I said in first post, I need only to send a value from serial port and I need motor goes to that position but I think with my poor knowledge I'm far from it.

    I hope you/others can provide me more details.

    Ahmad
  • FranklinFranklin Posts: 4,747
    edited 2009-04-27 18:24
    Without an encoder the MMC does not look like it can 'move to a position' You might want to use a servo as proof of concept and simplify your hardware and software needs.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
Sign In or Register to comment.