Machsupport Forum

Third party software and hardware support forums. => CS-Lab => Topic started by: LM941 on January 16, 2016, 07:38:00 PM

Title: CSMIO-ENC Spindle Orientation
Post by: LM941 on January 16, 2016, 07:38:00 PM
Trying to orient the spindle for tool changes.

CSMIO/IP-A, CSMIO-IO, CSMIO-ENC

Check box in "Align at stop" of csmio plugin is enabled. Spindle encoder is connected to ENC module. RPM and spindle orientation show in monitor.

Machine is Bridgeport VMC 760/22 with Siemens 911 drive control, analog +-10

Anyone know how this function in CSMIO-ENC works? Just found today that M19 exists but not at machine to try or see if it needs macro code.

I can read the position with a macro but the spindle needs to be < 5 rpms to catch 0(zero) degrees reliably.

First post on forum. New to Mach3 and CS-Lab controllers. All the retrofit has gone amazingly smooth and then this silly spindle orientation smacks me.

Thanks for any help..




Sent from my iPhone using Tapatalk
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Hood on January 17, 2016, 05:43:29 AM
Never tried it on the Chiron which is the machine with the IP-A as I do not need to orient the spindle for tool changes.

I did use it on the wee lathe to stop the spindle at the correct position for the chuck key and it worked well. The wee lathe however had an IP-S.

All I had to do was enter a value in the angle box and enable the option, no macro required.

If I get a chance and more importantly remember I will test it out on the Chiron when I get back to the workshop tomorrow.

Hood
Title: Re: CSMIO-ENC Spindle Orientation
Post by: LM941 on January 17, 2016, 12:37:58 PM
Thanks Hood! I have been reading your posts for the past month and you have helped tremendously with my questions during this project.

The encoder is off a 1:1 pulley with 1024 count. CSMIO was reporting 4 revolutions for 1 actual revolution so I had to set P/Rev to 4096 to sync. Not sure why this encoder has such low resolution unless controls in 1995 couldn't keep up at 6000 rpms?

Before purchasing the ENC module, I had the encoder connected to Channel 3 of CSMIO/IP-A.  The config screen (attached jpg) does not allow any Channel option for ENC-1 encoder port. I can only assume the plugin does it automatically. Besides it not stopping at angle set, there are some other odd things like Mach3 GUI speed controls doing nothing but S codes do.  RPM dro is being updated fine.

One area that might be problematic is the Mach3 [Spindle CW F5] button controls a relay that opens the SimoDrive 611 Spindle control enable signal,  immediately stopping the spindle and disabling (required for tool unclamping).   I am not sure how long CSMIO-ENC needs to orient it and if it is disabled too fast.  I have tried overriding the spindle enable but it didn't seem to resolve it.

http://www.machsupport.com/software/plugins/  - shows ENC in plugin list but the link is no good.  I hope this isn't me just missing a plugin. I have found nothing related to a separate ENC plugin on cs-lab website.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Hood on January 17, 2016, 01:34:41 PM
Ok, just wondering if the demo version of Mach may have something to do with it.

Yes, encoder pulses per rev are 4x the encoder line count and yes, that is the reason machines of that vintage had low count encoders.

Enc1 input is dedicated to the spindle encoder, the other ports are dedicated to DROs so you can use them for other purposes, for example I use the second channel on the Enc module for a glass scale on my tool height setter.

You might have the problem with the disable set up that way, in fact if I understand the way it is working then I am certain it wont work.
The CSMIO needs to slow the spindle to a stop and then find the Index, occasionally I saw my spindle do almost a full revolution after it had basically stopped.

Hood
Title: Re: CSMIO-ENC Spindle Orientation
Post by: LM941 on January 17, 2016, 02:12:25 PM
That's funny you noticed the Demo in the title. I hadn't.  We bought the Mach3 License from CS-Labs and I went through the install of the plugin without paying attention to the Mach3 install. Had downloaded previous to play with and never got any nag screen. Definitely need to clear that up and be sure it is not causing any issue.  

I am am using brains to control that spindle enable output so maybe I can use some delay.  Brains are another subject of head scratching.  CS-Labs documentation on the ModBus integration is sparse.  I tried using some brain terminators to control a CSMIO output via ModBus but gave up and just configured the output through Mach3 ports and pins.

