CS-Lab CSMIO/IP-A Quick start guide

© copyright CS-Lab s.c. 2020: Rev 1.1 (08/2021)
CSMIO/IP-A
6-axis CNC motion controller (+/-10V)
Manual Tuning Guide
with Mach4 software
APPLIES TO:
HARDWARE VER.
v2 FP4
v2 H7
FIRMWARE (software)
v3.xxx (Mach4)

www.cs-lab.eu
CS-Lab s.c. | CSMIO/IP-A 6-axis CNC controller. Manual tunning
2
1. Before you start
Since you are reading this guide, you have probably already tried to use the auto-tuning feature, but it was
unsuccessful, or the effects were unsatisfactory, and you want to try manual tuning now.
You must be aware that manual tuning can also end up in the same way. The auto-tuning function stops its
operation or gives unsatisfactory results only when even an experienced technician could have serious prob-
lems. Both the auto-tuning feature and the qualified technician have certain tolerance limits beyond which
they cannot guarantee that the tuning will be successful.
In this situation, should we immediately reach for the option of manual tuning and persistently look for the
value of PID regulator parameters, at which the machine will be somehow usable? Well no. First, we should
verify why the auto-tuning has not fulfilled its task. In most cases, the reason is:
- deregulated PID current or velocity loop regulator of a servo drive,
- a bad condition of servo magnets,
- fault in the control signal +/- 10V connection
- originally low sensitivity and sluggishness of a servo drive,
- substantial interference caused by incorrect connection of a servo drive,
- too strong filters of the set or actual speed of a servo drive.
The test, which consists in connecting a manual voltage generator (9V battery + potentiometer) or a labora-
tory power supply to a +/- 10V input of a servo drive to perform a manual axis run, only proves that the servo
drive is working, but does not prove its good condition, nor the correct tuning of PID regulators. We mention
this because many users find this test as a confirmation that their servo drive is perfect in every way and
does not require any maintenance.
To determine if the servo drive is in good condition and adequately tuned, compare two values presented
preferably as overlapping waveforms. We are talking about the value of the set speed and the actual rate of
a servo shaft. In the case of newer servo drives, this will be possible using a dedicated diagnostic utility for
the servo drive. In the case of older servo drives, using an oscilloscope and test points indicated on the servo
PCB by a manufacturer in a product manual.

www.cs-lab.eu
CS-Lab s.c. | CSMIO/IP-A 6-axis CNC controller. Manual tunning
3
2. Preparing for tuning
Before you start the manual tuning of the position PID regulator of CSMIO/IP-A motion controller, you must:
a) Connect, set, and test the E-STOP emergency stop button.
b) Check that the E-STOP button is easily accessible.
c) Connect, configure, and test the signals:
•"Drive Fault" (you can find it in plugin settings).
•"Drive Reset" (you can find it in plugin settings).
•"Enable #" (you can find it in Mach4 settings).
•„Motor ... ++” (you can find it in Mach4 settings).
•"Motor ... --" (you can find it in Mach4 settings).
d) Check the tuning of the current and velocity PID regulator of a servo drive and correct it if necessary.
If the servo drive is new or comes from a different machine or has been dysregulated, you should
thoroughly tune up the PID regulators. For information on how to tune, refer to the servo drive in-
struction manual.
e) Set the native unit in Mach4, millimeters or inches.
f) Set the "Axis Mapping" tab in Mach4.
g) Set the "Motors" tab in Mach4 (do not overdo it with the acceleration value, we suggest using
200ms2 – 500ms2 value at the beginning).
h) Connect the feedback signal. You can use:
-an optical scale,
-an encoder
-an incremental signal emulator output of a servo drive
In all cases, we mean an incremental signal compliant with the RS422 standard.
i) Check the feedback operation (encoders and scales operation test). For the feedback test, you need
to move an axis in both directions when Mach4 is at "Disable" status and watch axis DRO on the Mach4
screen simultaneously. If the feedback works, the axis DRO value should react adequately to the axis
movements.
j) Connect the analog signal +/-10V
If you skip any of the above steps, tunning CSMIO/IP-A position PID regulator may fail or be dangerous.
To make the tuning safe and undisturbed, only one servo drive should be enabled at a time, for which
the PID loop of the CSMIO/IP-A controller position has not been tuned yet.
This prevents the situation in which the servo drives, for which the position PID regulator has not been
tuned yet, will move at a low speed, causing position loss alarm or even running into a limit switch.
The above recommendation does not apply to an axis that is a driving gantry driven by "Master" and
"Slave" servos, where the tuning of both of them should be done simultaneously. It is also essential to
set a spindle in the center of a gantry in order to ensure that the servo drives working conditions are
as similar as possible.

