0

Soccer Robot C - Hardware 2

1. Motors

First, check the motors. Issue command "mot" and make sure that the motors rotate in the sequence indicated by red numbers: first 1, then 2, ... Each of them must rotate first clockwise, then anticlockwise. It is important that You establish this pattern. Otherwise, the algorithm for driving the robot in the desired direction will not work.

If the sequence is not right, revisit the page that shows how to connect the motors. Alternatively, rearrange cables that connect motor controller and the motors, after noticing the error in sequence.

If any of the motors doesn't start clockwise, but anticlockwise, You will have to change the program. Use Notepad++, or some other editor (even Notepad is OK) to open C:\Users\[Your login name]\Documents\Arduino\libraries\mrm-robot\src\mrm-robo-soccer.cpp and find the lines similar to these, at the beginning of the program:
	mrm_mot4x3_6can->directionChange(0); // Uncomment to change 1st wheel's rotation direction
	mrm_mot4x3_6can->directionChange(1); // Uncomment to change 2nd wheel's rotation direction
	mrm_mot4x3_6can->directionChange(2); // Uncomment to change 3rd wheel's rotation direction
	mrm_mot4x3_6can->directionChange(3); // Uncomment to change 4th wheel's rotation direction
Comment lines that correspondent to the wheels that rotate in the wrong direction by putting "//" in the front of that line. For example, if motors 2 and 4 misbehave, the result will look like this:
	mrm_mot4x3_6can->directionChange(0); // Uncomment to change 1st wheel's rotation direction
	//mrm_mot4x3_6can->directionChange(1); // Uncomment to change 2nd wheel's rotation direction
	mrm_mot4x3_6can->directionChange(2); // Uncomment to change 3rd wheel's rotation direction
	//mrm_mot4x3_6can->directionChange(3); // Uncomment to change 4th wheel's rotation direction
Run "mot" again to verify that everything works fine.

Lidars

Lidars must be ordered according to green numbers. Number 1 should denote "Lidar4m-0", 2 "Lidar4m-1", etc. Issue "li4" command and but an obstacle in front of each sensor to verify. If they are not ordered properly, either use "idc" command to change addresses or reassemble the sensors. The former option is faster.

Reflective sensors

Reflective sensors must obey blue numbers. If not so, You will be forced to reassemble them. "idc" will not help You because only 4 sensors are supported, so You will not have a placeholder for address change.