Landing Gear
The landing gear is a subsystem designed to assist testing or, more specifically, maintaining the bike upright when beginning and ending testing. The landing gear is controlled via a toggle switch (Channel 5) on the RC that deploys and retracts the wheels.
Contents
Schematic/Design
The landing gear is a DC motor (MP-36064-540) controlled by two relays (from the relay module) and powered by a standard 9V battery. The two relay's input signals (in3 and in4) is connected to the pins 47 and 48, respectively. As seen on the schematic, the relay's normally open (NO) and normally closed (NC) terminals are either connected to directly to the motor or to the COM of one of the limit switches. The best way to understand the schematic is by understanding what occurs when the relays are on NC or NO. Fundamentally, when the relays are on NC, the motor rotates in one direction. If on NO, the motor turns in the opposite direction. The limit switches are connected in the NC configuration, meaning that the circuit between the relay and the motor is normally closed until the limit switch is triggered. Hence, when one of the arms hits the limit switch, it opens the circuit and causes the motor to stop. Note that triggering one of the limit switches does not prevent the motor turning in the other direction.
Code
Channel 6, originally controlled the landing gear, was changed to switch between the navigation modes. Thus, the landing gear had to be routed to the next available channel, Channel 5. The code simply calls a function from the Landing Gear .cpp file and causes the DUE to provide 5V to the pins corresponding to the relay module. Note that Channel 5 is connected to the right throttle (specifically when one pushes it to the bottom left).* This can be an issue if one is braking the bike and deploying the landing gear at the same time.
Currently, the landing gear is controlled by the upper-left, two-way toggle switch, specifically channel 5 (please look at figure _). Under Landing_Gear.cpp of ROS_arduino_wrapper, two functions LandingGearUp() and LandingGearDown() controls the output (either HIGH or LOW) on the DUE's pins 47 and 48. The function for channel 5 (under RC.cpp) functions using interrupts. Interrupts work by assigning a pin to the interrupt and setting a trigger mode. The trigger mode is set to change so that interrupt triggers both when the pin goes from high to low and from low to high. The RC signal transmitted from the controller is a PWM signal so the interrupt will trigger multiple times per cycle of the signal. When the interrupt triggers the attached function is run. The functions used for RC signals calculate how long the pin was high in microseconds and assign that to a global variable called pulsetime. It is important that any variables used in the interrupt are defined as volatile variables so that the variables are loaded form RAM and not the storage register. The value of pulsetime corresponds to 31 specific positions of the RC switches and analog inputs. Additionally, when an interrupt is triggered the code for the main loop pauses, then code for the interrupt runs to completion, then the main loop continues. Since this can happen multiple times per loop the amount of time spent inside the interrupt should be minimized. Therefore we use the interrupts to calculate pulsetime only and later on in the loop use pulsetime to deploy landing gear or preform other tasks. Basically, once pulsetime reaches a certain value, then the function calls on LandingGearUp() or LandingGearDown() to deploy or retract the landing gear.
Electronics
The landing gear system is an assembly of different electrical components, specifically a relay module, limit switches, and a DC motor. Below are individual sections explaining their characteristics and important notices:
Relay Module [4 Channel 5V Relay Module based on SRD-05VDC-SL-C]
The relay module is 5V (operated by Vcc of 5V) 4 channel relay interface board and has four inputs (IN1-IN4) that control the relays. Each relay has a max output of DC 30V/10A or AC 250V/10V, meaning it can control various equipment with a large current. When a LOW input signal is sent, the normally open contact of the relay is closed. When a HIGH input signal is sent, the normally closed contact is closed.
Limit Switch(es) [V-153-1C25]
The V-153-1C25 is a microswitch that has a rating of 15A at 250V AC with a long hinge lever. The arms of the landing gear hit the switch's trigger directly, the long hinge lever was unnecessary and thus trimmed. It is has an SPDT contact form (meaning it can act either as a NC or a NO microswitch) with quick-connect terminals (soldering is technically not necessary). In addition, it has a maximum operating force of 1.96 N. However, since the type of lever plays a factor in determining the maximum operating force, the maximum operating force is probably higher (remember that the lever was trimmed).
DC Motor [MP-36064-540]
This motor features metal planetary gear motor with a two ball bearings to support the long shaft (the long shaft makes it easy to integrate into various designs). Note that mounting a large load (although it has two ball bearings that make the motor more rigid) will damage the gear motor. The gear ratio is 64:1. Operating voltage is 4.5V - 12V and the operating current is 1A - 42A, where 6.6A is the current that produces peak efficiency. Note that this DC motor is discontinued.
Past and Current Issues
Arms Bending
One of the common problems that persisted with the landing gear was that the arms would bend inwards every time the bike fell onto its side. Hence, a horizontal beam was implemented so that when the bike fell the beam would absorb the impact (not the landing gear's arms). The 'horizontal kickstand' is a wooden beam inserted in one of the holes near the center of bike and secured by a secondary beam. It is important to note that the horizontal kickstand should be closest to its center of mass to reduce any production of angular momentum when hitting the ground. At the ends of the beam pieces of hard rubber was attached to minimize any shock damage towards the bike when it hits the ground. Note that the part number is for the assembly of the motor and the planetary gear system. Separately, the motor's part number is RS-540.
Interruption Bug
The DUE sometimes (specifically when the computer was not connected to the DUE) supplied and cut power (to the relays) at a relatively high frequency. This caused the landing gear to deploy and retract at the same, high frequency, preventing the arms to hit the limit switches. It is thought that as the DUE supplies power to the relays, other functions that the bike is processing interrupts the calling of the landing gear’sfunctionLandingGearUp()/LandingGearDown(), causing the relays to flicker rapidly. To solve the issue, the local variablenumTicksHigh(declared in RC.cpp) is a counter that basically assures that the pulse time(time which the toggle switch is on HIGH) is at the desired value to actuate the landing gear*. In addition, the value desired for pulsetime5 was adjusted to best identify the threshold in which the toggle switch is read as HIGH.