%Select control parameter set
%
%This command sets the control parameters (P-gain,D-gain,Dead-band)
%according to the parameter sets 1-3 stored in the EEPROM. Values
%other than 1-3 always select parameter set 3.
%
%Parameter set 1 is loaded at power-on.

function ctrlParamSet(H,param_set)

globalVar;
servoReturn1 = 3;   %valores definido no datasheet
servoReturn2 = 6;   

command = CTRL_PARAM_SET;
param1 = 0;
param2 = param_set;
checksum = 256 - mod((STARTBYTE+command+param1+param2),256);

sendMessage(H,command,param1,param2,checksum);
[return1,return2]=readMessage(H);

if((servoReturn1 ~= return1) || (servoReturn2 ~= return2))
    err = ERR_CTRL_PARAM_SET;
    errfcn(H,err);
end
