Difference between revisions of "RemoteControl"
(→CAN Bus and SAMD21)
m (→CAN Bus and SAMD21)
|Line 33:||Line 33:|
CAN is documented on [[Communication]]
CAN is documented on [[Communication]]
As a transmitter, it is packaged in a remote box with joysticks and switches. Functions and pins are explained in TranceiverPins_1_6.docx on https://github.com/elcano/Transceiver/tree/master/Transceiver
As a transmitter, it is packaged in a remote box with joysticks and switches. Functions and pins are explained in TranceiverPins_1_6.docx on https://github.com/elcano/Transceiver/tree/master/Transceiver.
Revision as of 05:03, 9 November 2019
The Elcano system can run autonomously or by remote control. There have been four systems built for manual or remote control.
The first system used an APEM 9000 joystick. The part has five wires: 5V power, ground, and three analog lines. The joystick has two axes. The vertical axis is used for throttle (up) and brakes (down). The third analog signal is the voltage of the joystick when centered. The joystick was used in 2014 and is described in http://www.elcanoproject.org/tutorial/lab2.php. The Low-level code may still contain inputs and processing for an analog joystick.
In 2015 students built a control system using a Bluetooth receiver to the Arduino. The transmitter was a TI Sitara running Android.
Amplitude Shift Keying (ASK) RC Controller
Elcano project used a custom-built radio control system with two arduinos, one in the remote control that collects manual inputs and transmits them with a 433MHz ASK radio transmitter, and one on the Elcano vehicle which receives the information sent over radio and converts it into an ElcanoSerial drive packet which is transmitted to C2 over ElcanoSerial. This information is used to manually drive the trike, begin an autonomous routine, or activate the emergency brake and stop the trike. The RH_ASK system was limited to 40 feet (12 meters) in practice and was never use to drive the vehicle.
CAN Bus and SAMD21
The RC transceiver board can be built five different ways:
- Transmitter using Bluetooth
- Receiver using Bluetooth
- Transmitter using radio (RFM69HCW)
- Receiver using radio (RFM69HCW)
- Receiver using 5 or 6 channel radio control (RC)
When configured as a receiver it is mounted on the vehicle and communicates drive commands over CAN bus.
CAN is documented on Communication
As a transmitter, it is packaged in a remote box with joysticks and switches. Functions and pins are explained in TranceiverPins_1_6.docx on https://github.com/elcano/Transceiver/tree/master/Transceiver%20Documents.
The processor is an Arduino ARM SAMD21 mini dev board, which requires some special steps to install. These are detailed on https://learn.sparkfun.com/tutorials/samd21-minidev-breakout-hookup-guide/setting-up-arduino
Reset requires two quick taps of the reset button. After a reset, the blue LED on the board will pulse slowly for a few seconds. If the board is unresponsive, try resetting this way first.
5- and 6-channel RC Controller
The system has been run from either a Hitec Optics 5 2.4 five channel unit or a Spektrum DX6i six channel controller. The Low level circuit board has a3x7 pin socket in the corner to accommodate the receiver. Each channel needs to be on its own interrupt. Since the Arduino Mega has only 6 interrupts and the Arduino Micro has 5, this can be a problem, especially since we want another one or two interrupts to handle the speed. Low level code may still have software to handle these interrupts. The RC controllers send a 1.0 to 2.0 ms pulse on each channel at 30 Hz. Some controllers send these signals in turn. We have built a six-input OR circuit to combine all signals, which would allow processing with just one interrupt. Unfortunately, there is no good way to predict whether the RC unit will send pulses in turn or all at once. In fact, the behavior seems to be determined by the receive unit, not the transmitter. Thus a separate interrupt is required for each channel used. Interrupt processing consists of interrupting on a rising edge, then switching to a falling edge interrupt and logging the pulse width. A width of 1.0 ms typically means one extreme, 1.5 ms is centered, and 2.0 ms is the other extreme., This system can get confusing about which channel is assigned which behavior, and the two controllers assign their channels differently. To go beyond the Arduino interrupt limit, the V2 Low Level board has all RC inputs assigned to Analog Input 8 to 13 of the Arduino. These pins are used digitally. Pins A8-A15 on Arduino Mega, all go to the same port. Thus we can use the pin change interrupt, which is activated whenever any bit of the 8-bit port changes.
RFM69HCW and SAMD21
The RFM69HCW (915MHz) transceiver offers several benefits over the 433MHz ASK radios:
- greater range with higher transmit power
- much higher raw bitrate
- half-duplex communication and received signal strength indicator (RSSI)
- compatibility with higher-performance 3.3V ARM boards like SAMD21
Using the RF69 RadioHead library, the RC system has expanded capabilities from the RH ASK implementation. Data is stored on both ends as a C struct, which is broken down and transmitted as bytes by the RF69 library. After successful transmission, the data is accessible directly from the struct and variables larger than one byte need no additional processing before use. After successfully receiving a packet from the remote control, the receiver sends a packet back with an RSSI value. The remote control uses this reply message to indicate radio communication is active.
Transmitted data to vehicle
- unsigned 12-bit throttle (0-4095)
- unsigned 12-bit turn
- boolean emergency stop
- boolean autonomous mode
- signed RSSI of last received packet (from vehicle)
Received data from vehicle
- signed RSSI of last received packet (from remote)
NEXT . SensorsPage