Heading to try some spindle disable delays and will let you know.  Thanks again.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Hood on January 17, 2016, 02:20:18 PM
I prefer the macropump to Brains although if you have a lot of stuff in there Brains can be better as you can have many small brains where you can only have one macropump.

Hood
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Hood on January 17, 2016, 02:21:19 PM
Oh and as far as the licence, you should have a file called Mach1Lic.dat, make sure that is in the main Mach3 directory. If it came zipped then you will need to unzip it.
Hood
Title: Re: CSMIO-ENC Spindle Orientation
Post by: LM941 on January 18, 2016, 08:57:17 AM
Hood, is your machine that aligns spindle at stop using the DAC axis output or the other analog outputs?
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Hood on January 18, 2016, 02:22:33 PM
The lathe had the IP-S on it and the spindle was a Step/Dir servo.
Originally the servo drive used the analogue  0-10v output because at the time there was no way of using a Step/Dir spindle, however I didn't have or try the orientation when it was set up that way.

Today I tried the orientation on the Chiron which uses the IP-A controller but it didn't work very well, that may be due to the interpolation and division I have set up in the servo drive for the encoder outputs.
 I ran out of time or I would have had a look to see what I have set in the servo drive.

Will try and get a look in the next few days.

Hood
Title: Re: CSMIO-ENC Spindle Orientation
Post by: LM941 on January 18, 2016, 03:40:38 PM
Thanks,  I spent more time today on the spindle and have some more observations and discoveries.  Between Mach3 and CSMIO plugin the settings seem infinite. The CSMIO/IP-A manual did a pretty good job with help tuning the PID for the XYZ axis but not much on spindle PID tuning.  The screen shots in manual don't match plugin screens. Calibrating the spindle to get RPMs matching S command was a lot of trial and error. I played with the Mach3 Calibrate spindle function and then read here many saying it doesn't work. It shows PID of P=0.25, I=1, D=0.3. I can't set the CSMIO spindle PID, P less than 5.  No idea what PID to even start with in CSMIO spindle PID settings.

Attached are the best settings I got so far for Spindle to work ok as far as CW, CCW and RPM control. Once I make the PID Regulator - Open Loop in CSMIO plugin, the Align at stop option is disabled.

I made an M19 (spindle orient) macro and it kinda works if I run spindle at S2 and use GetInput (84) to look for angle Zero (where my tool changer wants it). It does not seem to be able to read the encoder input fast enough to be on target all the time. Wish they had a command to OrientSpindle(x) where x was angle.

Frustrating part is I think the Siemens 611 spindle drive Simodrive has the ability to stop at oriented angle but I thought the ENC would be easier  ::)

https://cache.industry.siemens.com/dl/files/160/98209160/att_2547/v1/IAA_1000_en.pdf
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Hood on January 18, 2016, 05:11:21 PM
I am not sure if the PID settings in Mach will do anything at all, I would imagine it is all in the plugin.
Below is a screenshot of my spindle page, afraid I don't have a pic of the PID settings though.

What I actually did was used the autotune to get the spindle close and then tweaked from there.
As the spindle does not have an autotune I just set it up as an axis and then once done disabled the axis and entered the settings manually in the spindle page.

Not sure if that is possible with yours or not as I am not sure if yours is a servo or not.
Hood
Title: Re: CSMIO-ENC Spindle Orientation
Post by: LM941 on January 18, 2016, 06:05:11 PM
Did you move the encoder wires over to the CSMIO/IP or were you able to select the ENC encoder channel? It would be easy to just move the ENC terminal block if they had made the pinouts the same..
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Hood on January 18, 2016, 06:37:31 PM
I use the motors encoder for feedback.
It is a sine/cosine encoder  it goes to the servo drive I then take the Servo Drives encoder outputs and ,if I recall correctly,  feed them to the IP-A and then just jumper them across to the Enc module.

