OK...
Here is my guide for setting up the Speed control...
All the usual disclaimers apply...
"Your mileage may vary"
"Keep out of reach of children"
"These instructions are packed by weight not volume, contents may settle in transit"
etc
etc
I am using the following hardware...
Boxford 160TCL
CNC4PC C11G Breakout Board
CNC4PC C3 Index Pulse Board
CNC4PC C15 Dual relay Board
Lenze 534 DC Speed Controller
Setting up The Index or Timing Pulse
------------------------------------
Initially I had a single ~6mm wide slot on a 125mm disc. This is the original timing disc on the Boxford. The choice of ~6mm was made for me as it was the distance between the outside edges of 2 of the existing holes in the disc.
Make sure that the sensor is not lined up with the miriad of holes, but the solid area on the disc.
I have connected the Signal to Pin15 on the C11G card as that is the fastest input on the card.
Be carefull to connect the ground to a ground pin on the C11G. The pin next to Pin15 is a 5v pin NOT ground!
The C3 card defaults to outputting a signal when it is NOT aligned with the slot. So you need to flip the "active low" setting in Mach3 until the dignostic page "Index" or "Timing" LED lights when it is aligned with the slot.
Mach3 sets the default "Index Debounce" level to 100. On my system this was way too high and resulted in being able to get whatever RPM value I wanted just by changing the debounce value. The higher the debounce the lower the RPM.
I have my debounce set to 2.
At this point I didn't believe the speed reading I was getting so I decided to try the "Timing" input instead.
I changed the slots to 3 off ~10mm wide and 1 off ~20mm wide and changed the "Inputs" section of Mach3 to see the "Timing" instead of the "Index" on Pin 15 and hey presto I got exactly the same RPM values!
NOTE - If you go to the "Calibrate Spindle" dialog the "number of pulses per rev" should tell you how many slots you have, ignore the note in the dialog which tells you it should show 0 for 1 slot. Mine allways said 1 when I had 1 slot and now says 4.
Setting the Analogue Output
---------------------------
The C11G has an analogue out section which converts a STEP/DIR signal to a 0-10v signal.
The C11G only has 1 mechanical relay. This *can* be used as the direction relay for the spindle, however, when I tried it, I found that when you hit the E-Stop the power would be cut and the direction relay would reset and the spindle would suddenly run down in the opposite direction.
I did not like this so I decided to use the C15 relay board to change the direction of rotation using the M3 & M4 signals.
First you need to set the "Ports and Pins" to send out STEP on Pin14, I left the DIR set to pin 0 and I am not using it.
The C11G manual tells you to go into motor tuning and set the Steps Per to 1000 and the Velocity to 1500. On my system I found that this maxed out the pulse train and made it so the POT on the board would not change the final voltage.
Despite what the C11G manual states, I found that the maximum voltage put out was directly proportional to the "Steps Per" value and the pulse length made very little difference.
So I reduced the Velocity to 1000 and the "Steps Per" to 1000.
I then set the pulley1 set to min and max of 320 and 3200 rpm. This sets the allowable S range that can be commanded.
I then needed to adjust the C11G output voltage to 10v at maximum speed.
NOTE - Do not have the speed controller connected at this point!
Entering M3 S3200 starts the voltage flowing and I could fine tune the output to 10v using the POT on the C11G board.
I then commanded S400 to S3200 in steps of 400 to see how linear the voltage was and it turned out to be very good.
Connect up the speed controller.
At this point I remembered that the original speed controller was used to getting 8v from the original board and so I started the spindle with a low speed and turned down the "Nmax" on the speed controller.
Next is to command a S3200 and adjust the Nmax setting on the speed controller until the Mach3 speed showed 3200 rpm.
At this point you will more than likely find that the speed control is fairly linear but does not give you the right readings.
On plotting the speed against requested speed I found it to be quite linear but with the wrong gradient. This told me that the slow speed was too slow and the fast speed way too fast but it was quite linear inbetween.
Command the slow speed S320 and tune the "Nmin" setting on the speed controller until the RPM reading is 320rpm.
Now check the S3200 speed and I found it was now too high!
I then adjusted the S320 speed and S3200 speed alternately until they both resulted in the correct speed for the commanded speed.
The result is now within 1% of the commanded speed! I have no doubt I could get it even better, if I could be bothered to continue the iteration process. 1% is good enough for me!
Many thanks to everyone for their help, without which I would never have managed to get this far!