www.cs-lab.eu
CS-Lab s.c. | CSMIO/IP-A 6-axis CNC controller. Manual tunning
4
3. First axis run
1) Set the axis manually in the middle of its motion range.
2) Go to the "Configure/Plugins/CSMIO/IP-CS-
Lab/Motors/Motor 0/PID Tuning" window
and set the value of the "Error Alarm Thresh-
old" parameter to a value that corresponds to
approx. 5 mm axis movement. To determine
this value, you should multiply 5 times the
value of "Counts Per Unit" in the "Motors"
window. In this case, "Error Alarm Threshold"
= 10000 x 5. Such a configuration will prevent
the axis from uncontrolled, covering a distance greater than 5mm. This value will be reduced at the end
of the manual tuning process, but now it must have such a high value because of the freedom of further
actions.
3) Set the initial "kP" parameter value (propor-
tional gain) to 0.01. The value is enough in
most cases. At this stage, the "kP" value
should be high enough, so the axis does not
crawl under the influence of the "Zero Offset"
parameter, which is not set yet, and can exe-
cute slow motion commands issued e.g. from
the "JOG". You should not use higher values
of the "kP" parameter than necessary be-
cause it may have a negative impact on the final tuning effect.
4) Switch Mach4 to "Enable" and try to make a slow move in "Jog" mode. It is recommended to use a very
low "Jog Rate%" value; usually, 1% is enough. Such a low value is used since our goal at present is only
to check that the axis will respond correctly to motion commands.
If immediately after switching Mach4 to the "Enable" state or at the time
of trying to make the first move, the axis will make a sudden movement
of about 5mm (see point 2), and the message "PID Fault" will be dis-
played (shown on the right), it will mean that you should change the
counting direction of an encoder to the opposite using the "Encoder Re-
verse" option (photo below).
Strenuous attempts to manually select the value of the "Zero Offset" parameter, which is the voltage
offset of the +/- 10V analog signal at this stage do not make sense and are only a waste of time. This is
because many users waste a lot of time trying to use this parameter to stop the axis from creeping, i.e.
from making slow and uncontrolled axis motion when the PID regulator of the CSMIO/IP-A controller po-
sition is not tuned yet.

www.cs-lab.eu
CS-Lab s.c. | CSMIO/IP-A 6-axis CNC controller. Manual tunning
5
The number 50849 in the error message shown above is not the error number! It is the axis position error
value expressed in pulses (it is the difference between the commanded position and the actual axis position).
On the other hand, if a few seconds after
switching Mach4 to the "Enable" state or af-
ter making a few millimeters of movement
using "Jog," the "PID Fault" error appears, it
will mean that the encoder counting direction is correct and the problem may be too low kP parameter value.
Such a situation can be caused, for example, by the influence of gravity on the Z axis, extremely heavy axis,
old dried grease on the guides. In this case, increase the kP parameter value by 0.01 and try again
If, despite using the "Encoder Reverse" option or increasing the kP parameter value several times, the above
visible error ("PID Fault") still appears, stop further attempts because the problem may lie in the configura-
tion of the servo drive or its connection.
When the effect is positive, i.e. the axis will perform slow motion orders given from the "Jog" level, and after
covering a longer distance, the "PID Fault" error will not appear, you can proceed to the next stage.
5) Switch Mach4 to "Enable" and press the "Auto", buton to automatically set the "Zero Offset" value.
The automatic configuration consists in entering
to the "Zero Offset" parameter the value of the
voltage generated by the DAC converter of the
CSMIO/IP-A controller when the position PID reg-
ulator is enabled and keeps zero revolutions of
the servomotor shaft. The necessity to use the +/-
10V analog signal offset results from the fact that
the servo drives should be turned on when the
voltage on their analog input +/- 10V corresponds to the zero rotational speed of the servomotor shaft. It
excludes unpleasant knocks and jerks of the axis when the "Enable #" signal switches on the servo drive.
If the "Zero Offset" parameter is higher than 0.5V or lower than -0.5V, first check if the analog ground be-
tween the CSMIO / IP-A controller and the servo drive is connected correctly. You should also check the
settings of the counterpart of the "Zero Offset" parameter in the servo settings.