Hood
Title: Re: CSMIO-ENC Spindle Orientation
Post by: LM941 on January 18, 2016, 06:43:47 PM
ah ok.. I may try that to auto-tune and get the PID close.  Thanks
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Hood on January 18, 2016, 06:46:02 PM
Do you not have it that way already?
I know you have Closed Loop disabled but did you not have it enabled before?
Think if you have closed loop chosen you will need feedback to the IP-A, could be wrong though.
Hood
Title: Re: CSMIO-ENC Spindle Orientation
Post by: LM941 on January 18, 2016, 07:45:38 PM
Yes I had tried this as closed loop throughout this. I was seeing weird things with M3 M4 not working and kept trying many settings. It seems that certain settings like Spindle Pulley don't take effect until you restart Mach3 but I can't be sure. There were times I restart Mach3 and the motor control would act different. It has always bothered me that the Plugin Spindle Axis config screen has the "Encoder Input Channel" I used when the encoder was connected to the CSMIO/IP-A.  I assumed once I got the CSMIO-ENC and moved the encoder to it's Channel 1 input, that setting would have an option for the ENC channel, but it doesn't.  I had considered doing what you mentioned and jumpering the two encoder inputs of the IP-A and ENC in parallel but was concerned about creating signal problems.

This is my spindle encoder
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Hood on January 19, 2016, 03:28:41 AM
That encoder should work fine.
Hood
Title: Re: CSMIO-ENC Spindle Orientation
Post by: LM941 on January 21, 2016, 05:59:03 PM
I could not get the CSMIO-ENC option to "Align at stop" to work. I moved the spindle encoder to an axis encoder input, configured it as an Axis and it did autotuning the PID. It worked fine.  I put those settings in the PID settings for the CSMIO plugin/spindle section and the spindle just revs up to very high speeds when it should be 0 RPM.  I am sure the encoder is fine and wired correct because the ENC plugin monitor shows correct angle movements and correct RPMs.

Asked CS-Labs how to tune the PID on monday and still no response.  My ENC firmware version = 1.02  I was curious how that gets updated? When you update the CSMIO/IP? I see no separate firmware downloads for ENC on CS website.  I ended up using a macro to read the ENC angle value to orient it manually.  

Youtube of ATC dry run with spindle orienting. Have to slow way down to catch angle data from CSMIO-ENC -- GetInput(84).  
https://www.youtube.com/watch?v=TZEntieCl_Q

Youtube of the tool change, sorry the air compressor is so loud..
https://www.youtube.com/watch?v=9PaKyMAdqDM

Thanks for all the help, Hood
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Hood on January 22, 2016, 04:36:17 PM
So you are saying the spindle runs away at full speed with the values you had for when an axis?

Did you set the pulses per rev accordingly?
Do you have the encoder direction set the right way, ie does it help if you choose the Inverse option?

I think the modules get updated from the firmware you download for the main controller, been a while since I have seen them update but occasionally they will when I load new firmware.

Looks to be working good :)
Hood
Title: Re: CSMIO-ENC Spindle Orientation
Post by: LM941 on January 22, 2016, 05:07:29 PM
Yes, it runs away.. pulses set correct.. encoder direction based on + RPM properly displayed.. 

I got a very detailed email on this from CS-Labs this morning.  Quite a bit of effort to outline the settings/issues that hopefully they put on their website.

Couple big items were:

1. They said the encoder from the motor itself needs to go to CSMIO/IP-A, the encoder off the pulley 1:1, goes to the CSMIO-ENC.  This won't work for me because the actual motor encoder is connected to the Siemens 611 drive controller.  I don't want to take it off that.

2. They said "Align at Stop" is not for tool magazines. It is intended for lathes.

I will leave it as it is with the Macro orienting the spindle for tool change.  They gave me another macro technique using plug in calls I may try.  NotifyPlugins() which I hadn't used or known about.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Hood on January 22, 2016, 05:13:01 PM
Ok but you could still try the invert option to see, only a click in a box.

I only use the encoder outputs from my servo drive, I only have the motors encoder. What I do is have the outputs from drive go to IP-A then have them jumpered across to the Enc module, seems to work fine for everything except the Spindle Align. I am wondering if it has something to do with the drives outputs as my actual encoder is sine/cosine so doesnt have an index pulse as such.

Hood
Title: CSMIO-ENC Spindle Orientation
Post by: LM941 on January 23, 2016, 09:33:32 AM
I did that too, jumpered A B I , but from spindle pulley encoder to both IP-A and ENC.  Didn't help the PID issue. Don't have an explanation why they want motor encoder. Never connected the spindle enable in plugin cause between brains and macros, it's already a puzzle. I should write something up as a heads up with brains and macros commingling. 

(http://uploads.tapatalk-cdn.com/20160123/3585cac86c3f518ab2e4ff9a13f92803.jpg)


Sent from my iPhone using Tapatalk
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Hood on January 23, 2016, 04:33:05 PM
I think what they are meaning is normally you will have 2 encoders unless the motor is direct drive as in my case. So that way I can use the encoder for both.
As said however my actual encoder is not suitable as it is sine/cosine but as my servo drive can be set to send out interpolated encoder signals rather than just passing them out it works fine.
Although the Orient isn't working. Whether that is the drives output or the IP-A that is at fault I am not sure. I suspect it may be the drive as I looked at the drive in its software and I never saw the Index pulse change, it was constantly on. That stands to reason as there is no index pulse on the encoder with it being a Sine/Cosine encoder, I however thought the drive would manufacture one, maybe it is not correct, I will have to haul out the scope one day and see.

Main thing is you have it working by other means.
Hood
Title: Re: CSMIO-ENC Spindle Orientation
Post by: TPS on January 09, 2018, 09:02:44 AM
Hello LM941,

did you ever get the spindle orientation running ?
i am in the same Situation now.

Thank You Thomas.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: lion_rapid on August 31, 2018, 04:44:38 PM
I made it working, so if someone needs help, let me know.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: TPS on September 01, 2018, 05:39:14 AM
hi Lion_rapid,

would be great, if can post your solution.
Thank You.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: lion_rapid on September 01, 2018, 07:52:43 AM
I'm retrofitting: Sugino Self-center V8
Original computer: CNC-300G made by Horyu Engineering
Drives: Horyu Engineering
Motors: Sanyo Denki BL Super, those motors are equipped with absolute encoders (probably)
Encoders are connected directly to the drives. Those drives have encoder outputs A/B/I for the CNC control.
The spindle has only one encoder, i did connect it to the A-axis input and bridged it to the CSMIO-ENC first encoder input.
Firstly I had the -ENC module disconnected and the spindle configured in open loop, checked and adjusted the V/rpm curve.
Then I changed the configuration to "Enable spindle axis" and adjusted the closed loop PID.
Meanwhile I had to find out how many pulses per one rev I have.
Then I connected the -ENC module and activated the Align at stop function.
After M3/4 Sxx command M5 causes spindle to stop at that given angle.
You need to have an encoder with "I" signal one time per one rev.

If any more info (screenshots, etc) are needed please let me know.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: TPS on September 02, 2018, 05:56:40 AM
is your spindle step/dir driven or 0-10V?
 
Title: Re: CSMIO-ENC Spindle Orientation
Post by: lion_rapid on September 02, 2018, 11:34:00 AM
0-10V
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on April 24, 2019, 09:58:34 AM
Hi all,

I am at this same point practically = i want to add a 4th axis to my mill, it will be driven at 1:1 with a servo motor.

CSL are pretty adamant i must have two encoders - one on the motor and one on the spindle, if i'm at 1:1 ratio this seems pointless.

Having read this thread, my thoughts regarding paralleling the drive encoder outputs between IP/A and ENC modules seem to indicate that it will actually work ok??

ope i read that right as fitting another encoder will be difficult. I would have thought CSL could have put a tick-box in the setup so that "Use motor encoder if at 1:1 ratio" could be achieved internally.

I have asked them several times why not and they seem unwilling to answer.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: TPS on April 24, 2019, 12:03:34 PM
i have also linked my Encoder Output from spindle servo to c axis and ENC module.
but i am doing the spindle orientation (for the ATC) on the servo drive, this is enabled
by a digital Input on the servo and reported back by a digital Output from the servo.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on April 24, 2019, 12:15:28 PM
So using the encoder signal twice does actually work?

From the vague replies i get from CSL its not to be done at any cost ;) But i guess maybe that would affect sales of ENC modules ??

