584,837 active members*
5,590 visitors online*
Register for free
Login
Results 1 to 11 of 11
  1. #1
    Join Date
    Sep 2005
    Posts
    38

    Determining the velocity of an axis near real-time

    Hi,
    This is Nuri from MakerStorage LLC.
    I need your help on Determining the velocity of an axis near real-time with brains (or maybe with vb script) with Mach3
    I want to send this information via Modbus. I know the Modbus part but need help on getting the current velocity of one axis.
    Thanks for your help

    Regards,
    Nuri
    MakerStorage

  2. #2
    Join Date
    Aug 2019
    Posts
    339

    Re: Determining the velocity of an axis near real-time

    Unclear what you are trying to determine, axis angular or linear velocity?
    With knowledge of the radius and feedrate (to my limited knowledge I think M3 can provide real-time), velocity for both seems pretty easy to calc

  3. #3
    Join Date
    Dec 2009
    Posts
    166

    Re: Determining the velocity of an axis near real-time

    Maybe something like this 813 GetDRO/SetDRO Blended Velocity DRO 813

  4. #4
    Join Date
    Sep 2005
    Posts
    38

    Re: Determining the velocity of an axis near real-time

    Quote Originally Posted by Mecanix View Post
    Unclear what you are trying to determine, axis angular or linear velocity?
    With knowledge of the radius and feedrate (to my limited knowledge I think M3 can provide real-time), velocity for both seems pretty easy to calc
    What I am trying to get is the velocity of the A axis. ( linear velocity). I have a pallet extruder with a huge motor driven by a VFD. I will connect to the VFD over Modbus and send a frequency value in accordance with the speed of the A axis.
    I am trying to read the DRO of the A axis with 100ms intervals and use the difference as a velocity indicator.

    I am sure you guys have better solution than this.

    Regards
    Nuri
    www.makerstorage.com

  5. #5
    Join Date
    Aug 2019
    Posts
    339

    Re: Determining the velocity of an axis near real-time

    Quote Originally Posted by nerginer View Post
    I am sure you guys have better solution than this.
    Could be.
    I'd just hook up an optical or magnetic encoder IC with an affordable xilinx spartan-3 or 6 to the A axis directly and send that pulse over the vfd (if that'd be me).
    Just never know what this bug'gy M3 could do... hence a hardware solution.
    Have a look at the AM4096 12-bit magnetic encoder. Pretty lightweight and low cost implementation, if you need precision.
    I see you are in embed from your url so that proposition might be a day work or two for you.

    Otherwise no idea how you could pull this data out from M3 in a stable/real-time fashion way. Not too experienced with M3, just a user

  6. #6
    Join Date
    Sep 2005
    Posts
    38

    Re: Determining the velocity of an axis near real-time

    Quote Originally Posted by Mecanix View Post
    Could be.
    I'd just hook up an optical or magnetic encoder IC with an affordable xilinx spartan-3 or 6 to the A axis directly and send that pulse over the vfd (if that'd be me).
    Just never know what this bug'gy M3 could do... hence a hardware solution.
    Have a look at the AM4096 12-bit magnetic encoder. Pretty lightweight and low cost implementation, if you need precision.
    I see you are in embed from your url so that proposition might be a day work or two for you.

    Otherwise no idea how you could pull this data out from M3 in a stable/real-time fashion way. Not too experienced with M3, just a user
    I think it is the correct way of doing this. I really want to see your solution. The Xilinx spartan-3 or 6 has the step pulses and the encoder feedback and calculates the error and trying to compensate it with a PID algorithm?

    My solution can be very cost-effective because having the velocity of the A-axis from the brain and send it directly via Modbus to VFD with a cheap USB to RS484 converter dongle.

    Anyway I am open to any idea. Thanks for sharing.

    Regards
    Nuri
    www.makerstorage.com

  7. #7
    Join Date
    Aug 2009
    Posts
    230

    Re: Determining the velocity of an axis near real-time

    Depending on the level of precision required, and the update rate, you could even skip the FPGA, and just use a microcontroller for this - perhaps some variant of Arduino (something SAMD21 based? Like the Arduino Zero, or an Adafruit Feather M0).

    If I was going to use a FPGA, however, I think I'd probably go for an ICE40; because there is an open-source toolchain available for it, and that toolchain isn't 7 or so GB to download; and isn't dependent on obsolete versions of either Windows or Linux... but that's me - YMMV.


  8. #8
    Join Date
    Sep 2005
    Posts
    38

    Re: Determining the velocity of an axis near real-time

    Quote Originally Posted by __Britt View Post
    Depending on the level of precision required, and the update rate, you could even skip the FPGA, and just use a microcontroller for this - perhaps some variant of Arduino (something SAMD21 based? Like the Arduino Zero, or an Adafruit Feather M0).

    If I was going to use a FPGA, however, I think I'd probably go for an ICE40; because there is an open-source toolchain available for it, and that toolchain isn't 7 or so GB to download; and isn't dependent on obsolete versions of either Windows or Linux... but that's me - YMMV.

    I do not know if samd21 can handle both the step pulse and the encoder feedback at the same time with a PID calculation. Sand21 is a great chip and runs at 48Mhz but I have some doubts about the required CPU time.

    Regards
    Nuri
    www.makerstorage.com

  9. #9
    Join Date
    Aug 2019
    Posts
    339

    Re: Determining the velocity of an axis near real-time

    Quote Originally Posted by nerginer View Post
    The Xilinx spartan-3 or 6 has the step pulses and the encoder feedback and calculates the error and trying to compensate it with a PID algorithm?
    Pretty much. A 50mhz crystal to an input pin and off you go, can pulse/duty or correct what you want based on that clock really. Good project for you to bring in hdl to your existing toolbox, if you haven't done much already.
    Briit could be right about an even low'er cost ARV though, was just suggesting one of those ridiculously cheap fpga for parallel (real-time?) and speed/precision.
    I really can't help on the M3 part, never really bothered too much with it, partly due to its ancient and bug'ed reputation, perhaps lol. Sure someone more familiar with it can chime in.
    G'luck

  10. #10
    Join Date
    Mar 2017
    Posts
    411

    Re: Determining the velocity of an axis near real-time

    Since, all you need is a the velocity for the A axis, you don't need an encoder, you just need the pulse rate of the step signal driving that axis. Since you know the step size, the pulse rate will give you the velocity. You can also use the direction signal for obvious reasons.

    You could read the signal with an off-the-shelf Arduino. Add a Modbus shield to the Arduino, and you can send the data directly to the VFD.

    Edit:

    I am assuming that it is Modbus over RTU, not TCP and that your VFD has a RS485 port with published specs.

  11. #11
    Join Date
    Sep 2005
    Posts
    38

    Re: Determining the velocity of an axis near real-time

    Quote Originally Posted by maxspongebob View Post
    Since, all you need is a the velocity for the A axis, you don't need an encoder, you just need the pulse rate of the step signal driving that axis. Since you know the step size, the pulse rate will give you the velocity. You can also use the direction signal for obvious reasons.

    You could read the signal with an off-the-shelf Arduino. Add a Modbus shield to the Arduino, and you can send the data directly to the VFD.

    Edit:

    I am assuming that it is Modbus over RTU, not TCP and that your VFD has a RS485 port with published specs.

    Yes, This can be the best open-loop solution. I can set an interrupt and start a timer up to the next interrupt. This calculated time must be proportional to the axis velocity. With proper scaling, I can send it to VFD via Modbus RTU.
    Thanks for the response.

    Regards,
    Nuri
    www.makerstorge.com

Similar Threads

  1. DETERMINING TIME OF SHEET WITH FORMULA ??
    By RYANEDESIGN in forum DIY CNC Router Table Machines
    Replies: 0
    Last Post: 09-22-2016, 02:22 PM
  2. Simulink Real time
    By steppy in forum CNC Machine Related Electronics
    Replies: 1
    Last Post: 08-05-2010, 04:40 PM
  3. Real Time Board
    By technetics in forum Cincinnati CNC
    Replies: 3
    Last Post: 12-16-2009, 07:01 PM
  4. Time logging of position, velocity and acceleration
    By maxlem in forum Mach Software (ArtSoft software)
    Replies: 8
    Last Post: 04-15-2009, 02:15 PM
  5. real time
    By Mr Bits in forum LinuxCNC (formerly EMC2)
    Replies: 8
    Last Post: 12-26-2007, 01:09 AM

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
  •