Danfoss MCO 305 Operating Instructions Manual page 23

Hide thumbs Also See for MCO 305:
Table of Contents

Advertisement

MCO 305 Operating Instructions
1. Check encoder type and resolution
2. Calculate PID sample time in order to get sufficient resolution
3. Check motion type and select sample time
4. 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 = 0
update_done = 0
save_done = 0
OUT 1 0
OUT 2 0
/**************************** main loop **************************************/
MAIN:
IF (IN 1 == 1) AND (calculation_done == 0) THEN
GOSUB calculation
ELSEIF (IN 2 == 1)AND(update_done == 0)AND(calculation_done == 1) THEN
// Update par. once when in 2 is high and calc. done
GOSUB update_parameters
ELSEIF (IN 3 == 1) AND (update_done == 1) AND (save_done == 0) THEN
// Save parameters once when in 3 high and parameters updated
GOSUB save_par
ELSEIF (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
update_done = 0
save_done = 0
OUT 1 0
OUT 2 0
ENDIF
GOTO MAIN
/********************** Sub programs start **************************************/
SUBMAINPROG
__ How to Install __
// Calculate once when input 1 is high
// Go to calculation routine
// Go to parameter update routine
// Reset flag
// Reset flag
// Reset flag
// Reset output
// Reset output
MG.33.K2.02 – VLT is a registered Danfoss trademark
23

Advertisement

Table of Contents
loading

Table of Contents