I will be trying this, my encoder will also be sharing the ENC channel1 input between main spindle and 4th axis spindle, i won't be doing dual spindle stuff so its either one or the other. I'll do the switching with a 74LS257BN quad channel, dual input switch IC, could have used relays but thats messy i think.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: lion_rapid on July 13, 2019, 05:13:55 PM
Yes, you can parallel the signal. Works on my setup.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on July 14, 2019, 02:20:03 AM
Yes I can confirm it does works very well, for threading at least.

I still can't get spindle orientation to work properly - it does stop at a location, it will creep back to a location if needed, trouble is that the location it chooses is not the same each time?

Yes the encoder is 1:1 with the spindle and threading does work very well.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: lion_rapid on July 14, 2019, 04:44:50 AM
Do you have an index signal in your spindle encoder?
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on July 14, 2019, 05:07:37 AM
Yes, it uses the index for threading sync as far as i know.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: lion_rapid on July 14, 2019, 05:08:36 AM
So threading works, but orienting the spindle doesn't?
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on July 14, 2019, 05:12:38 AM
Yep thats it.

No error messages, it will creep to a stop each time but that stop is different :)
Title: Re: CSMIO-ENC Spindle Orientation
Post by: lion_rapid on July 14, 2019, 05:14:33 AM
Which way do you orient the spindle? By setting in the plugin or M20?
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on July 14, 2019, 05:18:47 AM
Only tried the plugin, didn't know about M20?
Title: Re: CSMIO-ENC Spindle Orientation
Post by: lion_rapid on July 14, 2019, 05:23:59 AM
M20 - https://en.cs-lab.eu/technical-support/download/addons-macros/macro-m20-for-spindle-positioning/ (https://en.cs-lab.eu/technical-support/download/addons-macros/macro-m20-for-spindle-positioning/)

But if your spindle doesn't orient properly, then it looks like missing index signal (did you check it with oscilloscope?) or (less likely) pulses per rev set to low.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on July 14, 2019, 05:30:23 AM
Thanks,

if its not set right can it still work?

The spindle runs ok, the speed shown on Mach3 is correct, threading works ok - can all of that be good and still something not be set right for orientation?
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on July 14, 2019, 06:18:42 AM
Just tried the M20 macro.

Just entered M20 Q100 repeatedly.

It makes the spindle move, but it stops in a different position every time.

It also shows error ""M20 ERROR Offset !!!  Angle = *********.xx Qarg 100

Something not right?
Title: Re: CSMIO-ENC Spindle Orientation
Post by: lion_rapid on July 14, 2019, 06:25:35 AM
Thanks,

if its not set right can it still work?

The spindle runs ok, the speed shown on Mach3 is correct, threading works ok - can all of that be good and still something not be set right for orientation?
Yes, the fact that your spindle doesn't orient properly means there is a problem with index signal.
M20 won't work either.
1. check with oscilloscope for the index signal
2. check how many pulses per rev your encoder has.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on July 14, 2019, 06:28:20 AM
But can threading work with dodgy index?

The encoders are 10,000 pulse items (all edges)
Title: Re: CSMIO-ENC Spindle Orientation
Post by: lion_rapid on July 14, 2019, 06:36:24 AM
I marked orange fields where you should have 10000 pulses entered.
"Enable spindle axis" and "Align at stop" must be enabled.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on July 14, 2019, 06:38:04 AM
Thanks, i'll check that

I'm pretty certain box boxes have 10,000 in them but i know the stop is turned off, will try with it on.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: lion_rapid on July 14, 2019, 07:18:47 AM
I've looked in the M20 macro and it throws you an error "M20 ERROR Offset !!!  Angle = " because it doesn't read the angle properly.
I still think there is a problem with index signal. The plugin doesn't know where is "zero" point of the spindle, so he doesn't know where to start counting requested angle.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on July 14, 2019, 07:21:45 AM
Interesting, i'll have to get the 'scope out again some time.

Now i think about it, there are some notes in the drive manual about the index pulse being short so they included an open collector output as well - presumably the pulse is longer?

Maybe i need to remove the main index pulse input and use the O/c index pulse instead somehow?

