Getting STEP pulses counter from board


Results 1 to 3 of 3

Thread: Getting STEP pulses counter from board

  1. #1
    Registered
    Join Date
    Jan 2013
    Location
    UKraine
    Posts
    2
    Downloads
    0
    Uploads
    0

    Default Getting STEP pulses counter from board

    Hello Tom.

    Sorry if my question was already discussed here,but I've looped through Dynomotion/Kflop/Kanalog branch and found no solution so far.

    I'm using KMotion to build non-contact 3D scanner.Having an issue with getting correct data from distance sensor.
    Used distance sensor has an external trigger input (after logic level on this input is changing from low to high - sensor returns a value )
    I decided to connect sensor input with one of output pins on the board.
    In scanning loop I need to trigger this sensor each time after sensor has moved for equal distance
    (for example when distance is set to 2mm and length of scanning object is 500mm - i need to trigger sensor 250 times)
    In VC project I used functions WriteLine("SetBitX") WriteLine("ClearBitX") to change pin state.
    But when executing this statement inside scanning loop I'm not getting the same delay between previous and next pulse,
    (I guess this seems to be a Windows multitasking issue related to different thread priority?)

    The system mechanics contains stepper motors with no feedback. To operate stepper we use drivers which have STEP and DIR inputs.
    So as another workaround we decided to use STEP pulses - they are having stable period, but their frequency is rather high.
    For example 1 step = 0.001mm. So I need to trigger sensor after 2000 step pulses (2mm). I need to build software step counter.
    Looping through C Program Samples I've found ServoTick var and UserCallback.c sample.
    Is there some possibility to get actual step counter an current moment in VC project like ch0->Position?.


    Or maybe is there a possibility to program FPGA chip on board to trigger some output pins by hardware after counting some STEP pulse count (but I guess not?).

    Thanks

    Similar Threads:


  2. #2
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4045
    Downloads
    0
    Uploads
    0

    Default

    Hi igrek,

    I think the simplest solution would be to write a KFLOP C Program to watch the motion progress and generate your pulses. KFLOP User Programs basically execute every 180us so the pulses would have that resolution. This should be ~100X better than you could get from MS Windows.

    The ch->Dest variable for the axis is the currently commanded Stepper position.

    I have attached a Tangential Knife example that does something similar. It watches the motion and every time it detects a certain amount of motion then it calculates the direction and so forth. Your case would simply need to detect the motion then pulse.

    HTH
    Regards

    Attached Files Attached Files
    Regards
    TK http://dynomotion.com


  3. #3
    Registered
    Join Date
    Jan 2013
    Location
    UKraine
    Posts
    2
    Downloads
    0
    Uploads
    0

    Default

    Hi Tom, thanks for reply.
    Great support from your side. I've tried your sample, pulse gen now works flawlessly. But I still having issues with getting data from sensor due to different time delays in Windows and currently I'm solving this issue.
    Appreciate you help. Thanks



Tags for this Thread

Posting Permissions

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


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Getting STEP pulses counter from board

Getting STEP pulses counter from board