Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: gallenat0r on February 14, 2013, 10:58:34 AM

Title: Spindle index on Optimum D280x700 Vario Lathe
Post by: gallenat0r on February 14, 2013, 10:58:34 AM
Hello,

After venturing down a blind path with modbus/arduino and an Optimum branded chinese encoder I'm at a stand still.
Well untill I figured out to take the signal from the display on the lathe and feeding that into an input pin on my breakout board.
Problem now is that the STrue value is 4 times the actual rpm, which is because of the sensor receiving 4 signals per rotation.

I thought I could make a brain that just divided the value, but that doesn't seem to be the case.

[Spindle Index]---->[/4]---->[Spindle Index] 

I'm fairly new at this, so I might go the wrong way about it  ???

--
Kind regards,
Jens
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: Hood on February 14, 2013, 01:04:33 PM
You can use the ratio in Spindle Pulleys, you can see that from Config menu.
Hood
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: gallenat0r on February 16, 2013, 05:37:43 AM
It seems to get the right number (sort of).

Using this code to turn a thread:

Code: [Select]
G21
T0 M6 H0
M7 M3
S150
G76 X20.933 Z-10 Q0 P5 H0.1 I27.5 R24 K4 L0 C2 B0.1 T0 J0.1

results in this (thread.png):

(http://thread.png)

I then went a bit back to the chinese encoder using the info you gave me.
I stilll cannot get anything from the Z Z pins but I get reverse proportional values from the A A B B pins (higher rpm = lower value)
The encoder is labeled OIS708-1024/Z3-5LD

--
Kind regards,
Jens
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: Hood on February 16, 2013, 09:23:48 AM
Are you trying to feed the encoder in via Modbus? or do you have some form of plugin?
Are you using the parallel port for axis control?
Hood
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: gallenat0r on February 16, 2013, 09:27:43 AM
I'm feeding Z from the encoder to the spindle index via parallel port 2 pin 15.

--
Kind regards,
Jens Galsgaard
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: gallenat0r on February 16, 2013, 09:32:30 AM
Oh and axis control goes over parallel port 1.
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: Hood on February 16, 2013, 09:33:43 AM
So is it a proper encoder? If so it may be that the index pulse is too short for Mach to see correctly via the parallel port. I use proper encoders but I also use external controllers which can see very short index pulses.
If you attach your xml I will check that out.
One last thing, your code has no start  value, probably nothing to do with this issue but Mach will calculate the thread starting from wherever your X is so you may get lots of wasted passes if the X is excessive when you start.

Hood
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: gallenat0r on February 16, 2013, 09:41:15 AM
If not I have been robbed  ;)

I've attached a picture of its back side as well as my configuration.

--
Kind regards,
Jens
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: Hood on February 16, 2013, 09:44:34 AM
Ok you are very unlikely to get the index pulse reading if it is coming from an encoder and you are using the parallel port, the pulse will just be far too short for the parallel port to read accurately. Some people have used circuitry to stretch the pulse but others have just gone to an opto and a slotted disc.
I will look at your xml but likely wasting my time for the reasons above.
Hood
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: Hood on February 16, 2013, 09:47:47 AM
You could try reducing your Index Debounce (General Config page) as it is set to 100 and that is, I would say, at least 10 times to high, try 0 and see but more than 10 will likely be very problematic.
Hood
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: gallenat0r on February 16, 2013, 09:49:00 AM
So the encoder should be attached to an external controller which will then feed the rpm into mach3?
Can you point me in a direction of such one?
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: Hood on February 16, 2013, 09:57:25 AM
If using an encoder then the pulse width is likely far too short for the parallel port to see correctly.Index pulses from encoders can be used when using most external devices for motion control, devices such as the Smoothstepper, CSMIO/IP-S, DSPMC, Kflop etc.
You can not use one of these devices to just input the index pulse and still use the parallel port for axis control as these devices are used instead of the parallel port.

If you wish to use the parallel port for motion control and use an encoers index pulse then you will likely need to build a circuit that will stretch the index pulse so that it is wide enough for the parallel port to see, you may find info if you search for something like circuit to stretch index pulse.

Hood

Oh and just in case you were thinking me rude, as my last comment sounded harsh when I said "wasting my time" I didnt really mean it in that sense but rather just it is unlikely that anything in your xml will be the problem.
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: gallenat0r on February 16, 2013, 11:20:51 AM
No worries, I didn't even get the rude part ;)

