robotic arm...


Results 1 to 6 of 6

Thread: robotic arm...

Threaded View

  1. #5
    Join Date
    Mar 2006
    Location
    China
    Posts
    266


    Did you find this post helpful? Yes | No

    Default Pulsout... hmmm

    This depends what you want to do. Do you want your pic to be more or less dead for 30% of the time or do you plan to do more things?

    The thing is that you should update your 3 servos for the arm every 20 ms to keep them in the right position. If you don't do that they can start to drift or loose torque so they will become weak. If all your 3 servos are in the max position you will be spending 3*2ms waiting and then you have 14 ms for other stuff... in fact your PIC will seem to be locked up for 15-30% of the time depending where your arm is.

    What you need to have here is an interupt routine that executes every 20 ms and inside this routine you should use a second timer to generate a new interupt for each servo. With DT's interupts you can easily set this up. In your case at 20 MHz you would have a variable for each servo with a value from 5000 to 10000 (representing min and max) depending on your servo position.

    All this of course comes down to if you have any timers availible. If you dont have that you better try to make a fast main loop where you use high and low (or =1 , =0) to set the pins manually.

    I would go for the interupt solution, sure it might be a bit harder in the beginning but after you have made this you can write more or less anything you want in your main loop and that will not affect your arm in any kind of way. Your main loop just need to set the variable value for each servo and the interupt routine will keep the servos there for you.

    I know is sucks that I didnt give you any code but I dont think it is time for coding yet until you have figured out what you want your PIC to do.

    Maybe you also want your PIC to do other things such as following a line and then you can not wait for stuff to finish before you try to correct the heading again....

    /me
    Last edited by Jumper; - 30th May 2008 at 11:42.

Similar Threads

  1. PIC BASIC Compiler for ARM machines?
    By stone20008 in forum General
    Replies: 2
    Last Post: - 22nd August 2008, 07:14
  2. dsPIC ?!
    By xenon_xplo in forum Schematics
    Replies: 13
    Last Post: - 11th June 2007, 19:49
  3. PBPro for 16-bit PICs (24F/24H/DSPICs)?
    By Sergeant in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 20th April 2007, 20:18
  4. pin 12f683
    By jcleaver in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 22nd March 2007, 22:29
  5. HPWM and 16F628A
    By Michael in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 14th February 2006, 14:27

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts