585,712 active members*
3,905 visitors online*
Register for free
Login
IndustryArena Forum > OpenSource CNC Design Center > Open Source Controller Boards > How to generate fast step/direction signals
Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2008
    Posts
    4

    How to generate fast step/direction signals

    Hi,

    I am new to CNC machining so please pardon my naive questions.

    I want to control a 20,000 ppr ac servo motor which came with its driver using a PC.

    However, the parallel port motion controllers provide very low frequency step/direction signals (~25 KHz) which gets me to about 1 rps or 60 rpm.

    the motor is capable of doing 3000 rpm.

    So, my question is how to generate a very high pulse rate ie about 1Mhz to 3Mhz (like the propriety controllers). I realize that the propriety controllers use dedicated hardware to generate such high pulse rate and communicate with the PC over the PCI bus.

    However, my intuition (supported by calculations) tells me that it should be possible to convey position data to a hardware board using USB and then use the dedicated microcontroller to generate step and direction signal.

    I have designed PC to USB device communications int he past using PIC 18f4550 and Atmel ARM AT91SAM7 series as well as Atmel AVR32 UC3A and AP7000 processors. So I can definitely design the communication of position data (1 ms intervals) of the various axes as well as I/O sampling over USB to the microcontroller.

    However, I am drawing a blank when it comes to the generation of high speed step/direction signals.

    Any ideas on this?

    Regards,

    amit

  2. #2
    Join Date
    Aug 2007
    Posts
    558
    Hi Amit,

    Many drives have an electronic 'gearing' function that will multiply the pulses received by any factor you set. I assume your drive does not have this capability, or you want to retain the full resolution. In this case, the easy way out is a Smoothstepper from www.warp9td.com

    Regards,

    Jason

  3. #3
    Join Date
    Oct 2008
    Posts
    4
    Hi Jason,

    Thanks for the response.

    The site that you suggested is somewhat similar to what I want to build.

    However, I want to do it open source using an open source front end like EMC2 (or atleast use the G-code converter from there).

    Currently I am not able to figure out how to generate high speed pulses for pulse and direction output at a rate of 1MHz (EMC2 can at best do 50 KHz).

    I am also open to using a different controller chip for each axis with one master coordinator which coordinate the various axes and synchronize them.

    However, even with separate microcontrollers for each axis, I would still need a lot more horsepower per microcontroller to generate a 1 - 3 MHz pulse rate by toggling a bit in code.

    I believe that there should be a timer/counter peripheral based algorithm that can be used. However, I am not aware of it.

    I looked up the EMC2 algorithm which actually uses feedback from the pulses generated to ensure that the position counters are where they should be (you can find the stepgen algorithm in the Integrators manual for EMC2). However, such an algorithm where the pulses are generated completely under software control would require a lot of horsepower while not being able to run faster than 100us on a computer or even a 20 - 60 MHz processor.

    So, I am looking for recommendations on how to do this.

    Regards,

    amit

    Is there a simillar algorithm

  4. #4
    Join Date
    May 2007
    Posts
    781
    Why limit your self to a position mode motion control system, (step/dir)?

    Where Emc really sets itself apart from most all the other motion control software that is affordable at a hobby level is that it can do torque and velocity mode control.

    If you do need to stay with step/dir you could do something as simple as having EMC output an analog velocity command and a digital direction command the velocity signal you feed to a voltage to frequency converter to get your step signal. The encoder signals then need to be feed to an up/down counter (hardware if you want to go really fast) which EMC can then read at its servo control loop rate. The up/down counter needs to have enough bits so that it cannot overflow between the times EMC reads it.

  5. #5
    Join Date
    Oct 2008
    Posts
    4
    Hi Andre' B

    Thanks for the information. This is exactly what I was looking for. I will look up velocity to frequency conversion and see if the frequency can be directly be generated by a timer and a direct feedback be provided by an up/down counter directly in hardware. That is a very good idea.

    However, you have raised a very important point with regards to velocity control or torque control v/s position control.

    It is true that EMC2 provides a complete servo controller for each axis and the servo rate on each axis is also quite acceptable at 10 KHz. However, the servo controller is also implemented by most drives which is also acceptable for most applications which do not require dynamic or kinematic compensation for various axes.

    The thing I dont like about EMC2 is that you need to have a complete computer dedicated to something that can be done by a low level processor.
    The high level task of motion processing should be done by the computer but after that the computer should switch to a supervisory role and let the low level processors handle the strict timing requirements of servo control.

    Further many CAD softwares are not directly available for LINUX (WINE is not an option for most CAD/CAM s/w). This brings about a forced separation in the work flow between the design and execution which may not be acceptable for some tasks.

    Further parallel ports and PCI cards are starting to become rare on newer computers and are being replaced by the ubiquitous USB. So, to stay ahead of the curve, we should design some hardware that can process position commands over USB. Due to the inherent latency in the USB bus protocol (anywhere from 4 to 20 ms and even 100 ms in rare instances), velocity / torque control (or direct servo control) will not be possible directly over USB. Hence we will require to transfer the motion data (be it position or Gcode) over USB to some intelligent hardware which will then play out the position or process the Gcode using a motion processor and then play out the positions. The servo (if implemented) in this setup will have to be done on the hardware level.

    This is my motivation to try to develop a USB based servo controller.

    It will be interesting to hear peoples comments on my viewpoint.

    Regards,

    amit

  6. #6
    Join Date
    Apr 2006
    Posts
    169

Similar Threads

  1. Step or Direction?
    By ardor in forum Viper Servo drives
    Replies: 3
    Last Post: 07-25-2007, 09:04 PM
  2. Fast Switching Direction stabilization motors
    By Ragnarok in forum Servo Motors / Drives
    Replies: 0
    Last Post: 03-12-2007, 05:51 PM
  3. To convert Quadrature Encoder signals to Tachogenerator signals
    By Babar in forum CNC Machine Related Electronics
    Replies: 4
    Last Post: 02-21-2006, 07:05 AM
  4. How fast before step loss
    By creep_pea in forum Bridgeport / Hardinge Mills
    Replies: 8
    Last Post: 01-06-2006, 02:13 AM
  5. step in what direction
    By craftech in forum Stepper Motors / Drives
    Replies: 5
    Last Post: 10-13-2004, 11:45 AM

Posting Permissions

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