MCO 305 Operating Instructions__ How to Install __MG.33.K2.02 – VLT is a registered Danfoss trademark 231. Check encoder type and resolution2. Calculate PID sample time in order to get sufficient resolution3. Check motion type and select sample time4. Calculate Feed-Forward.Parameters are updated when setting input 2.The updated parameters can be saved by setting input 3.New calculation is enabled by setting input 4./*****************************************************************************/// Inputs: 1 Start calculation// 2 Set parameters// 3 Save updated parameters// 4 Enable new calculation// 8 Clear Error// Outputs: 1 Calculation done// 2 Parameters updated// 8 Error/******************************** Interrupts ***********************************/ON ERROR GOSUB errhandle/* In case of error go to error handler routine, this must always be included *//*********************** Define application parameters ***************************/LINKGPAR 1900 "Encoder velocity" 0 1073741823 0// Specify encoder velocity in RPM at maximum reference (par. 303)LINKGPAR 1901 "Motion type" 0 1 0// Feed-Forward calculation is different for SYNCV compared to all other motions:// Select "1" to make the calculation for SYNCV applications, select "0" for all other applications./********************** Initializing flags and outputs ******************************/calculation_done = 0update_done = 0save_done = 0OUT 1 0OUT 2 0/**************************** main loop **************************************/MAIN:IF (IN 1 == 1) AND (calculation_done == 0) THEN // Calculate once when input 1 is highGOSUB calculation // Go to calculation routineELSEIF (IN 2 == 1)AND(update_done == 0)AND(calculation_done == 1) THEN// Update par. once when in 2 is high and calc. doneGOSUB update_parameters // Go to parameter update routineELSEIF (IN 3 == 1) AND (update_done == 1) AND (save_done == 0) THEN// Save parameters once when in 3 high and parameters updatedGOSUB save_parELSEIF (IN 4 == 1)AND(IN 1 == 0)AND(IN 2 ==0) THEN// Enable new calculation when input 4 is high and input 1/2 low.calculation_done = 0 // Reset flagupdate_done = 0 // Reset flagsave_done = 0 // Reset flagOUT 1 0 // Reset outputOUT 2 0 // Reset outputENDIFGOTO MAIN/********************** Sub programs start **************************************/SUBMAINPROG