I guess going with the CSMIO/IP-M + CSMIO-ENC will make my life a lot easier.
Also is it possible to wire in the existing controller to the IO of the CSMIO?

Eventually I may scrap that controller and get some new stepper drivers.
The ones in the controller are 40V ??A (http://www.optimum-machines.com/products/cnc-pc-controls-complete-and-adapter-kit/6/cnc-controller-iii-and-vi/index.html)
What drivers would you recommend?
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: Hood on February 16, 2013, 11:25:40 AM
Ok be careful of that particular controller, it is nice for a mill but at this point in time I do not think it supports threading. Also I do not think it supports the Encoder module, the A and S do but dont think the M does. It is planned to have lathe threading in the M version but when I do not know so check with Andrew at CS-Lab and see what he says before you buy one.
 Hood
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: Overloaded on February 16, 2013, 08:38:48 PM
Ok be careful of that particular controller, it is nice for a mill but at this point in time I do not think it supports threading. Also I do not think it supports the Encoder module, the A and S do but dont think the M does. It is planned to have lathe threading in the M version but when I do not know so check with Andrew at CS-Lab and see what he says  before you buy one.
 Hood

If you learn more about this, please post your findings.
Following this with much interest
Have an "M" here to install in the near future.
Thanks,
Russ
 :)
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: gallenat0r on February 18, 2013, 04:55:35 AM
Just got off the phone with CS-Lab and the answer is no regarding the -M controller.
So I went ahead and ordered the 6axis controller and the encoder module.
I'll post what I learn here.
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: Hood on February 18, 2013, 06:39:03 AM
Hi gallenat0r
was that answer regarding the M that it will never do threading? or was it that at this point in time it does not?
 I had heard from someone else that there were plans to make it do threading but that it would just be via a single index pulse rather than full encoder following as the A and S do.

With regards the S and threading, I have one on a small lathe and it has slight issues in threading but this is due to the way Mach is sending info to the plugin. It seems any of the external controllers that use this method (Z geared to spindle encoder) have this issue. I did find that an older version of Mach improved the pullout rate significantly but sadly spindle override was not available in that version. I asked Brian if he knew what the issue was and if he could change later versions to perform like the older version but he just said he didnt have a clue and sadly that was the end of it.

 Good news is that Mach4 should not have any issues in this regard or so I am assured by Steve as he said he will make sure things are handled correctly in this respect. Only thing about that is Mach4 will likely not be usable on a lathe for a long time as it seems to be the way that mills/routers get all the attention and lathes get thrown the scraps :(

Here is my report of my progress with the CSMIO/IP-S on my small lathe.
http://www.machsupport.com/forum/index.php/topic,22268.0.html
Hood
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: gallenat0r on February 18, 2013, 08:43:20 AM
The answer was just "NĂ³" to a fairly long question, so I wasn't going to ask specifically.
Maybe when someone who is a bit more fluid in English reads my email I'll get a longer answer :D
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: Overloaded on February 18, 2013, 08:47:19 AM
Lets hope so.
Simple INDEX would be fine for me.
Thanks for posting gallenat0r,
Russ
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: gallenat0r on February 21, 2013, 06:52:01 AM
I got the package yesterday, which was lightning fast compared to the usual Chinese transport eta.
Well I suppose Poland is closer to Denmark in that way ;)

I have started connecting the controller to some M542 drivers I had lying around.
I get the STEP/DIR setup, but how is enable+ and enable- connected?

I eventually plan to use Gecko 203v drivers and they only have one disable pin, how is that connected to the CSMIO?

--
Kind regards,
Jens
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: Hood on February 21, 2013, 07:04:30 AM
Can yo be a bit more specific about the Enables? Is it the HV Enable or ?
Hood
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: Hood on February 21, 2013, 07:05:55 AM
Ah maybe you are talking about enables on your drives? If so do you have a link to the manual?
Hood
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: gallenat0r on February 21, 2013, 07:17:29 AM
Yes it's the enable pins on the drive. Right now the stepper motors just go into holding mode.

Manual for CSMIO
http://www.cs-lab.eu/en/upload/pdf/UM_CSMIOIPS_ENG_rev1_2.pdf

