Arduino Library - Unimplimented/Undocumented commands

General discussion of the MCP motion controller product line
Post Reply
JorgeP
Posts: 14
Joined: Thu Nov 16, 2017 8:16 am

Arduino Library - Unimplimented/Undocumented commands

Post by JorgeP » Tue Jan 18, 2022 8:28 am

I have been going through the library code and inserted comments, page numbers, and location of documented information. Several of the udocumented commands may be just reserved/empty, but I would like to know if there are any usable undocumented commands not discused in the RoboClaw or MCP User Manuals.

Here is one change in the enum section I am working on in MCP2x.h which is a modified clone of RoboClaw.h . I hope someone else takes time to document the largly undocumented code because this is a ton of work to figure out what someone else was doing without any further information except the manuals.

Code: Select all

	enum {  
			M1FORWARD					=   0, // MCP User Manual Page 68
			M1BACKWARD 					=   1, // MCP User Manual Page 68
			SETMINMB 					=   2, // MCP User Manual Page 68
			SETMAXMB 					=   3, // MCP User Manual Page 69
			M2FORWARD 					=   4, // MCP User Manual Page 69
			M2BACKWARD 					=   5, // MCP User Manual Page 69
			M17BIT 						=   6, // MCP User Manual Page 69
			M27BIT 						=   7, // MCP User Manual Page 69
			MIXEDFORWARD 				=   8, // MCP User Manual Page 70
			MIXEDBACKWARD 				=   9, // MCP User Manual Page 70
			MIXEDRIGHT 					=  10, // MCP User Manual Page 70
			MIXEDLEFT 					=  11, // MCP User Manual Page 70
			MIXEDFB 					=  12, // MCP User Manual Page 70
			MIXEDLR 					=  13, // MCP User Manual Page 70
			SETSERIALTIMEOUT			=  14, // RoboClaw User Manual Page 66 - Not Programed
			GETSERIALTIMEOUT			=  15, // RoboClaw User Manual Page 66 - Not Programed
			GETM1ENC 					=  16, // MCP User Manual Page  89
			GETM2ENC 					=  17, // MCP User Manual Page  90
			GETM1SPEED 					=  18, // MCP User Manual Page  90
			GETM2SPEED 					=  19, // MCP User Manual Page  90
			RESETENC 					=  20, // MCP User Manual Page  90
			GETVERSION 					=  21, // MCP User Manual Page 72
			SETM1ENCCOUNT 				=  22, // MCP User Manual Page 91
			SETM2ENCCOUNT 				=  23, // MCP User Manual Page 91
			GETMBATT 					=  24, // MCP User Manual Page 72
			GETLBATT 					=  25, // MCP User Manual Page 72
			SETMINLB 					=  26, // MCP User Manual Page 73
			SETMAXLB 					=  27, // MCP User Manual Page 73
			SETM1PID 					=  28, // MCP User Manual Page 93
			SETM2PID 					=  29, // MCP User Manual Page 93
			GETM1ISPEED 				=  30, // MCP User Manual Page 91
			GETM2ISPEED 				=  31, // MCP User Manual Page 91
			M1DUTY 						=  32, // MCP User Manual Page 93
			M2DUTY 						=  33, // MCP User Manual Page 94
			MIXEDDUTY 					=  34, // MCP User Manual Page 94
			M1SPEED 					=  35, // MCP User Manual Page 94
			M2SPEED 					=  36, // MCP User Manual Page 94
			MIXEDSPEED 					=  37, // MCP User Manual Page 94
			M1SPEEDACCEL 				=  38, // MCP User Manual Page 95
			M2SPEEDACCEL 				=  39, // MCP User Manual Page 95
			MIXEDSPEEDACCEL 			=  40, // MCP User Manual Page 95
			M1SPEEDDIST 				=  41, // MCP User Manual Page 96
			M2SPEEDDIST 				=  42, // MCP User Manual Page 96
			MIXEDSPEEDDIST 				=  43, // MCP User Manual Page 96
			M1SPEEDACCELDIST 			=  44, // MCP User Manual Page 96
			M2SPEEDACCELDIST 			=  45, // MCP User Manual Page 96
			MIXEDSPEEDACCELDIST 		=  46, // MCP User Manual Page 98
			GETBUFFERS 					=  47, // MCP User Manual Page 98
			GETPWMS 					=  48, // MCP User Manual Page 73
			GETCURRENTS 				=  49, // MCP User Manual Page 73
			MIXEDSPEED2ACCEL 			=  50, // MCP User Manual Page 98
			MIXEDSPEED2ACCELDIST 		=  51, // MCP User Manual Page 99
			M1DUTYACCEL 				=  52, // MCP User Manual Page 99
			M2DUTYACCEL 				=  53, // MCP User Manual Page 99
			MIXEDDUTYACCEL 				=  54, // MCP User Manual Page 100
			READM1PID 					=  55, // MCP User Manual Page 100
			READM2PID 					=  56, // MCP User Manual Page 100
			SETMAINVOLTAGES 			=  57, // MCP User Manual Page 73
			SETLOGICVOLTAGES 			=  58, // MCP User Manual Page 74
			GETMINMAXMAINVOLTAGES 		=  59, // MCP User Manual Page 74
			GETMINMAXLOGICVOLTAGES 		=  60, // MCP User Manual Page 74
			SETM1POSPID 				=  61, // MCP User Manual Page 100
			SETM2POSPID 				=  62, // MCP User Manual Page 100
			READM1POSPID 				=  63, // MCP User Manual Page 101
			READM2POSPID 				=  64, // MCP User Manual Page 101
			M1SPEEDACCELDECCELPOS 		=  65, // MCP User Manual Page 101
			M2SPEEDACCELDECCELPOS 		=  66, // MCP User Manual Page 101
			MIXEDSPEEDACCELDECCELPOS 	=  67, // MCP User Manual Page 101
			SETM1DEFAULTACCEL 			=  68, // MCP User Manual Page 101
			SETM2DEFAULTACCEL 			=  69, // MCP User Manual Page 102

			/* Not Implimented
			SETM1DEFAULTSPEED			=  70, // RoboClaw User Manual Page 70
			SETM2DEFAULTSPEED			=  71, // RoboClaw User Manual Page 70
			GETSPEEDSETTINGSM1M2		=  72, // RoboClaw User Manual Page 70
			*/

			/* Not Documented
				73,
			*/

			SETPINFUNCTIONS 			=  74, // RoboClaw User Manual Page 71
			GETPINFUNCTIONS 			=  75, // RoboClaw User Manual Page 71
			SETDEADBAND					=  76, // RoboClaw User Manual Page 71
			GETDEADBAND					=  77, // RoboClaw User Manual Page 72
			GETENCODERS 				=  78, // MCP User Manual Page  91
			GETISPEEDS 					=  79, // MCP User Manual Page  91
			RESTOREDEFAULTS 			=  80, // MCP User Manual Page 74

			/* Not Implimented
			GETDEFAULTDUTYACCEL			=  81, // MCP User Manual Page 102
			*/

			GETTEMP 					=  82, // MCP User Manual Page 74
			GETTEMP2 					=  83, // MCP User Manual Page 74 //Only valid on some models

			/* Not Documented
				84,
				85,
				86,
				87,
				88,
				89,
			*/

			GETERROR 					=  90, // MCP User Manual Page 75
			GETENCODERMODE 				=  91, // MCP User Manual Page 75
			SETM1ENCODERMODE 			=  92, // MCP User Manual Page 75
			SETM2ENCODERMODE 			=  93, // MCP User Manual Page 75
			WRITENVM 					=  94, // MCP User Manual Page 75
			READNVM 					=  95, // MCP User Manual Page 76	//Reloads values from Flash into Ram

			/* Not Documented
				96,
				97,
			*/

			SETCONFIG					=  98, // RoboClaw User Manual Page 75
			GETCONFIG 					=  99, // RoboClaw User Manual Page 76

			/* Not Implimented
			SETCONTROLMODES				= 100, // RoboClaw User Manual Page 76
			GETCONTROLMODES				= 101, // RoboClaw User Manual Page 76
			SETCONTROL1					= 102, // RoboClaw User Manual Page 76
			SETCONTROL2					= 103, // RoboClaw User Manual Page 77
			GETCONTROLMODES2			= 104, // RoboClaw User Manual Page 77 (Same as 101?)
			SETAUTOHOMINGM1				= 105, // RoboClaw User Manual Page 77
			SETAUTOHOMINGM2				= 106, // RoboClaw User Manual Page 77
			GETAUTOHOMING				= 107, // RoboClaw User Manual Page 77
			GETMOTORAVGSPEED			= 108, // RoboClaw User Manual Page 89
			SETSPEEDERRORLIMITS			= 109, // RoboClaw User Manual Page 77
			GETSPEEDERRORLIMITS			= 110, // RoboClaw User Manual Page 78
			GETSPEEDERRORS				= 111, // RoboClaw User Manual Page 89
			SETPOSITIONERRORLIMITS		= 112, // RoboClaw User Manual Page 78
			GETPOSITIONERRORLIMITS		= 113, // RoboClaw User Manual Page 78
			GETPOSITIONERRORS			= 114, // RoboClaw User Manual Page 89
			SETBATTERYVOLTAGEOFFSETS	= 115, // RoboClaw User Manual Page 78
			GETBATTERYVOLTAGEOFFSETS	= 116, // RoboClaw User Manual Page 78
			SETCURRENTBLANKINGPERCENT	= 117, // RoboClaw User Manual Page 78
			GETCURRENTBLANKINGPERCENT	= 118, // RoboClaw User Manual Page 78
			BUFFEREDDRIVEM1WPOS			= 119, // RoboClaw User Manual Page 100
			BUFFEREDDRIVEM2WPOS			= 120, // RoboClaw User Manual Page 100
			BUFFEREDDRIVEMIXEDWPOS		= 121, // RoboClaw User Manual Page 100
			BUFFEREDDRIVEM1WSPEEDPOS	= 122, // RoboClaw User Manual Page 100
			BUFFEREDDRIVEM2WSPEEDPOS	= 123, // RoboClaw User Manual Page 100
			BUFFEREDDRIVEMIXEDWSPEEDPOS	= 124, // RoboClaw User Manual Page 100
			*/

			/* Not Documented
				125,
				126,
				127,
			*/

			/* Not Implimented
			SETINDRESM1					= 128, // MCP User Manual Page 76
			SETINDRESM2					= 129, // MCP User Manual Page 76
			GETINDRESM1					= 130, // MCP User Manual Page 76
			GETINDRESM2					= 131, // MCP User Manual Page 76
			*/

			/* Not Documented
				132,
			*/

			SETM1MAXCURRENT 			= 133, // MCP User Manual Page 76
			SETM2MAXCURRENT 			= 134, // MCP User Manual Page 76
			GETM1MAXCURRENT 			= 135, // MCP User Manual Page 77
			GETM2MAXCURRENT 			= 136, // MCP User Manual Page 77

			/*
			SETDOUTACTION				= 137, // MCP User Manual Page 77
			GETDOUTACTION				= 138, // MCP User Manual Page 77
			SETPRIORITYLEVELS			= 139, // MCP User Manual Page 78
			GETPRIORITYLEVELS			= 140, // MCP User Manual Page 78
			SETMMADDFLAGS				= 141, // MCP User Manual Page 78
			GETMMANDFLAGS				= 142, // MCP User Manual Page 78
			SETSIGPROPERTIES			= 143, // MCP User Manual Page 79
			GETSIGPROPERTIES			= 144, // MCP User Manual Page 81
			SETSTREAMPROPERTIES			= 145, // MCP User Manual Page 82
			GETSTREAMPROPERTIES			= 146, // MCP User Manual Page 82
			GETSIGNALVALUES				= 147, // MCP User Manual Page 82
			*/

			SETPWMMODE 					= 148, // MCP User Manual Page 82
			GETPWMMODE 					= 149, // MCP User Manual Page 83

			/* Not Documented
				150,
			*/

			/* Not Implimented
			SETESTOPRESET					= 200, // MCP User Manual Page 83
			SETESTOPLOCKUNLOCKRESET			= 201, // MCP User Manual Page 83
			GETESTOPLOCK					= 202, // MCP User Manual Page 83
			*/

			/* Not Documented
				203,
				204,
				205,
				206,
				207,
				208,
				209,
				210,
				211,
				212,
				213,
				214,
				215,
				216,
				217,
				218,
				219,
				220,
				221,
				222,
				223,
				224,
				225,
				226,
				227,
				228,
				229,
				230,
				231,
				232,
				233,
				234,
				235,
				236,
				237,
				238,
				239,
				240,
				241,
				242,
				243,
				244,
				245,
			*/

			/* Not Implimented
			SETSCRIPTAUTORUNDELAY			= 246, // MCP User Manual Page 83
			GETSCRIPTAUTORUNDELAY			= 247, // MCP User Manual Page 83
			STARTSCRIPT						= 248, // MCP User Manual Page 83
			STOPSCRIPT						= 249, // MCP User Manual Page 84
			*/

			/* Not Documented
				250,
				251,
			*/

			/* Not Implimented
			GETUSEREEPROMWORD				= 252, // MCP User Manual Page 84
			SETUSEREEPROMWORD				= 253, // MCP User Manual Page 84
			*/

			/* Not Documented
				254,
			*/

			FLAGBOOTLOADER 					= 255};	//Only available via USB communications
I also tried formatting everything to be much easier to read and find the appropriate documentation. The forum may trash some of that formatting.

I see there are many Common Commands for all devices, and some that will only work on specific devices, I am hoping to seperate out everything into seperate .h .c files to be more manageble. I am sort of confused with the naming conventions used but I realy want to change everything to be a tad more intuitive. Don't get me wrong, the Developer who wrote this lib spent alot of time and effort and I greatly appreciate his/her work.

I don't expect this to be finished any time soon. Any information will help greatly!
JorgeP

Post Reply