
30 |
P a g e
rmcs.begin(&Serial3,9600); //uncomment if using hardware serial port for
mega2560:Serial1,Serial2,Serial3 and set baudrate
This function passes the pointer of serial port to be used. It's used to initialize serial port and set baudrate.
Serial1 : rmcs.begin(&Serial1,9600);
Serial2 : rmcs.begin(&Serial2,9600);
Serial3 : rmcs.begin(&Serial3,9600);
rmcs.begin(&myserial,9600); //uncomment for using software serial and set baudrate
This function is used to set baudrate of Software Serial port. In Arduino Uno software serial should be used.
rmcs.WRITE_PARAMETER(slave_id, INP_CONTROL_MODE, PP_gain, PI_gain, VF_gain, LPR,
acceleration, speed);
This function is used to write all parameters. Confirmation will be sent on Serial port shown as below when
all parameters are written Successfully.
rmcs.READ_PARAMETER(slave_id);
This function read all current parameters and then print on Serial monitor.
Analog Mode:
rmcs.Enable_Analog_Mode(slave_id);
This function will enable your drive in Analog control mode. Speed of motor can be changed by varying
potentiometer.
rmcs.Disable_Analog_Mode(slave_id); // To disable motor in Analog control Mode
This function is used to disable motor in analog control mode.
Digital Speed Control Mode:
rmcs.Speed(slave_id,5000); //enter speed within range of 0-65535
When drive is used in Digital Speed control mode, this function is used to change the speed. Value from 0
to 65535 can be set but all motors have some maximum rpm. When value is more than possible RPM motor
will run at full speed, this may cause jerks in motion commands.