www.cs-lab.eu
CS-Lab s.c. | CSMIO/IP-A 6-axis CNC controller. Manual tunning
6
6) Set the "Scope Data Source" tab, as shown in the picture below.
Set the channel number 0 so that it represents the
value of "Mkit Following Error" (the red graph).
Set channel 1 so that it represents the value of
"Mkit Ref Velocity" (the green graph).
7) Set the "Scope Control" tab as shown in the picture below.
"Scope Control" tab set this way will
cause the "Trigger" to snap the wave-
form of both oscilloscope channels, ex-
actly when the value of "Mkit Ref Veloc-
ity" reaches 5mm/s, that is 300mm/min.
The "Val / Div" (channel sensitivity) and
"Time t / Div" (time base) parameters
have been selected to emphasize the
waveforms of both channels as much as
possible.
It may be necessary to use other values of the parameters "Val/Div" and "Time t/Div" because they de-
pend on the values of velocity, acceleration, and distance with which the axis will move during manual
tuning as well as the quality of tuning and sensitivity of servo drives.
8) Prepare a simple g-code that moves the axis several dozen times forward and backward
with a distance of 5mm at the speed of 1000mm/min (16.66mm/s). Switch Mach4 to the
"Enable" state and run gcode. If you have done everything correctly so far, the axis should
move forward and backward, giving us the ability to tune it in real-time. You should see a
view similar to the one below on the oscilloscope screen

www.cs-lab.eu
CS-Lab s.c. | CSMIO/IP-A 6-axis CNC controller. Manual tunning
7
The process we are the most interested
in is the red waveform, which shows
"Mkit Following Error" value (following
axis position error) expressed in mm (or
inches). In this case, after the men-
tioned gcode running, the value is about
0,4mm. The "Mkit Following Error"
value is estimated with the "Val/Div" pa-
rameter value and a number of oscillo-
scope grids covered by the top or bot-
tom part of the waveform. In this situa-
tion, the upper part took up a bit over
two grids, and the "Val/Div" value is
0.2mm. It’s is easy to calculate 2 x
0.2mm = 0.4mm.
On the oscilloscope screen, there is also
the green waveform presenting "Mkit
Ref Velocity" value (set velocity that an
axis should get when making a set
move) and is expressed in mm/s (or
inch/s). In this case, the velocity given by
the gcode is 1000mm/min, which is ap-
proximately 16,66mm/s. You can read
this value from the chart the same way
we did above.

www.cs-lab.eu
CS-Lab s.c. | CSMIO/IP-A 6-axis CNC controller. Manual tunning
8
Additional information:
If we increase the "Time t/Div" value
(for demonstration purposes), you will
notice that the "Mkit Ref Velocity" value
creates a repeatable trapezoidal wave-
form. This waveform is the ideal refer-
ence for the "Trigger" function.
If you do not know why the "Mkit Ref Velocity" value has the trapezoidal shape, let us remind you that Mach4
uses a trapezoidal motion velocity profile.

www.cs-lab.eu
CS-Lab s.c. | CSMIO/IP-A 6-axis CNC controller. Manual tunning
9
4. Axis tuning
1) Increase "kVff" value as long as "Mkit Following Error" value decreases.
•Too high "kVff" value causes an axis set position to be overtaken, which results in a new increase in
the "Mkit Following Error" value. What is important, too high value of the "KVff" parameter doesn't
cause oscillation of an axis, so we can only notice it in "Mkit Following Error". Value progress
•Too low "kVff" value wastes the potential of a servo drive, which results in an unnecessarily high
value of "Mkit Following Error".
"KVff" is a value of velocity "feed forward" gain. In simple terms, the higher value of the "kVff" parameter,
the higher voltage value, proportional to "Mkit Ref Velocity" value (set velocity that an axis should get
when making a set move) will go directly to the +/-10V analog output of a CSMIO/IP-A controller.
"Feed forward" of velocity greatly supports the proportional term of the position PID regulator, and thus
the value of the "kP" may be much lower. It shortens axis reaction time and hence significantly reduces
the "Mkit Following Error" value. However, we should remember to set the "kVff" value when the "kP"
parameter has an initial value.