Quote...
5. Encoder Z signal open collector output
Servo drives to open collector mode on the output signal of the encoder Z. Because Z letter feel the pulse width is narrower, PC
please use high-speed photoelectric coupler receiving.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on July 14, 2019, 07:29:32 AM
Second thoughts - cant do that because ENC module needs differential input not single-ended.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: lion_rapid on July 14, 2019, 07:40:00 AM
Page 18 of  CSMIO IP-A user manual:
"The encoder   inputs   of   CSMIO/IP-A require differential signal. If connect-ed  encoder  has  a  common  output    then  you  should  use  special  convert-er.  Connection  of  A-,  B-,  I-  to  GND  causes axis position will be distorted.  "

Page 4 of CSMIO ENC user manual:
"The   encoder needs   to   have   5V   differential outputs."
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on July 14, 2019, 07:46:53 AM
Yes thats why the open collector output won't work, it will need a line-driver as well to create a differential signal.

The signals i am using are differential already.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on July 23, 2019, 06:01:21 AM
No luck at all getting this to work, i asked CSL and got this reply...

Quote
Construction:
a.      M20 macro for spindle positioning can only be used if the spindle is driven by a servo drive that works in position mode (never in opened position loop).
b.      If there's gear between a servo motor and a spindle, then it has to be non-slip gear, e.g. toothed belt used.
c.      The encoder for revs and spindle angle reading must be installed directly on a spindle or through the non-slip gear (e.g. the tootled belt) , with ratio 1:1.
d.      The encoder for revs and spindle angle reading can only be connected to CSMIO-ENC module.
The encode signals can't be used for any other purposes as it will be overloaded this way (it's a common issue).
 
Settings:
a.      Using M20 macro for spindle positioning, you can't use „Align at stop” function at the same time (plugin „Spindle” tab) and reversely.
b.      If there is gear between a servo motor and a spindle, then the gear ration should be set in Mach3 in the „Spindle Pulleys” tab (1:1 by default).
c.      Set the „Spindle Pulses / Revolution”  value in the plugin „Spindle” tab:
The „Spindle Pulses / Revolution” value is encoder pulses number incl. all four edges and the electronic gear in a servo drive (if used).
 
The M20 macro verifies the set and real position after spindle positioning.
If the difference between those two values is higher than „Const Offset = 1” parameter value, the „M20 ERROR Offset !!!„ error will appear.
The „Const Offset” value can be reasonably adjusted to our needs (the value of 1 is usually optimal).

 Now the only part i have wrong is that i am sharing the encoder between main controller and ENC module - could that be it??
Title: Re: CSMIO-ENC Spindle Orientation
Post by: lion_rapid on July 23, 2019, 07:43:24 AM
I have such bridge connection between CSMIO-IP/A and ENC module and my spindle works fine on M20 macro (Toothed belt 1:1 ratio between motor and spindle, encoder on the motor).

Did you fix your index signal? Without it it won't work.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on July 23, 2019, 07:54:42 AM
Thats the thing- if the index was failing it wouldn't thread ok - but it does, very nicely in fact.

Not sure what else i can do with it at present, really don't want to have to fit another encoder, probably not worth it just for alignment.

As far as i know it's the index that resets the angle counter and that seems pretty happy???
Title: Re: CSMIO-ENC Spindle Orientation
Post by: lion_rapid on July 23, 2019, 07:56:45 AM
Could you disconnect the index signal from controller and enc module and check whether threading  still works?
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on July 23, 2019, 07:58:52 AM
I can try that, possibly be in the morning though. See how work goes this afternoon ;)
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on July 24, 2019, 06:07:06 AM
Could you disconnect the index signal from controller and enc module and check whether threading  still works?

Ok, pulled the index from the ENC module and threading still worked - the thread-sync LED in mach came on as normal and the code ran ok.

I pulled the index from the main controller and nothing worked very well, spindle still ran but tried an M20 and the controller just hung, had to estop and close Mach to get out.

Seems all the ENC module is doing at present is spindle speed display??
Title: Re: CSMIO-ENC Spindle Orientation
Post by: lion_rapid on July 24, 2019, 06:23:05 AM
Threading didn't work when you pulled out the index signal from ENC and IP-A?
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on July 24, 2019, 06:55:11 AM
Nope
Title: Re: CSMIO-ENC Spindle Orientation
Post by: lion_rapid on July 24, 2019, 08:25:25 AM
When it's connected and you try M20 Q140, what sort of error do you receive?
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on July 24, 2019, 08:32:54 AM
I get the angle error!! message plus seemingly random angles, i did some repeats and got these...

