This section will discuss the signals from the FS-iA6B receiver to the Arduino that indicate the FS-i6X transmitter’s right stick position. Additionally, this section covers the signals from the Arduino to the motor controller that direct the speed and direction of the tanks four wheels.
Set controller to PWM (pulse width modulation) instead of PPM (pulse position modulation).
With PWM each pin outputs one channel from the transmitter. For example up/down is one channel and left/right is a different channel. In contrast, all 6 channels that the FS-i6X outputs is sent on one pin using PPM. Here are some images to illustrate the differences
This can be configured in the settings of the FS-i6X transmitter but here are what they are set to for this project.
Both signals have a 50Hz frequency
|Chanel||Direction||PWM Width||PPM Width|
|ch1 (right joystick left/right)||left||1ms||.6ms|
|ch2 (right joystick up/down)||up||1ms||.6ms|
|ch3 (left joystick up/down)||down||1ms||.6ms|
|ch4 (left joystick left/right)||left||1ms||.6ms|
|ch5 (Switch C)||forward||1ms||.6ms|
|ch6 (Switch B)||forward||1ms||.6ms|
|Switch A not set to a channel|
|Switch D not set to a channel|
Because we only need two channels (right joystick up/down and left/right) we will use PWM as it will be easier to code.
The Arduino is hooked up the the receiver and is receiving signals indicating the position of the right joystick on the transmitter. With this we will need to code the Arduino to produce an output that will drive the motor controller. In this section we are going to look at the signal that needs to be produced by the Arduino.
The device the Arduino is driving is this motor controller.
On the left side of the board there are the pins that control the four motors.
Here is a graphic showing the different combinations of the **direction **and **PWM **pins for CH1 = motor 1
For the tank to move the motors need to spin in different directions to perform different maneuvers. Here is a chart showing the motor directions. Note that M1 and M3 always spin in the same direction. The same is true for M2 and M4
We have looked at the different signals that we will be dealing with in this project. To drive the tank we will need to take the signal from the receiver and determine which way to spin the motors. Then generate a signal with the Arduino that tells the motor controller which direction to spin the motors to perform the desired maneuver.