www.cs-lab.eu
CS-Lab s.c. | CSMIO/IP-A 6-axis CNC controller. Manual tunning
10
Below and in the further parts of the document, we will present you a series of slides showing the process
of finding the correct values (tunning) of a selected parameter. In the slides, you can find values of all the
key parameters. You should analyze them carefully to draw your own conclusions that will help you under-
stand how a discussed parameter affects a servo drive's operation.
The processes presented in the slides may differ from waveforms obtained by users on their CNC machines.
Many factors cause it, but the most important are: quality of servo PID regulator tuning, power and sensi-
tivity of a servo drive, axis weight, gear ratio, velocity, and acceleration value.
Below you can see slides that show searching for a proper value of "KVff".
Start
Step 1
Step 2
Step 3
Step 4
Step 5
Step 6
Step 7
Step 8
Step 9
Step 10
Step 11
Step 12
Step 13
Step 14

www.cs-lab.eu
CS-Lab s.c. | CSMIO/IP-A 6-axis CNC controller. Manual tunning
11
Step 15
Step 16
Step 17
Description of "kVff" term tuning:
Step 1 – 4
We increase the "kVff" by 0.05, the value of "Mkit Following Error" decreases.
Step 5
Further increasing the "kVff" value by 0.05 causes the "Mkit Following Error" value changes sign to
the opposite. It means that an axis overtook the set position (false start effect).
Step 6
We reduce the "kVff" value by 0,05, and we additionally reduce a value of Val/Div to 0,05 to enlarge
(enhance) the waveform.
Step 7 – 10
We increase the "kVff" value by 0.01, the value of "Mkit Following Error" decreases.
Step 11
We reduce the Val/Div to the value of 0,01 to enlarge the waveform.
Step 12 - 15
We increase the "kVff" by 0.001, the value of "Mkit Following Error" decreases.
Step 16
Further increasing of the "kVff" value by 0.001 causes the "Mkit Following Error" value changes sign
to the opposite. It means that the axis reached the set position but overtook it (false start effect).
Step 17
We reduce the "kVff" value by 0.0005, which aligns the waveform's left and right part.
We consider the current value of "kVff" as the target value, and we go to a next stage.
Please notice that the "Mkit Following Error" value in the discussed case is currently only 0,04mm (Val /
Div = 0,01mm x 4 oscilloscope grids). This proves that the "Feed forward" of velocity strongly supports
the work of the proportional term of the PID regulator.

www.cs-lab.eu
CS-Lab s.c. | CSMIO/IP-A 6-axis CNC controller. Manual tunning
12
If increasing the value of the "KVff" term will not cause a significant decrease in the value of "Mkit Follo-
wing Error", you should check again:
- correctness of velocity and current PID loop tuning in a servo drive
- settings of set and real velocity filters of a servo drive.
Too strong velocity filters and too softly tuned velocity and current PID regulators delay a servo drive re-
sponse, which translates into a significant increase of the "Mkit Following Error" value.
Older generation servo drives may react slightly worse to increasing the "KVff" parameter value due to their
originally low sensitivity or highly worn magnets.
2) Increase the "kP" value as long as the "Mkit Following Error" value will be willing to decrease, and no
dull knocking or axis oscillations will be noticeable. In other words, you should stop increasing the "kP"
value when the difference between several consecutive values of "Mkit Following Error" will give a sim-
ilar result. The condition is to increase the "kP" value in equal steps.
•A too high value of the "kP" causes a too strong reaction of the PID regulator's proportional term
on the "Mkit Following Error" value, which results in the mentioned dull knocking and axis oscilla-
tions.
•A too low value of the "kP" causes a too weak reaction of the PID regulator's proportional term on
the "Mkit Following Error" value, which results in an unnecessarily high "Mkit Following Error"
value.
The "kP" parameter is a value of proportional term gain of the position PID regulator. In simplification, the
higher "kP" and "Mkit Following Error" value, the higher voltage value will go to the +/-10V analog output
of CSMIO/IP-A controller.