I used M20 Q100

The Q-Arg response was always 100

The error offsets in order were…

1 - 284.9
2 - 109.6
3 - 119.2
4 - 138.5
5 - 177.1
6 - 254.1
7 - 48.3
8 - 356.3
9 - 253.1
10 - 46.2
11 - 352.5
12 - 245
Title: Re: CSMIO-ENC Spindle Orientation
Post by: lion_rapid on July 24, 2019, 11:49:38 AM
Did you tune PID in the spindle setup?
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on July 24, 2019, 12:38:04 PM
As good as i could, it runs best with just a P value, no I or D.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: lion_rapid on July 24, 2019, 06:12:17 PM
Are you also sure of the number of pulses per rev? (all edges counted)?
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on July 25, 2019, 04:05:41 AM
Yes, 10,000, all edges.

 :)
Title: Re: CSMIO-ENC Spindle Orientation
Post by: lion_rapid on July 25, 2019, 04:41:31 AM
Could you post screenshots of your configuration?
To which channel in the ENC module you have the encoder connected? (pic perhaps?)
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on July 25, 2019, 04:50:27 AM
Hi

spindle is connected to ENC channel 1 as per CSL instructions.

Not sure what pics you need, there are many options?
Title: Re: CSMIO-ENC Spindle Orientation
Post by: lion_rapid on July 25, 2019, 04:53:05 PM
Those screens I'd like to see.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: TPS on July 26, 2019, 01:55:02 AM
so it Looks like you are running your spindle Controller in positionig mode (step/dir), and Dave is running it in Speed follower
(analog Output). In your case the "real" spindle orientation is done by the spindle Controller and CSMIO is only "supervising"
the result.

on a Speed follower the positioning is done by CSMIO witch is very hard (maybe impossible) to tune.
i spend days to try to set it up, and ended up to do the positioning on the spindle Controller itself,
witch is handled by digital I/O.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on July 26, 2019, 05:43:13 AM
Here we go :)
Title: Re: CSMIO-ENC Spindle Orientation
Post by: lion_rapid on July 26, 2019, 09:39:33 AM
My spindle is controlled by 0-10V signal (analog output)
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on July 26, 2019, 09:43:53 AM
All my drives are analogue 10-0-10 or 0-10
Title: Re: CSMIO-ENC Spindle Orientation
Post by: lion_rapid on July 26, 2019, 09:50:29 AM
When you run your spindle at 10% and 80% of maximum speed, what is the current position error and maximum error?
Did you modify in any way M20 macro?
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on July 26, 2019, 09:54:32 AM
M20 is as downloaded, no changes.

IIRC the errors were relatively high, I have spent hours messing with PID values, I can get the values very low BUT it will then creep to a stop or wobble erratically.

The ID values seem very sensitive which is why i left them out, it was the best option.

I did have a thread with details, i'll see if i can track it down.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: lion_rapid on July 26, 2019, 09:58:58 AM
I see that you have KVff set to 0, from my experience it's role is very important.
Did you play with it (values can be like 30 but 200something isn't uncommon)?
Also, when spindle RPM is 0, is it really 0? And what's the position error?
Is the offset voltage properly set? Spindle RPM 0 and clicking the arrow does change anything?
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on July 26, 2019, 10:06:36 AM
I'll have to boot her up to get some figures.

I found any messing with values other than P was generally bad.

DAC offset was set and it is stationery when at 0 speed

I'll get some values when messing with Kvff, most likely in the morning.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on July 27, 2019, 05:30:21 AM
Well, from what i can see it's just crap :)

My guess is that spindle orientation fails because it never reaches dead-band :( It will reach a stop but that stop can be anywhere from -200 to +200 or so in PID tuning.

No amount of messing with values has much effect, in fact its worse since i change the bearings from grease to oil lube, its very low friction and at my previous setting with P=7000 its now started oscillating instead of stopping.

Increasing P above 9000 seems to cause increasingly violent oscillation until it faults out or i hit the red button.

Maybe these servos are just garbage for a spindle?

I have the same drives and motors on my other axes and they all work faultlessly, big difference is friction damping/load.

With the spindle oscillating a gentle touch with the hand will stop it but dead-band is still off.

Its just the generic china servo from AASD - very popular due to price.

I have tried before setting the spindle as an axis the auto-tuning but it fails to get any sensible numbers.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: TPS on July 27, 2019, 05:56:12 AM
a simple way to test wether the Motor Controller itselv is Swinging is to

-put 0V to analog Input
-enable the Controller

-now Motor should standstill

-try now to turn Motor by Hand and see who it will stop if you release the Manual torque

if it starts to swing the Controller itselv is overtuned
if it just stands still Controller tunning is ok
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on July 27, 2019, 06:39:35 AM
Hi

removed the CSMIO connector, shorted the analogue input out and enabled it manually.

The motor was creeping, I tweaked the DAC offset a few mV and got it stationery.

When nudged by hand it was fairly rigid and held its position, no oscillating.

Re-connect CSMIO and it shows a DAC offset of 0.16V spindle is stationery, but still won't stop where its told or take any tuning.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: TPS on July 27, 2019, 07:50:32 AM
ok, that means the Motor Controller tunning is OK.

have you tryed to reduce the spindle acceleration/deceleration in CSMIO plugin Setup ?

6000rpm/s is pretty high.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on July 27, 2019, 07:59:39 AM
Will try that now
 :)
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on July 27, 2019, 08:37:29 AM
Hmm,

I have been conversing a lot with member lion_rapid, great guy as you all are ;)

