Announcement

Collapse
No announcement yet.

How to clear STP-DRV-4850 memory in between moves (using P1K PLC)?

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


  • How to clear STP-DRV-4850 memory in between moves (using P1K PLC)?

    I earlier posted about my P1K PLC not talking to the STP-DRV-4850 drive and it turned out I was using the wrong communication cable. I obtained to proper cable and now have created an "FP" move based on a one shot HMI input (start button). My expectation is that once the initial "FP" move is finished I should be able to press the "start" button again and start a new "FP" move but when I push the start button a second time nothing happens. I am not sure if this is because the "FP" is an absolute move and I am trying to move to the same place twice or if the drive still has "leftover" commands from the original "FP" move that need to be cleared out after the first move is made (note: I am trying to use a SP0 command before the FP to set initial position at 0 each time). I have attached screenshots of my logic and if necessary can post the program itself. As always, any input from this awesome community is sincerely appreciated and thank you in advance for your time.
    Attached Files


  • #2
    Sounds like you should be using the FL (feed to Length) command which uses a relative move.

    Comment



    • #3
      I don't know your PLC, I see the command in your program but, if really a true sp0 command like dl6 plc then sp0 only happens on very first scan after power up or after going to run mode after program not every scan

      Comment



      • #4
        Thank you for the input! I will try changing my FP command to FL and see what happens (being sure to post results). Being new to SCL I will do some more research to see if the SP0 is a first scan command or not.

        Comment



        • #5
          The "SP0" he is sending is an ascii command, not the same as the typical SP0 in a PLC. Where a PLC that would be first scan, SP is just set position and 0 is 0 counts. It looks the same when talking about it on a web forum, but they are actually different commands and going to different areas.



          Using set position 0 and then feed to position 20,000 should work, but I am wondering if there is just some interaction there that is causing issues. Like maybe you need to send the set position and execute before you send the feed to position and execute. Im not sure if that is the case or not, but Im just thinking that maybe buffering them both for execution in a single command may be causing the issue.
          Either way, using feed to length is probably an easier fix and would do what you want in a single command instead of using two.



          edit:
          another way you could test if your SP+FP command is working or not would be to make a second button that executes a position move with an FP0. Execute the first command to move CW to 20k steps, then hit the second button and see if the stepper moves CCW backwards 20k steps. If it does, the set position is not working properly.
          Last edited by MikeN; 11-08-2019, 12:50 PM.

          Comment



          • #6
            Thanks MikeN! I will try buffering the SP and FP commands separately as well as the second button idea for more in depth knowledge (although it sounds like I should ultimately go with FL).

            Comment



            • #7
              I ended up going with the FL function and everything is performing as it should. On a new note if I simply wanted to jog the motor what would be the easiest way to jog CW and CCW?

              Comment



              • #8
                Originally posted by akahammer View Post
                I don't know your PLC, I see the command in your program but, if really a true sp0 command like dl6 plc then sp0 only happens on very first scan after power up or after going to run mode after program not every scan
                The first scan bit in Productivity is, "First Scan Bit," as the software is tag based and you program by tag names, not by addresses.
                Why worry? If you've done the best you can, worrying won't make it any better

                - Walt Disney

                Comment



                • #9
                  So I am now jogging in one direction (CW) as necessary but do not know how to jog CCW. Is there some sort of "set direction" command that I need to use as well?

                  Comment



                  • #10
                    DI VS DI-, all is good!

                    Comment



                    • #11
                      Apparently I was incorrect...

                      Comment



                      • #12
                        Using the same FL command should be able to move either direction, just with FL20000 being CW and FL-20000 being CCW.

                        As for jogging itself, it looks like you send a jog speed command, and then a "CJ" command to commence jogging. The direction looks like it says it should be set by the last DI command like you mentioned. So if you have set a DI-#### prior to the job it *should* jog in the CCW direction.
                        SJ is a stop jogging command.

                        Comment



                        • #13
                          Again, thank you for the insight. It is invaluable to me and I sincerely appreciate it! I was originally trying to do a JA, JD, JS, DI, CJ move. I was able to greatly simplify that by doing the JS, DI, CJ move. I also did not have a value after my DI move ( I was trying to do just "DI" or "DI-) which I think was the cause of me only being able to go in 1 direction. As soon as I added a value after the DI everything fell into place and I am now jogging CW or CCW. I cannot thank this group enough! Now on to a "seek home" command (sensors are in hand) and hopefully I will be posting a completed program soon!

                          Comment

                          Working...
                          X