Machine Automation Program - need peer feedback...


Results 1 to 8 of 8

Threaded View

  1. #5
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    967


    Did you find this post helpful? Yes | No

    Default Re: Machine Automation Program - need peer feedback...

    Hi Ross

    I suggested a 'select case' simply because there is not much you are doing after 'branch'ing to the subroutine. You seem to be just incrementing the step variable and going back. That would be very wasteful speedwise because a branch usually takes longer to execute. I am not sure if a select case saves time; haven't checked.

    For the table approach, I usually keep the 4 bit stepper values in a table. These 4 bits are jammed to a port that drive the stepper coils. So, a typical step table would have values like
    HalfStep=[0b0001,0b0011,0b0010,0b0110,0b0100,0b1100,0b1000,0 b1001];

    Sorry, I do not have a PBP example at hand, so, I have given you a quick and easy 'C' table. At each step, you load the next value from the table and jam it out to the port. This table shows values to drive a stepper motor in a half step sequence. For full stepping, you just use every alternate value.

    Hope this helps

    Jerson

    PS: have you read through this thread? It might have something useful to you
    http://www.picbasic.co.uk/forum/showthread.php?t=101
    Last edited by Jerson; - 19th April 2013 at 16:05.

Similar Threads

  1. Insteon Home Automation Software Development Kit
    By Stuartk in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 23rd November 2013, 17:52
  2. Replies: 3
    Last Post: - 26th November 2012, 11:20
  3. Automation project need help
    By microcnc05 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 5th January 2010, 03:17
  4. pic to pic to pic as peer to peer to peer
    By Geezer in forum General
    Replies: 1
    Last Post: - 5th September 2008, 06:53
  5. Replies: 8
    Last Post: - 8th May 2007, 11:15

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