At a glance, BusinessBot utilizes our unique IR sweep to actively find any active miners in a 270° band around the robot. Once located, using a number of nested controllers, the vehicle navigates quickly to the miner, picks it up with two electromagnets, and drives it to a desired square.
During the first phase of operation, the servo at the top of the robot passive rotates back and forth. The two IR sensors on top of the servo and one stationary IR sensor all have a number of filtering stages which ensure that any IR pulses are cleanly and robustly turned into digital signals. Whenever the IR sensor attached to the servo senses a miner, it finds the period of the signal and alerts the motion controller which miner was sensed. Importantly, since the servo is constantly setting the desired angle to a specific value, the current angle is grabbed from the servo control, allowing for the motion controller to know both which miner is sensed and at what angle with respect to its neutral heading (i.e. straight forward).
Meanwhile, the SPUD is being constantly queried and, whenever new information is found regarding the state of the field, the data is stored in the microcontroller’s game state. So, once a miner is found, the game state is cross-referenced to see if the miner is grabbable, meaning that the miner is either a friendly miner in a non-scoring square or an enemy miner in a scoring square. If either of these are met, the vehicle begins moving towards the miner.
Using one magnetic encoder per wheel, each wheel has a PI controller which allows for a specific RPM to be commanded per wheel. With this functionality, a forward velocity is set such that both wheels move at the same RPM. But, in order to allow our robot to turn while moving forward, the speed set function also allows for a spin factor to be introduced, which represents a ratio of how much the robot should turn while moving forward. Because the IR sweep is still actively sensing the miner as the vehicle moves towards it, the vehicle is able to move towards the miner without accurately initially aligning with it, since any updated angular offset readings from the sweep allow for heading corrections while moving.
Two electromagnets serve as grippers which attach onto the ferrous flange on each miner. A limit switch is carefully placed so that, when the electromagnets clamp onto the miner, the switch is depressed, thereby informing the motion controller that the move to miner phase of motion has successfully been completed.
Once the miner is grabbed, the SPUD is queried for possible drop off locations for the grabbed miner. If no valid scoring squares for a friend miner exist, or if the grabbed miner is an enemy miner, then the motion controller simply opts to put the miner in any different square. Once a desired square is determined, BusinessBot’s color sensor reads the current location of the vehicle and uses the Center of Squares (CoS) algorithm to choose a rough initial trajectory upon which to embark. Whenever the vehicle enters a new square, the motion controller assumes that its current location on the board is at the location exactly halfway between the middle of the square it was just in and the middle of the square it just entered—this logic allows for accurate calculations of the desired angular heading to take. The on-board accelerometer allows for accurate measurements of the heading of the robot with respect to the uphill incline. With these two angles combined, an angular error can be derived, allowing for the vehicle to move in a similar fashion when moving to the miner—the vehicle can move forward with a desired velocity, but can use the spin factor to turn while moving to correct for this heading error. Once the SPUD notifies the motion controller that the held miner has now reached a desirable square, the miner is dropped and the robot returns to the sweeping phase.
By constantly sampling the location of miners with the IR sweep, the motion controller is highly robust to erroneous measurements. Combined with significant move-mean and peak filtering on both the color sensor and on the accelerometer, both the move to miner and move to square controllers were able to operate smoothly.