Picture of drive
http://www.google.dk/url?sa=i&source=images&cd=&cad=rja&docid=U16_Ja__qzPptM&tbnid=wO_TV63HjG0zEM:&ved=0CAgQjRwwAA&url=http%3A%2F%2Fldomotors.en.alibaba.com%2Fproduct%2F383081808-210815450%2FM542_Stepping_Driver_Controller.html&ei=HRAmUdLuDY3WsgajqoHYCA&psig=AFQjCNH-2uXllOagfvAprSU7PqeNh4FpnA&ust=1361535389624324

--
Kind regards,
Jens
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: Hood on February 21, 2013, 08:42:15 AM
Do you have the documentation for these drives? Usually they can be connected to 24v signals if you have the correct size resistor in series but best check with the documentation for them.
You would just use an output from the CSMIO as the enable signal and set it up in Mach as such.
 Hood
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: gallenat0r on February 21, 2013, 10:02:34 AM
Documenation is here: http://www.wantmotor.com/ProductsView.asp?id=257&pid=75&sid=82
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: Hood on February 21, 2013, 10:27:27 AM
That is saying a 2K resistor in line with the enable signal for 24v.

Hood
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: gallenat0r on February 21, 2013, 01:45:21 PM
Thanks, how are input and outputs mapped?
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: Hood on February 21, 2013, 01:49:58 PM
I presume tyou are meaning in Mach?
There are several ways but for an output such as enable you just set port 10 pin? in Mach as the enable. The ? represents whichever output on the CSMIO you are connected to, they start at 0.
Hood
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: gallenat0r on February 21, 2013, 01:55:07 PM
yes that was what I meant :)
so always port 10 and then whether it's input or output the plugin finds out for itself?
meaning input pin 5 is port10+pin5 and output pin 5 is port10+pin5 in mach?
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: Hood on February 21, 2013, 02:02:12 PM
Yes that is correct if talking about I/O on base unit. If using expansion modules then the port number will be the canbus address that the unit is set to with the dip switches.
Remember that I/O start at 0 so the pin labeled 1 on the connection board will actually be pin 0
Hood
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: gallenat0r on February 22, 2013, 12:17:43 AM
So I connected pin 2 and 15 on the controller to the enable+ on the drives and pin 15 to enable- on the drives.
In mach I setup port 10 pin 0 to enable 1 and port 10 pin 1 to enable 2.
I can see the leds go on and off, but cannot measure anything on the pins nor does it affect the drives.
I also connected pins 1 and 5 on input0-15 to a mushroom switch and set estop in mach to port 10 pin 0.
Nothing is registred here either.
The good news is that the encoder seems to be working although mach fails g76 with "external estop requested"
Oh the joy...
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: Hood on February 22, 2013, 02:45:21 AM
Ok first do you have a 24v supply to the CSMIO outputs? Pins 1, 4, 7 and 10 are to be connected to +24v and pins 14, 17, 20 and 23 to the 0v of your supply.
Regarding the Index, in the plugin invert  the encoder input, sounds like you have it the wrong way round, see screenshot.

One thing I should also say, any time you go into any of the config menus make sure the Reset in Mach is flashing first or your computer will hang.
Hood
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: gallenat0r on February 22, 2013, 01:17:54 PM
Thanks again!

Attached is first impressions.  :D

So for the e-stop I want to feed 24v into input pin 1 and 0v to input pin 5? (it is!)

--
gallenat0r
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: Hood on February 22, 2013, 01:47:09 PM
Looks a nice thread :)
Yes that is correct, you would run +24v to your E-Stop and then from it to an input on the CSMIO then as long as you have the 0V of your 24v supply connected to the terminals marked - (pin 5 for inputs 0-7, pin 6-13 for inputs 8-15) then it should work fine.

Hood
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: gallenat0r on April 10, 2013, 02:40:35 PM
I had some more time to fiddle with it but am having trouble with x-pullout when cutting threads.
I've seen elsewhere that it's common problem with csmio vs mach3.
Do you know how to solve this?

--
gallenat0r
Title: Re: Spindle index on Optimum D280x700 Vario Lathe
Post by: Hood on April 10, 2013, 03:18:04 PM
You can go back to ver 022 and try it, whether you will hit other problems I do not know as I only had that version loaded for a short time.
Hood