You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old June 16th, 2021, 12:05 PM   #1
ThreatLevelMidnight
Member
United States

ThreatLevelMidnight is offline
 
Join Date: Apr 2020
Location: USA
Posts: 31
Servo program feedback

Hello,
I am new to PLC programming, and this is the first program I am have done from scratch (other than ones I have done in courses).

I am using a ML1200 to communicate to a Sure Servo Drive.

The attached program is just the beginning, as I want to make sure that I am on the right track (I will need to add several safety checks that need to happen before program will execute + there will be several more "positions").

The goal of the attached program is to send position and velocity commands to the servo drive, and to have the servo motor move to "position 1" when the Start button is pressed.

I have enjoyed learning, and welcome feedback. Am I on the right track? Any tips to improve?
Attached Files
File Type: zip SERVO TEST1.zip (15.5 KB, 9 views)
  Reply With Quote
Old June 16th, 2021, 02:21 PM   #2
roxusa
Lifetime Supporting Member
United States

roxusa is offline
 
Join Date: Nov 2008
Location: NJ
Posts: 893
I just did a machine with the Sure Servo (my first servo experience) And I used the Modbus as you are. I used a Micro Logix 1400. Are you using a zip link for the controls?
I did all through messaging. I don't set up my messaging to continually run as you have.
Also looks like your enable will toggle with the message DN bit if it even turns on since
you are repeating the 2 messages, IMO
I used an example on this forum to figure out how to make it work and then got better with more reading and bench testing.
If you need more help I can find some examples.
__________________
B.Pedersen
if you are going to assume, assume you're wrong.
  Reply With Quote
Old June 16th, 2021, 02:27 PM   #3
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 3,336
Minor issue: for a MicroLogix, I believe I/O is synchronous with the program scan, so the input and output subroutines will be unnecessary from a per-scan buffering standpoint, other than what they may provide in terms of labeling or readability.
__________________
i) Take care of the bits, and the bytes will take care of themselves.
ii) There is no software problem that cannot be solved with another layer of indirection.
  Reply With Quote
Old June 16th, 2021, 02:32 PM   #4
ThreatLevelMidnight
Member
United States

ThreatLevelMidnight is offline
 
Join Date: Apr 2020
Location: USA
Posts: 31
Quote:
Originally Posted by roxusa View Post
I just did a machine with the Sure Servo (my first servo experience) And I used the Modbus as you are. I used a Micro Logix 1400. Are you using a zip link for the controls?
I did all through messaging. I don't set up my messaging to continually run as you have.
Also looks like your enable will toggle with the message DN bit if it even turns on since
you are repeating the 2 messages, IMO
I used an example on this forum to figure out how to make it work and then got better with more reading and bench testing.
If you need more help I can find some examples.
Ya, the plan is to tie the outputs from the PLC to the zip link.

The messaging is very new to me, even courses I have taken did not go into that. What is a better way to set those up? I see some examples use a timer.
  Reply With Quote
Old June 16th, 2021, 02:35 PM   #5
ThreatLevelMidnight
Member
United States

ThreatLevelMidnight is offline
 
Join Date: Apr 2020
Location: USA
Posts: 31
Quote:
Originally Posted by drbitboy View Post
Minor issue: for a MicroLogix, I believe I/O is synchronous with the program scan, so the input and output subroutines will be unnecessary from a per-scan buffering standpoint, other than what they may provide in terms of labeling or readability.
Thanks, and agreed, I probably over label them being my first time and trying to visualize everything.
  Reply With Quote
Old June 16th, 2021, 02:52 PM   #6
roxusa
Lifetime Supporting Member
United States

roxusa is offline
 
Join Date: Nov 2008
Location: NJ
Posts: 893
This is how I cycle my comms, I know a lot of programmers suggest timers.
If you are not doing a lot of position/velocity changes there is no need to keep sending it you could set it up to only send it when a change is needed. You will notice I also read back the info so I can be sure the servo has the correct info before I trigger it to move. You can also set up your error bits from the messages to let you know if a servo is not communicating.
Attached Files
File Type: zip comms.zip (32.7 KB, 5 views)
__________________
B.Pedersen
if you are going to assume, assume you're wrong.
  Reply With Quote
Old June 16th, 2021, 03:09 PM   #7
roxusa
Lifetime Supporting Member
United States

roxusa is offline
 
Join Date: Nov 2008
Location: NJ
Posts: 893
I should note that if you are setting your servo up for absolute positioning you will need to provide the home sensor and also set up the servo for how it is to implement the homing cycle. With absolute positioning you are always moving to a position referenced from home, such as a drill. When I am using the servo for an application like a belt feed. There is no need for absolute and I only give direction and how far to move
__________________
B.Pedersen
if you are going to assume, assume you're wrong.
  Reply With Quote
Old June 16th, 2021, 03:19 PM   #8
ThreatLevelMidnight
Member
United States

ThreatLevelMidnight is offline
 
Join Date: Apr 2020
Location: USA
Posts: 31
Quote:
Originally Posted by roxusa View Post
This is how I cycle my comms, I know a lot of programmers suggest timers.
If you are not doing a lot of position/velocity changes there is no need to keep sending it you could set it up to only send it when a change is needed. You will notice I also read back the info so I can be sure the servo has the correct info before I trigger it to move. You can also set up your error bits from the messages to let you know if a servo is not communicating.
Thanks, I will review this!

