Announcement

Collapse
No announcement yet.

Serial Commands in BRX for Stepper Motion Control Application (ATTN: plcnut)

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts


  • Serial Commands in BRX for Stepper Motion Control Application (ATTN: plcnut)

    I'm working on a pet project in my "spare time" at work.

    BACKGROUND
    My first major control system uses (all stepper motors) XYZ linear stages and a rotary stage for a semi-automated laser welding system. Not knowing then what I know now, I used Applied Motion equipment (Si3540 drives, SiNet Hub8, and MMI-01 control panel) to perform most of the motion and controls that was needed. Without getting into the details of that project, I had to cut a bunch of corners because I had run out of the Hub8's limited programming memory. It works, but not user friendly at all, and my production crew uses it only when necessary (which is not as often as I would prefer).

    GOALS
    I'm trying to update this lackluster control system by making it more user friendly utilizing AD PLC's and touch panels. For reference, we use Amada Miyachi laser systems throughout our facility, and I've created other welding fixtures using different PLC's (Click, DL06 and Do-More), all connected to C-More HMI's. The laser's interface can be either simple by using discrete I/O's through D-sub connectors (which I have successfully used), or much more involved that would allow all the laser's settings saved on the PLC (instead of in the laser's memory) & transmitted using RS-485 comm with error checking (which I have unsuccessfully tried with a Click; I prefer to avoid this route, since my operators have easy access to the laser interface panel, and I would like to keep the programming side simple).

    STATUS
    I have made some good progress in using BRX's internal serial port to communicate with all four stepper drives through the SiNet Hub8. However, looking at plcnut's sample program block "StepperComms", I realized that what I have is WAY more involved than it could be (e.g I have PLC communicate commands one at a time, waiting for an ACK response after each one, etc; now that I'm looking at it after being away from it for a couple of weeks, a lot of program blocks). I COULD post my current project, but I would like to improve it a bit before I subject you guys to some of its hacked nature . With that in mind, I will post it on request.

    DESIRES
    I would like to extract more information from plcnut in hopes to streamline, simplify, and overall improve my program for this project (and improve my PLC skills ). Here are my questions to help me better understand plcnut's program block:

    - What is V0 being used for? Why is the program block cycling it through 0 to 10? Are these index positions?
    - Any particular reason for truncating the real numbers within SL3?
    - Are you looking at the input data stream (i.e. SL0)? If yes, what element(s) are you looking for within it?
    - How is C0 (c_EnableStepCom) being used outside of this program block?
    - How are N0, N1 being used outside of the program block?
    - Why use N0, N1 instead of other data blocks (e.g. Vn, Dn, etc.)?
    - In a realistic world, how paranoid should I be in communications with the stepper drives?

    Thanks for your time!

    Disclaimer: I'm a mechanical engineer by education, and Jack-of-All-Trades by choice. ALL of my knowledge of PLC/HMI programming is self-taught, searching these forums, and looking at AD's program examples. Thanks to all who've helped me out!


  • #2
    I just saw your post (I have not had much time to be on here lately). I am happy to respond to your questions, but don't have time to think it over right now. I will type up a response at my earliest convenience.
    Circumstances don't determine who we are, they only reveal it.
    Jason Wolthuis

    Comment



    • #3
      That is all I can hope for. I understand that time is in short supply, especially with the upcoming holiday. Reply when you can, and thanks again!!

      Comment



      • #4
        Originally posted by bgirouard View Post
        - What is V0 being used for? Why is the program block cycling it through 0 to 10? Are these index positions?
        D0 through D9 contained a series of positions, and V0 was the index/pointer that would step through the array each time the code block was called.
        IE: If V0 contained a 3, then then the STRPRINT would output the value of D3.

        - Any particular reason for truncating the real numbers within SL3?
        Yes, I do not remember the details, but if the number was not right, then the drive did not like it. I also seem to recall there being a bug in the FmtReal() function, and I believe I may have been running some extra code to cover up the bug... (That bug has since been fixed by Host).

        - Are you looking at the input data stream (i.e. SL0)? If yes, what element(s) are you looking for within it?
        I believe I was only using this during testing, but if the drive returns a % it is good, or a ? if it did not understand the command (Check the SCL manual to confirm this).

        - How is C0 (c_EnableStepCom) being used outside of this program block?
        c_EnableStepCom is used as the NO contact in the rung with the RUN for the comms Program Block.
        It is RESET internally by the comms block, and also gets either a success or failure bit SET at the same time, so that I always know how the command went.

        - How are N0, N1 being used outside of the program block?
        N0 and N1 are only for informational purposes while setting up the system, and can also be displayed on the HMI to indicate the health of the system.

        - Why use N0, N1 instead of other data blocks (e.g. Vn, Dn, etc.)?
        I have never needed an N block for anything in a program, so I generally use it for INC registers throughout programs so that I know when certain rungs are executing.
        IOW, No good reason

        - In a realistic world, how paranoid should I be in communications with the stepper drives?
        I don't get too paranoid.
        I spend my time developing solid comm blocks with a defined purpose, and a path for each outcome. I then use that notification to reset/restart a device that has an issue (This is generally done in the supervisory Program block).
        Circumstances don't determine who we are, they only reveal it.
        Jason Wolthuis

        Comment



        • #5
          My apologies for the delay, but I was on vacation all last week, and am finally back up to speed enough to look on the forums. Thanks for the detailed response! I'll go through this in the next few days and let it sink in a bit. Thanks again for posting this!

          Comment

          Working...
          X