lamboom

A simple tutorial .smc2 project program for motion control (1) G5 servo

21 posts in this topic

hI.. I've asked for this in the past and, so far, haven't been very lucky.  Most of the projects I run into have 4 or 5 axis, lots of analog and sensor input.. or don't have the HMI part of the "Machine"

I have a nice NJ 101-1000 with the NA 7 inch HMI.. along with a R88BD-KNA5L-ECT servo and a 50W  G5 motor.. type  R88M-K05030H-S2.  All On a nice rack with power supplies and some EtherCAT I/O  (It all functions .. even "MC Test Run" gets the motor to jog .. :-)   But.. no way to "home" it....

The motor is in "rotary mode"   but... it's NOT got an Absolute encoder.. it's a incremental... sniff!     I just want it to stop on zero ..Or anywhere, and call it zero ... and make moves plus an' minus in degrees, that's all....  I assume I have to send it some signal (push button) while it's spinning that tells it it's in "Proximity" to home and it then it does something which makes it end up on zero.    I've homed a lot of linear motors (LinMot) an' they are very easy to work with.    But, Omron has 10 different homing modes .. and they aren't very well explained.  Well, they aren't explained at all in that 502 page user manual... you have to already know how to do it, in order to understand the explanation... Example:  Take the "Home Proximity Input Signal"  .. I can imagine what it might do, to help control a move to home.  I can even imagine what's making the signal .. and that somewhere there is a place where the homing parameters are set... like the "axis setting table"  .. but, it's not a Global Variable, or a Data Type .. I could imagine it gets into the system from the CN1 I/O connector? or some I/O somewhere?

But.. I grow weary of imagining how this system actually works..  Building a simple working project, from a tutorial, or even downloading a simple working project (.smc2 file) and making the minor adjustments to fit my equipment ... would make all the difference in the world.   I've searched Omron's Libraries of .smc2 files.  Haven't found any yet that aren't on the level of "Top Gun" (a seriously complicated project for a 1-week training class) ... Oh there are several.. related to IAG object files .. but those Library files are not "working projects" intended to serve as a Tutorial.. they are limited projects, ready to be configured with IAG Object files, and "your" programming ... So that you can write the programs you need "faster"... which is nice... but, no help here.

Somewhere out there.. is a nice simple .smc2 project file where you get to control a simple motor from the HMI  ..Preferably using an NJ CPU and a NA HMI .. home the motor.. jog the motor and input a few "go-to" positions... sigh!..   Like you would do in a One or Two Day class...   This kind of thing should be already be available in the Sysmac Library ... Thanks much for listening..  sorry about the rant.

 

Edited by lamboom

Share this post


Link to post
Share on other sites

Not a rant!

Example NJ/NX and NA programs to get one started/onboard with the latest OMRON machine controllers is sorely lacking.

Lotsa You-Tube training videos are good but nothing compared to the ability to download a REAL working example program would be of great benefit.
 

Love the new Sysmac Studio platform but real program/WELL documented examples would be great to move this platform forward!!!

1 person likes this

Share this post


Link to post
Share on other sites

Bit N Bytes  ..Thanks for the reply .. I was worried it was just me .. well... It still could be just me.  Most normal people take the Omron classes  ..  But, I thought "how hard could it be!.. :-)

Well...  it shouldn't be this hard.. I've managed to learn Siemens S7 1200 series systems, Red Lion G3 HMI's, Delta Motion Motion controllers and many of the LinMot linear motors and servos.  I could be mistaken ('cause I'm a nube) but Omron seems way too complicated .. and has way too many manuals...  you read one of their manuals.. and every other sentence is a reference to another manual! .. how are you supposed to stay on track .. if you are constantly bouncing from one manual to another...  sorry... more ranting.

Share this post


Link to post
Share on other sites

So, did you managed to do the Homing?

Share this post


Link to post
Share on other sites

innoaloe -  Good to hear from you ... I'm glad you are checking the posts on this forum .. no idea how to send personal messages here.. as you can do on PLCs.net...   The whole point of this exercise is to wiggle the R5 motor like it was a linear motor .. never need to move more than 180 degrees plus or minus from zero..  just to demonstrate the NJ's ability to sum 10 sine waves of selected amplitude and frequency while slowly drifting the relative phases .. just a test of a structured text program, similar to what you proposed in my "Big Tricky Omron NJ Question" post.   The trick is to get the motor to go to "home" ... and... to answer your question... Nope ... not yet .... :-)     But, that's the fun isn't it?

Share this post


Link to post
Share on other sites

Iamboom,

I can write up a quick program. 

1 person likes this

Share this post


Link to post
Share on other sites

Michael ... that would be awesome!   I assume I'll need CN-1 I/O connection on the R88D-KNA5L-ECT for simulating the Home Proximity Signal?  ..  or is that better done using the GX-MD1611 I/O's ?    Thanks millions!   Regards, Michael

Share this post


Link to post
Share on other sites

Well, the code that I wrote assumes that you will use the absolute encoder functionality of the 1S servo.  All 1S servos can use this.  The code below will define the zero point as wherever the servo is positioned when you execute the MC_Home command.  The absolute encoder will remember its home position even when the servo is powered off.  I am not able to test this with real hardware at this point, so I am not sure if this saves the offset for the absolute encoder through a power off condition.  Perhaps you can verify that for me.

 

