My project is starting


Closed Thread
Results 1 to 40 of 92

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Maybe run the latency test on EMC2 and then run the conf wizard to see what your target PC will need/do exactly.

    I am only running one parallel port on a 1.3 GHz machine with 758 MB ram. Two ports may make a difference.

    Those be my thoughts.
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default oh happy day

    I am blessed with 4 8-bit timers to go with my 16 bit timer. along with some DT_INT, I should be able to make this work just wonderful!!

    And that is a great idea Dave, I never really considered running 2 ports may slow things down a bit.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  3. #3
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default working to this point

    So far I have a main that just moves porta to latc on every iteration. It also checks that enable is high. If enable is low, it gosubs to disable drives, and waits there for a high again on the enable line. At which point it returns to the main to keeep passing values from porta to latc.
    Also have a DT_INT every 5 mS. this does nothing but inc a counter used to flash a LED every .5 sec. That is also handled in the main. If count=100 then toggle LED

    This all works

    Now its time to step up the function here. I want to move the port passing to the int. But I am having a brain fart about the timming. The pulses last for 10uS high and 10uS low. I am thinking a 5uS interupt will ensure I NEVER miss a pulse, but my mind is cloudy on this. My int will be ASM, so no PBP context saving for entry and exit. I want to do this so I can do more stuff and never worry about missing a step.

    Does this seem right?
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  4. #4
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by cncmachineguy View Post
    Now its time to step up the function here. I want to move the port passing to the int. But I am having a brain fart about the timming. The pulses last for 10uS high and 10uS low. I am thinking a 5uS interupt will ensure I NEVER miss a pulse, but my mind is cloudy on this. My int will be ASM, so no PBP context saving for entry and exit. I want to do this so I can do more stuff and never worry about missing a step.
    You could do an interrupt on change of state for portA,

    RAC_INT -- RA Port Change

    Then have your interrupt routine look to see which bit has changed state.
    </pre>
    http://www.scalerobotics.com

  5. #5
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default

    Don't I need to do that on a port with IOC? Port B seems to be my IOC port, but since B has ICSP pins, I left them dedicated to ICSP. I need all 8 pins for my control.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  6. #6
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by cncmachineguy View Post
    So far I have a main that just moves porta to latc on every iteration.
    Hey Bert,

    I am trying to understand this better. Would you mind generalizing what it is your board is going to be doing? I take it that it is passing all of the data from porta to portc. But beyond that, I am in the dark. I guess your EMC2 program is sending stepper motor signals through the parallel port, to your board. Then your board is passing it to the stepper if it is enabled. Couldn't you just avoid passing it from one port to another, and act directly on the parallel port pins, or am I missing something?
    http://www.scalerobotics.com

  7. #7
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default

    Walter you are exactly right. I could have just passed the signals to the drives. In fact I thought about doing just that. But heres the thinking:
    This will be a project to be done in several phases.
    phase 1:
    pass motor signals to the drives
    watch limits and disable drives if hit
    report to EMC a problem has occured
    LED indicators for drive status (enabled or disabled)
    phase 1 will give me basic functions of my machine while playing with future phases.

    phase2:
    add in serial comm and set some parameters such as drive current, switch offsets, and any others I can think of. My machine has mill and hotwire capabilities all built in, I am sure There will be different "Zeros" for each. I am not sure EMC can handle that. So I may have to have my board maintain an offset and get a signal from EMC to tell it which mode its in. That way The board could adjust the axis when "tool change" occurs. for this I will need to talk to the steppers.
    Until Phase 2 is complete, the offset stuff will be handled in the machine program.

    phase3:
    Turn the card into a full controller, being able to download a G-code program to it and hit go, elimiting the need for EMC at all.
    This will be a big deal and prolly take a good while.


    Happy to answer any more questions, just ask.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

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