Activity Board (Joystick Circuit):
Here's how it all works!
Lets start with the Activity Board featuring the joystick. The joystick module houses two potentiometers, one for each axis of motion. When you move the joystick in different directions you're actually changing the the resistance of each potentiometer. When a voltage is placed at the modules input the output voltage will fluctuated anywhere from 0 V to 5 V depending on the position of the joystick/potentiometer. Each axis has its own output that feeds into the Activity Board's analog-to-digital converter (ADC) through pins A2 and A3. This is where the data is digitalized or converter to 1's and 0's.
Activity Board (Motor Controller):
The Propeller on the second board outputs a PWM signal through P3 and P4, and these two pins are used to control the "forward" motion of the motors – including turning. Pins P2 and P5 are used to control the "reverse" motion of the same two motors. Each pin is associated with each motors direction. For example P3 drives the right motor in a forward direction and P4 drives the left motor in the forward direction. The same goes for P2 and P5 only they drive the right and left motors in reverse. Another way to look at it is P3 drives the right motor forward, P4 drives the left motor forward, P2 drives the right motor in reverse, and P5 drives the left motor in reverse.
Remember when you inserted the jumpers from P9 to DO and P8 to DI? This is where they become really important. The jumpers connect the Propeller's pins to the XBee module, and once the analog data from the joystick is converted to 1's and 0's it is relayed to the XBee module by the Propeller IC chip using the jumpers on P9 and P8. At this point, the XBee module receives the data and wirelessly transmits it to the second XBee module.
Pololu MC33926 Board:
The Pololu board has two MC33926 H-bridges built onto its PCB. Each H-bridge controls the forward and backward motion of each motor. In order for a motor to go forward, two MOSFETs on opposite ends must be "turned on" creating a very specific path for current to pass. Current must output from one of the H-bridge's MOSFETs and pass through the motor and into a second MOSFET that leads to ground.(See Hbridge_schematic-06.PNG schematic). When current passes through the motor in one direction, it spins the motor accordingly. When the opposite MOSFETs are "turned on" as show in the schematic, they allow current to pass in the opposite direction which leads to spinning the motor in the opposite direction. The MC33926 IC chip has a logic controller inside that helps determine the speed at which the motors spin, giving the PWM duty cycle.
To learn more on the topics discussed in this project, search: H-bridges, PWM, DC Motors, and XBee modules.