www.cs-lab.eu
CS-Lab s.c. | CSMIO/IP-A 6-axis CNC controller. Manual tunning
13
Below you can see slides that show searching for a proper value of "kP".
Start
Step 18
Step 19
Step 20
Step 21
Step 22
Step 23
Step 24
Step 25
Step 26
Step 27
Description of "kP" term tuning:
Step 18 - 21
We increase the "kP" by 0.02, the value of "Mkit Following Error" decreases eagerly.
Step 22 - 24
Further increasing of the "kP" by 0.02, causes the "Mkit Following Error" value to reduce reluctantly.
Step 26 - 27
Further increasing of the "kP" by 0.02, causes the "Mkit Following Error" value does not decrease
and axis' resonance intensifies.
We reduce the "kP" to Step 21 value, and we consider it the target value and go to the next stage.

www.cs-lab.eu
CS-Lab s.c. | CSMIO/IP-A 6-axis CNC controller. Manual tunning
14
3) Increase the "kAff" value as long as the "Mkit Following Error" value decrease.
•Too high value of the "kAff" causes an axis set position to be overtaken, which results in a new in-
crease in the "Mkit Following Error" value. Too high "KAff" value doesn't cause oscillation of an axis,
so we can only notice it in "Mkit Following Error" value progress.
•Too low "kAff" value wastes the potential of a servo drive, which results in an unnecessarily high
value of "Following Error".
The "kAff" parameter is a gain value of acceleration, "feed forward". In simplification, the higher "kAff"
value, the higher value of voltage proportional to the value of "Mkit Ref Acceleration" (the set accelera-
tion, which an axis should get when making a set move) will go to +/-10V analog output of CSMIO/IP-A
controller.
"Feed forward" of acceleration highly supports the integral term of position PID regulator, which pro-
vides the value of the "kI" parameter may be much lower. This way, axis reaction time is shorter, and the
"Mkit Following Error" value is significantly reduced. We should just remember that the "kAff" value
should be set before the "kI" parameter.

www.cs-lab.eu
CS-Lab s.c. | CSMIO/IP-A 6-axis CNC controller. Manual tunning
15
Below you can see slides that shows searching for a proper value of "kAff.
Start
Step 28
Step 29
Step 30
Step 31
Step 32
Step 33
Step 34
Step 35
Description of "kAff" term tuning:
Step 28 - 30
We increase the "kAff" by 0.1, the value of "Mkit Following Error" reduces.
Step 31 - 32
We increase the "kAff" by 0.1, the value of "Mkit Following Error" doesn't reduce.
Step 33 - 35
We increase the "kAff" by 0.1, the value of "Mkit Following Error" changes the sign.
We reduce the "kAff" value to Step 30 value, and we consider it the target value and go to the next
stage.

www.cs-lab.eu
CS-Lab s.c. | CSMIO/IP-A 6-axis CNC controller. Manual tunning
16
4) The next stage is to find the correct value of the "kI" parameter. It's used in situations when the servo
drive velocity PID regulator doesn't have an integral term or does not fulfill its task sufficiently due to the
servo drive's outdated design.
Increase the "kI" parameter as long as the "Mkit Following Error" value decreases and axis oscillations
aren't noticeable.
•A too high value of the "kI" causes the integral term of position PID regulator reacts to "Mkit Follow-
ing Error" value much faster and harder than a servo drive can provide what causes the before men-
tioned axis oscillation.
•A too low value of "kI" parameter causes the integral term of position PID regulator reacts too slow
and weak on the "Mkit Following Error" value what translates into an unnecessarily high value of
"Mkit Following Error".
The "kI" is a value of integral term gain of position PID regulator. In simplification, the higher "kI" and "Mkit
Following Error" value and the longer the value lasts, the higher voltage value will go to the +/-10V analog
output of a CSMIO/IP-A controller.

www.cs-lab.eu
CS-Lab s.c. | CSMIO/IP-A 6-axis CNC controller. Manual tunning
17
Below you can see slides that shows searching for a proper value of "kI". In the case of this parameter, draw-
ing conclusions from the parameters on the slides may not be instructive because to create this guide, we
used a DELTA ASD B2 servo drive, which implements the integral term of velocity PID regulator.
As we wrote previously, the "kI" parameter of position PID regulator is "used in situations when the servo
drive velocity PID regulator doesn't have an integral term or does not fulfill its task sufficiently due to the
servo drive's outdated design."
Start
Step 36
Step 37
Step 38
Step 39
Step 40
Step 41
Step 42
Step 43
Step 44
Step 45
Step 46
Step 47