The reading sounds like something I need to add. This will be what I use to verify the motor is at Position 1 before beginning Position 2 correct?
  Reply With Quote
Old June 16th, 2021, 03:21 PM   #9
ThreatLevelMidnight
Member
United States

ThreatLevelMidnight is offline
 
Join Date: Apr 2020
Location: USA
Posts: 31
Quote:
Originally Posted by roxusa View Post
I should note that if you are setting your servo up for absolute positioning you will need to provide the home sensor and also set up the servo for how it is to implement the homing cycle. With absolute positioning you are always moving to a position referenced from home, such as a drill. When I am using the servo for an application like a belt feed. There is no need for absolute and I only give direction and how far to move
I am planning to do Incremental positioning. The cycle will be a drill "peck" cycle (down, retract some, down more, retract etc).
  Reply With Quote
Old June 16th, 2021, 03:26 PM   #10
roxusa
Lifetime Supporting Member
United States

roxusa is offline
 
Join Date: Nov 2008
Location: NJ
Posts: 893
I use 2 types of feedback: 1 to confirm the new position is has been sent to the servo before I tell it to move there and 2 the actual position the servo is at so I know it completed the move after I told it to move.
I ran into this on a complex machine that had multiple servos interacting and I didnt want
any comm's delay however minimal messing up my sequence
__________________
B.Pedersen
if you are going to assume, assume you're wrong.
  Reply With Quote
Old June 16th, 2021, 03:53 PM   #11
roxusa
Lifetime Supporting Member
United States

roxusa is offline
 
Join Date: Nov 2008
Location: NJ
Posts: 893
I personally would use absolute positioning on a drill. This way all movement is based off of the home position (Drill all the way up) and all movement positions will know which way to go without direction command.
__________________
B.Pedersen
if you are going to assume, assume you're wrong.
  Reply With Quote
Old June 16th, 2021, 04:20 PM   #12
roxusa
Lifetime Supporting Member
United States

roxusa is offline
 
Join Date: Nov 2008
Location: NJ
Posts: 893
Looking through the Sure servo manual I think to change direction in Incremental you would also have to change a direction parameter each move in a different direction. There is no forward/reverse except for jog. Using absolute if your position move was 2 revs +5000 (2-1/2 revolutions) it would move one way (original program direction)and if your next move was 1 rev + 5000 it would back up 1 revolution from where it was.
Each move trigger with rev/count will determine which direction and how far to move.
__________________
B.Pedersen
if you are going to assume, assume you're wrong.
  Reply With Quote
Old June 16th, 2021, 04:21 PM   #13
roxusa
Lifetime Supporting Member
United States

roxusa is offline
 
Join Date: Nov 2008
Location: NJ
Posts: 893
Looking through the Sure servo manual I think to change direction in Incremental you would also have to change a direction parameter each move in a different direction. There is no forward/reverse except for jog. Using absolute if your position move was 2 revs +5000 (2-1/2 revolutions) it would move one way (original program direction)and if your next move was 1 rev + 5000 it would back up 1 revolution from where it was.
Each move trigger with rev/count will determine which direction and how far to move.
__________________
B.Pedersen
if you are going to assume, assume you're wrong.
  Reply With Quote
Old June 17th, 2021, 03:00 PM   #14
ThreatLevelMidnight
Member
United States

ThreatLevelMidnight is offline
 
Join Date: Apr 2020
Location: USA
Posts: 31
Quote:
Originally Posted by roxusa View Post
Looking through the Sure servo manual I think to change direction in Incremental you would also have to change a direction parameter each move in a different direction. There is no forward/reverse except for jog. Using absolute if your position move was 2 revs +5000 (2-1/2 revolutions) it would move one way (original program direction)and if your next move was 1 rev + 5000 it would back up 1 revolution from where it was.
Each move trigger with rev/count will determine which direction and how far to move.
Perhaps I had the 2 mixed up. I will re-read. I thought in absolute mode, I would need to return to home position every time. That will work, just a less efficient cycle.
  Reply With Quote
Old June 17th, 2021, 03:26 PM   #15
roxusa
Lifetime Supporting Member
United States

roxusa is offline
 
Join Date: Nov 2008
Location: NJ
Posts: 893
Absolute just references once and as long as power is left on it will calculate all moves from home position. in absolute if you trigger a move of 10 revs it will move 10 revs
(direction determined by initial setup) then next move is 20 revs it will only move 10 more
revs to be at 20 revs. in incremental it would move 10 revs on the first trigger and then 20 more on the second trigger and be at 30 revs
__________________
B.Pedersen
if you are going to assume, assume you're wrong.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
PanelView Program Password protecting itself?!? LoganB LIVE PLC Questions And Answers 8 July 21st, 2017 08:07 AM
Help me make this program more efficient. Issues with detecting sensors for... Brandon_K LIVE PLC Questions And Answers 7 September 11th, 2016 10:36 AM
Trouble with Symax50 Reading entire program from CPUI hope you folks can help us figu NewsGazoo LIVE PLC Questions And Answers 12 November 12th, 2013 10:34 AM
Need Help with Omron Servo Control humberstudent LIVE PLC Questions And Answers 2 June 29th, 2009 04:03 PM
Motion Challenge/Problem davidg68124 LIVE PLC Questions And Answers 21 May 29th, 2008 02:07 PM


All times are GMT -4. The time now is 06:02 PM.


.