Danfoss MCO 305 Operating Instructions Manual page 24

Hide thumbs Also See for MCO 305:
Table of Contents

Advertisement

MCO 305 Operating Instructions
/************************** Calculation *****************************************/
SUBPROG calculation
IF (GET ENCODERTYPE != 0) THEN
eres = (4 * GET ENCODER)
// Encoder resolution (par. 3201) multiplied by 4 (qc) when incremental encoder
ELSEIF (GET ENCODERABSTYPE != 0) THEN
eres = (GET ENCODERABSRES)
ENDIF
new_timer = 1 + (6000000 rnd ((GET 1900) * eres))
IF (GET 1901 == 1) THEN
tsample = ((GET PROFTIME) rnd 1000)
// tsample must be PROFTIME (par. 3270) when SYNCV is selected
ELSE
tsample = new_timer
ENDIF
TempFF = (629145600 rnd (GET 1900) rnd eres * 100 rnd tsample)
calculation_done = 1
OUT 1 1
RETURN
/************************** Update parameters ************************************/
SUBPROG update_parameters
SET TIMER new_timer
SET FFVEL TempFF
SET KPROP (TempFF rnd 50)
SET KDER (TempFF rnd 10)
SET KINT 5
update_done = 1
OUT 2 1
RETURN
/************************* Save parameters **************************************/
SUBPROG save_par
SAVE AXPARS
save_done = 1
RETURN
/************************** Error handler ****************************************/
SUBPROG errhandle
err = 1
// Set error flag to remain in error handler until error is reset.
OUT 8 1
// Set error output
WHILE err DO
IF IN 8 THEN
ERRCLR
err=0
ENDIF
ENDWHILE
OUT 8 0
RETURN
/******************************************************************************/
ENDPROG
/*************************** End of program **************************************/
24
__ How to Install __
// Check incremental encoder type
// Check absolute encoder type
// Absolute encoder resolution (par. 3203).
// Calculation of PID sample time.
// Check motion type
// tsample must be TIMER (par. 3269) for all other motion types
// Set done flag to ensure calculation is done only once.
// Set "Calculation done" output
// Set new PID sample time.
// Set FFVEL to result of calculations
// P = FFVEL divided by 50
// D = FFVEL divided by 10
// I is set to 5
// Set done flag to ensure update is done only once.
// Set "Parameters Updated" output
// Save new parameter settings.
// Set done flag to ensure update is done only once.
// Remain in error handler until the reset is received
// Reset error when Input 8 is high.
// Clear error
// Reset error flag
// Reset error output
MG.33.K2.02 – VLT is a registered Danfoss trademark
// Calculate Feed-forward

Advertisement

Table of Contents
loading

Table of Contents