We have managed to get the spindle tuned now, also I can get orientation to work perfectly in the CSMIO plugin config page. I have it set so I can insert a locking pin into my spindle shaft to allow me to unlock collets etc.

BUT

In M3/M5 and M20 calls orientation fails every time, M20 throws up angle errors every time. Having "stop at position" turned on in config  just makes the spindle stop at random locations every M5 call.

Baffled now - so near but so far away ;)
Title: Re: CSMIO-ENC Spindle Orientation
Post by: TPS on July 27, 2019, 09:13:55 AM
ok did a Little bit of reading about M20.

from the Manual (https://www.en.cs-lab.eu/technical-support/download/addons-macros/macro-m20-for-spindle-positioning/)

1.Settings:
a.Using M20 macro for spindle positioning, you can’t use „Align at stop” function at the same time (plugin „Spindle” tab) and reversely


3. The M20 macro verifies the set and real position after spindle positioning.
If the difference between those two values is higher than „Const Offset = 1” parameter value, the „M20 ERROR Offset !!!„ error will appear.
The „Const Offset” value can be reasonably adjusted to our needs (the value of 1 is usually optimal).


that means you can "Play" (increase) a bit with the

Const Offset = 1

in M20.M1S macro.


btw:
I can get orientation to work perfectly in the CSMIO plugin config page

how did you do this?
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on July 27, 2019, 10:22:36 AM
Yes i read the bit about the M20 and align at stop, i have turned off AOS but M20 still fails.

The get it to work in config all we did was tune the servo better. I have no idea what to look for but lion_rapid did, we went through it on the phone and it runs much better now, apart from this M20 thing.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: TPS on July 27, 2019, 10:55:59 AM
and what angledifference does the M20 errormessage Show?
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on July 27, 2019, 03:44:13 PM
Different error every time, can't see any pattern to it at all.

It's bugging me that it works 100% in the config window, but 0% in Mach3 - makes me think it could be a Mach3 or Interface problem, it wouldn't be the first one  ;)
Title: Re: CSMIO-ENC Spindle Orientation
Post by: TPS on July 28, 2019, 07:14:54 AM
well sounds like it is time to contact CS Lab.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on July 28, 2019, 07:40:25 AM
Yep,
I have an ongoing chat with a guy there, i have forwarded this last bit info to him.

Usually takes a week or two for a reply  :(

At least it proves it can work.
Title: Re: CSMIO-ENC Spindle Orientation
Post by: Davek0974 on October 03, 2019, 06:55:29 AM
CS-LAB have found the issue :)

In the CS-MIO plugin config, under spindle axis, do not use "reversed direction" - there is a firmware bug that stops spindle alignment working :)

I had to untick that box, tick "encoder reversed direction" and also reverse the motor direction inside the servo drive itself.

All working now, very accurate and also with the shared encoder ( i didn't tell them that though ;) )