From Dynomotion

Jump to: navigation, search

Main Page

12,465 bytes added, 20:09, 17 October 2019
/* ModBus */
==Dynomotion Software Topics==
===Installation Topics===
* Announcement of our Latest Production Test Release(V4.35b) on the [https: // Dynomotion Forum]* [ Full release download page (includes link to signed Windows Drivers)  Latest Stable Release] Note:to use For Windows 7 64bit signed Drivers for W7 64bit Drivers from V4.34a or later are required.  Also to work, all Windows Updates should be performed for the chain of trust to work properly].
* [[Upgrading from previous KMotion Versions]]
* Latest Archive of Test Releases: * Previous Test Release: 12/21/2018: [ KMotion.exe V4.35a], See the release notes for this test version here: [ V4.35a release notes (pdf)]* Previous Test Release: 09/28/2017: [ KMotion.exe V4.34j], See the release notes for this test version here: [ V4.34j release notes (pdf)]
* Previous Test Release: 05/07/2017: [ KMotion.exe V4.34i], See the release notes for this test version here: [ V4.34i release notes (pdf)]
* Previous Test Release: 12/14/2016: [ KMotion.exe V4.34h], See the release notes for this test version here: [ V4.34h release notes (pdf)]
* Previous Test Release:  03/09/2016: [ KMotion.exe V4.34a], See the release notes for this test version here: [ V4.34a release notes (pdf)]
* [ How to install KMotion.exe and KMotionCNC]
* [[How to install KMotion.exe and KMotion in Windows 10|Preparing Windows 10 for driver installation]](no longer required)
* [[Special Case for Windows 8.1 Industry Embedded Enterprise]]
* [[Updating KFLOP Firmware|How to update KFLOP Firmware]] - whenever a new version of software is installed, the firmware within KFLOP must be updated to match the new version
[[Rigid Tapping G84 Setup and Use]]
[[Tool Length/Offsets G43Hn G49]]
====<span style="text-decoration: underline;">Customize KMotionCNC</span>====
: '''General Information'''
: Compiling KMotionCNC
:: The KMotionCNC's Visual Studio Project Solution (\PC VC Programs\KMotionCNC\KMotionCNC.sln) is currently written for Visual Studio 2008 2015 Standard.  This version can be used for the simplest compatibility.  Projects can be upgraded to newer version of VS with minimal effort.  Including Microsoft's Free Visual Studio 2013 Community.  [[PC Example Applications|More info on PC Example Applications.]]
:: Note Test Versions 4.34a and later have project solutions targeted for Visual Studio 2015 Community which is free for most Users.
: '''KMotionCNC Customization Examples and Applications'''
:: Links to examples of projects that explain KMotionCNC customizations::: . Troy (tmday7) created some helpful documents listed on the Yahoo Group Files Section (PDF format):: :* [ How to edit KMotionCNC faces]:* [ Adding external buttons]:* [https:/ here/ Adding more user buttons]:* [ Adding Jog Percent Cell to Main Dialog Face] 
====<span style="text-decoration: underline;">KMotionCNC Screen Editor</span>====
Introduces the capability of using Screen Script files to modify the look and function of KMotionCNC.<br />[[KMotionCNC Screen Editor|More information.]]
====<span style="text-decoration: underline;">KMotionCNC Geometric Correction</span>====
Information regarding the powerful [ Geometric Correction capability] which allows calibration and distortion correction of the XY CAD space to Machine/Actuator Space as well as flatness in Z.  Simple 4 point correction tables can apply XY Scale, Rotation, skew, offset, tilt.  Larger tables can apply more non-linear corrections.
Note the Geometric Correction is built into the KMotion Libraries and can be utilized by Custom Programs as well as with KMotionCNC<br />[[Geometric Correction|More information and Examples.]]
===PC Example Applications===
A number of PC Applications using the KMotion Libraries are available in the Software download.&nbsp; Visual Studio should be used to modify/compile the applications.&nbsp;
Currently the projects are compatible with VS 2008 Standard but later Versions can upgrade the projects and can be used including the free Microsoft Version of VS 2013 Community.&nbsp; In some cases MFC capability needs to be added as a separate download.
[[KMotion Libraries - GCode Interpreter - Trajectory Planner - Coordinated Motion - .NET|More information]].
The KMotion Libraries contain a Kinematics Layer where Users can add their own non-linear Kinematics
[[Kinematics|More information]].
===KFLOP C Programs===
Modbus can be connected to the PC or directly to KFLOP.  A PC connection will not be deterministically real-time but may work for basic speed control and on/off.  Here is a related Thread for interfacing KMotionCNC to Modbus using a [ free utility].:
[ Sending ModBus msgs from KmotionCNC to a RS485 port]
To connect Modbus directly to KFLOP's [ UART] see the C Examples in \C Programs\RS232\ModBus\
===Linux Support===
KMotion Motion Libraries are fully supported under Microsoft Windows. Some Users have ported the KMotion Libraries to Linux.  Dynomotion will offer support where possible but can't offer full support under Linux.  Special Thanks to [ Par Hansson] for the initial Linux Port.
See [[Linux|here]] for more info.
==Dynomotion Hardware Topics==
===General Hardware Information===
KFLOP ====[[KFLOP Hardware Info|KFLOP specific Hardware Info]]==== KStep ====[[KStep Hardware Info|KStep specific Hardware Info]]==== Kanalog ====[[Kanalog Hardware Info|Kanalog specific Hardware Info]]==== SnapAmp ====[[SnapAmp Info|SnapAmp specific Hardware Info]]==== Konnect ====[[Konnect Hardware Info|Konnect specific Hardware Info]] ====
===Wiring Diagrams===
[[Media:dyn4 kanalog KE1524 V1.1.png|Basic Kanalog DAC and DMM DYN4 Drive 1 Axis]]
[[Media:Kanalog_with_Geckos_G210Kflop-Kanalog_wiring_11-19-2018.pdf|Kanalog with Geckos G210updated 11-19-2018]] (Thanks to <span style="color: windowtext;">Joseph Mirocha</span>)
[[Media:Kanalog_to_Tree_Journeyman_325_by_Rick_B.pdf|Kanalog to Tree Journeyman 325.pdf]] (Thanks to <span style="color: windowtext;">Rick_B</span>)
[ User Created KFLOP JP7 Breakout/OptoIsolation Board] Schematic, Gerbers, PCBs Publicly available (thanks 350banshee)
[ Rotary Switch Connected to Kanalog Opto Inputs]
===3D Board Models===
[[|]]  STEP file format - Thanks to Curtis
[[|]] STEP and IGS models - Thanks to Chris
===Wiring Topics===
Place links to pages on wiring inputs and  outputs specific to your experiences and projects.  Be descriptive with page titles and links.  
MPGs (Manual Pulse Generators) should be connected directly to KFLOP for guaranteed real-time response (not USB based or connected to the PC).  MPGs are handled by a C Program that monitors the MPG and creates motion based on the MPG Encoder changes and switch selections for axis, speed, and so forth.  See the MPG C Program Examples.  Here is a Discussion with other links.
 [ Jogging Pendant] [https:/conversations/ Connecting Keling MPG2 Pendant] [ CNCZone Thread] on obtaining smooth filtered motion.
====Interfacing NPN Devices to KFLOP IO====
NPN devices (open collector)operate as a switch to GND and can be interfaced to KFLOP using a pull up resistor as shown below. When the transistor switches to 0V the KFLOP IO Pin is driven low. The transistor will need to sink ~3ma. When the transistor is off (open circuit) the resistor pulls the IO Pin to 3.3V. Note even though some KFLOP IO Pins can tolerate 5V pulling them above 3.8V should be avoided when possible so the 3.3V supply is used. This technique will only work with KFLOP IO Pins that do not have pull down resistors (JP7 and JP5). In some cases a 0.1uF Ceramic capacitor connected close to KFLOP might be added in parallel with the resistor to filter noise.  Cable shielding connected to KFLOP GND on the KFLOP end only is recommended.  Note that in noisy environments this technique may couple noise into KFLOP so opto isolation should be used instead.
====Multiplexing Encoder Inputs to KFLOP JP4 and JP6====
If KFLOP JP7 and JP5 are used for other purposes the encoder inputs can be multiplexed to KFLOP JP4 and JP6. There is an option to multiplex encoders 0-3 from JP7 to JP4 and another option to multiplex encoders 4-7 from JP5 to JP6. See the MuxEncoders.c for an example.
Note the JP4 and JP6 IO are 3.3V inputs and shouldn't be driven hard (more than 10ma) above 3.8V. This is not usually an issue as most encoders or RS422 drivers don't do this. The inputs also have 150 ohm termination.
The following line of code might be added to your Initialization C Program. It needs to be executed once to multiplex the encoders after any power cycle. Encoders 0-3 will then be input on JP4 and 4-7 will be on JP6. Both JP4 and Jp6 have 10 IO bits. The 4 encoders will appear on the first 8 IO bits. 2 bits for each encoder's A B channels in order. So for example Encoder #0 will appear on JP4 IO16 (Pin5) and IO17 (Pin6)
<pre class="brush:c">
// Mux encoder inputs from KFLOP JP7 & JP5 to JP4 and JP6
JP4 and JP6 have +5V available on Pin1 and GND on Pins 8 and 9 that might be used to power 5V encoders.
==<span id="Axes_Servo_Tuning_and_Trajectory_Planner" class="mw-headline">Axes Servo Tuning and Trajectory Planner</span>==
===Basic Servo Tuning Overview===
Once an axis is configured and proved capable of holding a position it is ready to be tuned and optimized. Most often a small value of P Gain only is used to show the servo is functional and can hold position. The Servo may be very weak and inaccurate but will be functional.
Every system is different and the tuning parameters are interactive in a manner that usually doesn't allow parameters to be determined one at a time. Rather after one parameter is changed it may be necessary to revisit the other parameters.
In general higher gains will reduce errors and improve accuracy, but tend to make the system more unstable.  So the general idea is to increase gains to reduce errors as much as possible but still have a stable system.
Often during tuning the system may go unstable. In fact, it is normally intentionally driven to instability to find its limits for a certain parameter. This can result in a violent oscillation or worse so one should be prepared to quickly disable the Servo. If an appropriate [ Max Following Error] is used the axis can be automatically disabled before the oscillation becomes too violent, yet not disable when performing a normal test.
KMotion.exe allows you to change any axis parameter on the Step/Response, Config, or Filters Screens then simply push "Move" to see the effect of the change.  Note that as performance improves the errors will become small and difficult to see on the Position Plot without Zooming in (Left click drag) so changing the plot type to plot the error is useful.
The overall process normally goes something like this:
# Select a Test [ Move Size] and [ Motion Profile].  [ See Also]
# Select [ Max Limits] to allow for the Test.  [ See Also]
# Determine maximum level of [ P Gain]
# Determine maximum level of [ D Gain] (with Low Pass Filtering)  See Also [ here] and [ here].
# Determine new maximum level of P Gain now that D Gain increased stability
# Add I Gain to improve accuracy and remove steady state errors.  [ See Also]
# Add [ Feed Forward] to reduce errors
===Torque Servos vs Velocity Servos===
+/-10V Analog Amplifiers usually come in one of two varieties: '''Torque''' or '''Velocity'''. Torque mode amplifiers consider the input command as a Torque Command and work to generate the commanded Motor Torque. Velocity mode amplifiers consider the input command as a Velocity Command and work to generate the commanded Velocity.  Its important to understand what type of Amplifiers you have.
'''Velocity Mode Amplifiers''' need some form of feedback going to the Amplifier in order for the drive to know the current velocity. This might be a digital encoder or an analog tachometer.
===<span id="Velocity.2C_Acceleration.2C_and_Jerk" class="mw-headline">Velocity, Acceleration, and Jerk</span>===
===Lead Compensator vs Derivative Gain===
Derivative (D) Gain is often used to help stabilize a system.&nbsp; It helps to think in the Frequency Domain to help understand how the two forms of compensation help.&nbsp; Please read below and [ this] for more information on the Frequency Domain.&nbsp; Both Compensation methods add positive phase to help stabilize the system.&nbsp; Unfortunately both methods increase gain at higher frequencies possibly causing the system to go unstable at higher frequency.&nbsp; A Lead Compensator provides the benefit of positive phase but without as much gain increase at higher frequencies.&nbsp; This figure shows a simplified Gain Plot comparison:
Here is a Bode Plot of a P=0.5 D=20 Compensator.   Note the KMotion.exe Bode Plot Screen has the capability of plotting the Frequency Domain Response of the PID+Filters Compensation.  Assume we desire positive phase to be added at 40Hz.  Notice the positive phase of 40 degrees at 40Hz which is good.  However the Gain increase in the 1KHz region of about 21db which is bad.
Here is a Bode Plot of a P=0.5 N1=N2=25Hz D1=D2=70Hz Compensator.   Assume we desire positive phase to be added at 40Hz.  We choose N1 N2 and D1 D2 to surround the frequency where the positive phase is desired.  Moving them further apart will increase the amount of positive phase but also increase the added Gain.  Notice the positive phase of 60 degrees at 40Hz which is good.  However the Gain increase in the 1KHz region of about 12db which is bad.  However both are improvements over the D Gain compensator.
===Tuning Master/Slave Configurations===
Master/Slave [ Configurations] allow two (or more) motors to drive the same axis.  Slaves are configured to follow a Master Axis.  For example two lead screws on both sides of a gantry.
Tuning slaved axes is kind of a catch 22.  In order to tune one axis the other axis must be tuned well enough to follow and vice versa.  If possible, disconnect any mechanical linkage between the Master and Slave and test them separately without Slaving the Axes together to verify each axis Servos (can hold a position), moves at least somewhat properly, and moves in the same direction (assuming a positive [ Slave Gain] will be used).
It is usually possible to incrementally tune each axis, at first moving slowly, then later at higher speeds, accelerations, and gains.  Only the Master Axis can be tested with the [ Step Response Screen].  This is because the Slave will follow any movement of the Master, but the Master will not follow movement of the Slave.  So if the Master Axis is moved all is well as both axes will move together, but if you try to move the Slave axis the two axes will fight.  The Master fighting to stay where it is, and the Slave fighting to move.
To test/tune the Slave axis temporarily reverse the Master/Slave roles to make it the Master and then test it as the Master.
Note: only the Master Axis should be included into the Coordinated Motion System.
===Bode Plots===
A Bode Plot is a powerful tool for characterizing and providing insight into a dynamic system. It can help determine closed loop stability, bandwidth/performance, resonant frequencies, and more. It is entirely based on the system being linear. Linear in the sense that if the amplitude of some input signal is changed then the output signal will change proportionally as well. Unfortunately most systems are not entirely linear. Stiction, backlash, encoder quantization, amplifier saturation, and other effects are non-linear. For example driving a system with a signal too small to overcome stiction will result in no output at all whereas a larger signal will result in some output. This is clearly non-linear behavior. It would be nice to use a technique that handles non-linear systems but basically none are known.<br data-attributes="%20/"><br data-attributes="%20/">A Bode Plot is made injecting a stimulus to the system and observing how the system responds. For the reasons of non-linearity it is very important to perform a Bode Plot measurement using a representative level of stimulus similar to what the system will actually have during normal operation. If the Stimulus is not adjusted properly the result is likely to be completely invalid. Additionally the system should be reasonably tuned and stable so that it is responding in a reasonable way to the stimulus. If the system is unstable or very poorly tuned the result is likely to be completely invalid.<br data-attributes="%20/"><br data-attributes="%20/">You might think of it somewhat like shaking a box to determine what is in it. You should shake it with enough intensity and at frequencies to get some reaction, but not so high of intensity to break or distort the object inside.<br data-attributes="%20/"><br data-attributes="%20/">To create a Bode Plot use the KMotion.exe Bode Plot Screen. First select Plot: Time domain - Command, Position, Output vs Time and adjust the Amplitude and cutoff Freq until there is small but significant Position (red) changes (ie 50 encoder counts), at a frequency low enough that the Position at least somewhat attempts to follow the Command (blue), and where the Output (green) is not near saturation for the Drive being used.<br data-attributes="%20/"><br data-attributes="%20/">After the Stimulus/Noise Injection settings are set switch to Plot: Open Loop - Magnitude and Phase vs Frequency. Set the number of Samples to average (ie 20) and perform a Measurement.  &nbsp; [ See here for more information]. ===Links to other Information on Tuning and Bode Plots===[ Introduction section Control Frequency] [ Kollmorgen Use Control Theory to Improve Servo Performance 230712.pdf]
==Problems and Resolutions==
===Hardware-Specific Problems and Resolutions===
:* Place links to pages explaining resolutions to problems that are largely hardware-related
====[[Step/Dir Drives loose lose 2 Steps for each pair of Direction Reversals]]==== 
==Applications and Projects==
:* Place links to pages that explain how you accomplished your particular project.  Write clear explanations that provide background on what you did and how you did it.
====[[Tool Changer - router linear 4 Tools - C Program]][[File:LINEAT+ATC.jpg|none|link=|246x178px]]====
====[[Part Zero & Tool Height Touch Plate|Part Zero & Tool Height Touch Plate]]========[[Driving Hobby Servos]]====[[File:HobbyServo.png|left|link=]]
[[Driving Hobby Servos]]
HiTec Type
HiTec Type
<br   ====Electrical Discharge Machining====[https:/><br /> EDM (wikipedia)]is a method of cutting materials with high precision and detail.  Dynomotion Motion Controllers work well for EDM because of the ability for feedrate to be dynamically controlled including reversal along cutting path.  {{#ev:youtube|kh5EvMAB28A}}  [[Information on BAXEDM Arc Generators used with KFLOP]] 
==How to convert a milling machine to a 3D printer in 3 easy steps==