www.cs-lab.eu
CS-Lab s.c. | CSMIO/IP-A 6-axis CNC controller. Manual tunning
18
Description of "kI" term tuning:
Step 36 - 38
We increase the "kI" by 0.02, the value of "Mkit Following Error" decreases.
Step 39 - 45
Further increasing of the "kI" by 0.02, the value of "Mkit Following Error" does not decrease.
Step 46 - 47
Further increasing of the "kI" by 0.02, the value of "Mkit Following Error" does not decrease, axis
resonance appears.
5) The last parameter, "kD" is very rarely used. It is applied only for not very sensitive and sluggishly re-
sponding servo drives, where re-tuning of the current and velocity PID regulator of a servo drive did not
improve anything. We should remember that using the "kD" parameter may not solve issues with to low
sensitivity and sluggishness of a servo drive, resulting from its wear or factory properties.
The "kD" is the value of integral term gain of position PID regulator. In simplification, the higher value of
the "kD" parameter and the faster change of "Mkit Following Error", the stronger suppression of position
PID regulator proportional and integral term activity. This has a stabilizing effect on the operation of
position PID regulators, which in turn allows to some extent to increase the "kP" and "kI" values. As a
result, a servo drive will react stronger and more accurately to slower movement orders and slightly
weaker and less accurately to fast movement orders.
•Too high value of "kD" parameter causes servo drive reaction time is shorter and "Mkit Following
Error" increases. Extremely high values of "kD" parameters may cause jerking (jumping) move of
an axis.
The "kD" parameter should be used only when it is necessary. For servo drives that work correctly, this
parameter does not need to be used. Unjustified use of this parameter may reduce the servo drive's
response time and increase the value of "Mkit Following Error".

www.cs-lab.eu
CS-Lab s.c. | CSMIO/IP-A 6-axis CNC controller. Manual tunning
19

www.cs-lab.eu
CS-Lab s.c. | CSMIO/IP-A 6-axis CNC controller. Manual tunning
20
5. Final steps
1) Gradually increase the acceleration to the assumed value while checking the graph for the "Mkit Following
Error" value. If the "Mkit Following Error" value increases to an unacceptable level, try the tuning of the
PID regulator of the CSMIO/IP-A controller position again. If the re-tuning does not help, the drive has
reached its end of life, and you should accept the lower acceleration value than assumed.
2) Finishing the process of manual PID regulator tuning of CSMIO/IP-A controller position, you cannot forget
to configure the target value of the "Error Alarm Threshold" parameter. This value cannot be too high
because in the event of a failure of any of the key components of the axis drive system, it may pose a
threat, and in turn, the too low value may cause false alarms. As a rule, the "Error Alarm Threshold" is
determined by multiplying 3 or 4 times the maximum recorded "Mkit Following Error" while the axis
moves at the maximum assumed speed. This method of determining the "Error Alarm Threshold" value
is universal and works well in any situation.
3) After a successful manual tuning process, we should thoroughly test the CNC machine, and especially the
operation of servo drives, in the broadest possible range of conditions in which they will work. These are
light and heavy loads and low and high ambient temperatures. We mention it because you should re-
member that a properly tuned servo drive is a servo drive that works as precisely and stable as possible
under all conditions.
4) After a month or two, you should check if a repeated tuning of the PID regulator of your CSMIO/IP-A
controller position is not required. This is usually necessary only for CNC machines that have not been
used for a long time because of flushing out thickened or dried grease or oil by their central lubrication
system. This results in a lighter axis operation and a lower value of parameters described in this manual.
Other manuals for CSMIO/IP-A
1
Table of contents
Other CS-Lab Servo Drive manuals
Popular Servo Drive manuals by other brands

Panasonic
Panasonic PANATERM QS5000 quick start guide

Acoms
Acoms AS17 Technical note

Elmo
Elmo SimplIQ Series installation guide

Rockwell Automation
Rockwell Automation Allen-Bradley Kinetix 350 installation instructions

Allen-Bradley
Allen-Bradley 2094-AC05-MP5 user manual

Kollmorgen
Kollmorgen SERVOSTAR 300 instruction manual