How to use Matlab (16F877a) to program servo motors

Discussion in 'The Projects Forum' started by wk7au, Apr 16, 2013.

  1. wk7au

    Thread Starter New Member

    Apr 16, 2013
    15
    0
    Hi, I am doing my final project this semester and I am constructing a robot arm.
    However I am facing a problem to program my servo motors, I am using 16F877a to control them but then I only had basic knowledge in matlab so I am here to looking for help :) My servo model is C36R.

    I don't even have an idea to make it move , please help ! :( :( :( :(
    Btw, I also wan to know how to control servo's angles rotation and so on..GUIDE ME !
     
  2. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    Sounds like you need to figure or how to Google things... Once you understand what is required, you need to find a way to make it happen...

    look up servo control do you can understand how it works...

    Look up how to do it (or better, devise it yourself) with a 16F877a...

    Make the PIC respond to data sent to it through UART.

    Look up how to communicate with a microcontroller from MATLAB

    Implement a connection and figure it how to specify angles in MATLAB and communicate that to the PIC. Make it so the PIC moves it to that location.
     
  3. wk7au

    Thread Starter New Member

    Apr 16, 2013
    15
    0
    If Google can solve my problems then I think I will not asking in here ;(
    I tried the programs found in Google but when I build it , it said errors found in the assembly language

    Because due to what I learnt in Matlab just some basic assembly languages so I am not very understand as in my knowledge is more towards to mechanical..
     
  4. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    MATLAB is pretty darn far from assembly.

    Did you look up the other things I suggested, or simply try, "how to get MATLAB to control servo with PIC16F877a"?
     
  5. wk7au

    Thread Starter New Member

    Apr 16, 2013
    15
    0
    Tried, my google results are now all purple words, results gt either the programs couldn't function or no solution , well I gonna try to study it anyways

    I meant I only know the simple operation in Matlab like movlw, addlw and the bank things.
     
  6. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    Matlab doesn't have those commands... I think you are trying to say MPLab assembler....
     
  7. wk7au

    Thread Starter New Member

    Apr 16, 2013
    15
    0
    Yeah think so, as I said I am not very good in this so do you have any link or information tht could help me?
     
  8. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    So, to be sure, you are attempting only to control a hobby servo with a PIC, right?

    Have you looked up how to control a servo? I would suggest you do that.
     
  9. wk7au

    Thread Starter New Member

    Apr 16, 2013
    15
    0
  10. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    You are jumping the gun(getting ahead of yourself), you need to understand how to control a servo before you can go look at how someone else did it.

    A servo is controlled through pulse-width modulation. It takes a pulse width between 1-2ms to determine the angle the servo will move to. It expects a pulse every 20ms.

    See:
    http://en.wikipedia.org/wiki/Servo_control
     
Loading...