If you must use the encoder as an incremental encoder and do origin searches, then we can talk about that more.

1 person likes this

Share this post


Link to post
Share on other sites

Thanks Michael ... I've loaded your project and .. thanks for using the NJ101-1000.. :-)   had to change the drive to R88D-KNA5L-ECT which is controlling a 50Watt G5 motor.  Is that a 1S motor?     The project is very basic.. I especially like that..  but, no global variables!  GADZOOKS!  that's almost too easy ..  I do have to create a project on the NA, would prefer to run it that way.. I've installed an IAG file:

Machine.iag

just the servo monitor part

Would like to try and use it .. will add a FB for jogging too.. if I can.  All of the variables are internal .. which suggests I/O's .. I think I will try and create some Globals, and the HMI with the IAG .. you will certainly hear from me if I fail.. and if I succeed... Thanks again....589e4dd783fb3_ServoCodebasic.jpg.dd09a28

Edited by lamboom

Share this post


Link to post
Share on other sites
On 2/10/2017 at 11:47 AM, Michael Walsh said:

 

Michael-  Sorry I didn't remember your comment about the incremental motor..  you did say this project was for the absolute encoder... I didn't know what it had until just before I sent you a message.  I would like to talk about the options for using "incremental"... the end position isn't so important ... it could home anywhere...  I just need a "initial position".. called zero .. that the motor could move CW and CCW from a streaming solution of a random position signal.. which is the summation of many sine waves.

Edited by lamboom

Share this post


Link to post
Share on other sites

Ah, I see that I missed the part about it being a G5.  Sorry.  Yes, you can set up the homing routine on the page shown below of the axis settings.  As you can see, it illustrates what the servo motor will do during the home search routine.  It shows three cases:  when your servo starts on the negative side of the prox switch, when it starts on the prox switch and when it starts on the positive side of the prox switch.

i0ugAAAABJRU5ErkJggg==

I just picked the settings shown above arbitrarily. 

Share this post


Link to post
Share on other sites

Michael - Thanks again.. you have made it very clear.  The Manual (W507-E1-14) does a reasonably good job with the homing of an Absolute G5 .. I suspected I could use the Home Proximity (toggle switch) .. click it while the motor was searching... then it would go to where ever the z-pulse was.. an I would call that Home.   But I didn't see any place to put the proximity signal .. Your comment in the ladder program .. basically said the home position would be where ever the motor was when powered on...     Which is fine... :-)   I just didn't appreciate how to use the "home proximity signal" .. if I wanted too  (kinda still don't understand how to use it)    Does that "input" show up on the input side of the "Home" function block .. If you chose something other homing mode?       Because, I just don't see where the "signal" connects to the Function block for homing .. or... perhaps it doesn't .. it connects to the servo drive?... hmmmmmm.

Edited by lamboom

Share this post


Link to post
Share on other sites

The code that I provided defines the home position as wherever the servo is when you turn on the Zero_Servo bit in the code.  If you need to do an origin search routine with a proximity switch, then it would wire into the CN1 connector on the G5 servo drive.  If you just need to find the Z-Phase and stop, that would not require a proximity switch, just set it up like this:

8v7BzEwRBEARBEARBEETdRan+P1+GzxRMOuDkAAA

1 person likes this

Share this post


Link to post
Share on other sites

Hey that was my IAG!... hehehe

1 person likes this

Share this post


Link to post
Share on other sites

OK... I'll have to send you both pizza!

Share this post


Link to post
Share on other sites

  Hi Michael ...  Having a great time building the HMI and CrossBow's IAG objects... :-)   Added Jogging an' the Start Moving button .. and linking everything I can to CrossBow's lamps

Started to synchronize an' install into my system.. and, shock and horror ! ... your project is V1.13 ...  an' my Nj is V1.1 ... hmmmm...     Now that we're on that subject.. I've never been able to understand what's going on with the version selection when creating a project...   ...  I changed the version to 1.1   .. Still wondering what the point of the project version setting is..  Seems like .. Sysmac ought to know what the version of all the devices is .. and automatically adjust what ever it needs to be able to work with them....

Edited by lamboom

Share this post


Link to post
Share on other sites

Some functions / features are not available on previous versions of the hardware.  When you connect, it does tell you that you have selected the improper version of the processor, but it does not assume that you want to convert the project (and therefore does not do it automatically).  It could be possible that you simply connected to the wrong NJ. 

1 person likes this

Share this post


Link to post
Share on other sites

Michael- Thanks for the info

Someday.. I may have the guts to attempt a firmware upgrade of the Nj101 -1000  .. I hope it will be good enough to test the final project for what I need.

 

Edited by lamboom

Share this post


Link to post
Share on other sites

Firmware upgrades are not difficult.  They sell a memory card with the files already loaded and ready to go.

Share this post


Link to post
Share on other sites

Crossbow ... yes... I've read about that.. then they recommend that a Omron engineer comes out to your factory and does the upgrade for you .. because if you screw up.. you now have a nice doorstop ..or "brick"  which is what they used to call a failed BIOS update... on a PC     :-)

Share this post


Link to post
Share on other sites

Yes, that is completely true.  No different than other vendors though, so not really something unique to Omron.  I've seen firmware upgrades on AB and Modicon make bricks too.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now