Electromechanical Design - Team 1

The drive motor, a 12v brushed DC gearmotor, was driven by an L298N chip. This provided directional and speed control for the single motor. The L298N included a breakout board with anti-flyback diodes and capacitors to smooth out voltage spikes. The L298N board received DC input power directly from the battery. It received its 5vdc logic voltage supply from a regulated 5v output on the microcontroller. The on board voltage regulator on the L298N breakout was disabled with a jumper because the battery voltage exceeded its nominal limit. Two input signals on the L298N board (IN1 and IN2) were connected to digital outputs on the microcontroller. These provided direction control. The enable pin, (ENA), was wired to a PWM capable output pin on the microcontroller. This varied the duty cycle for speed control. The L298N board is shown in the image below. The drive motor is also shown with a flag of tape to visualize rotation during testing.


The steering actuator, a 180 degree position control 5vdc servo,  was wired to a 5v source for power and a PWM output on the microcontroller for its position signal. Current measurements during early testing showed that this servo would draw approximately 2A when under load. This greatly exceeds the maximum current draw of the microcontroller’s regulated 5v output, requiring a dedicated 5vdc power source. Three L7805CV linear 5v regulators were used in parallel to provide a 5v source to the servo. These inefficient regulators are an extremely cost effective option, and long battery life was not a concern. Although only 2 regulators in parallel would’ve been sufficient to provide enough current to the servo, a third was included to reduce the throughput of each one to prevent overheating. The servo is shown below with a flag of tape to visualize rotation during testing.

A custom battery was assembled to meet the needs of the system. A lithium ion battery composed of 18650 cells was chosen for its excellent power density, and low cost. 6 cells were arranged in a 3S2P configuration to provide a maximum voltage of 12.6VDC. This was sufficient to power the drive motor. The additional cells in parallel increased the power capacity and discharge current capability. The nominal capacity of the battery was 7Ah and  maximum continuous discharge capability was 14A. This exceeds the power requirements of all electronic components. The cells were spot welded together with nickel strips. An XT60 connector was installed for the main power discharge, and a 4 pin JST connector was installed for balance charging. Images of the battery assembly before the outer heat shrink layer was installed are shown below.

An Arduino Uno was chosen as the microcontroller for several reasons. It can tolerate the full battery voltage on its power input pin, unlike many other options which would require additional voltage regulators. Its output pins operate at 5v logic level, ensuring direct compatibility with the servo, L298N, and radio receiver without requiring level shifters. It also has more than enough PWM outputs. The uno is a versatile microcontroller that is extremely easy to program. The microcontroller is shown in the image below, screwed into place within its PLA enclosure using heat set inserts. 

The receiver/transmitter was a no-name amazon brand. It was simply the cheapest PWM style receiver/transmitter combo with at least 2 channels. The transmitter includes a bidirectional knob for steering, and a bidirectional trigger for throttle. Each outputs a PWM signal from the receiver. The two channels are each connected to a digital input pin on the microcontroller, and the receiver takes its 5v power source from the microcontroller’s regulated 5VDC supply. The radio receiver is pictured below.

A custom proto-board was soldered together to connectorize all inputs and outputs to the microcontroller. This provided greater reliability and organization than standard dupont style breadboard connectors. This protoboard also included the linear voltage regulators and provided power distribution to the various components. The protoboard was mounted atop the arduino uno using all of its dupont pins for mechanical stability. Hot glue fixed the board to the arduino to ensure no vibration could cause pins to loosen. The images below show the protoboard alone, and as installed on the microcontroller.

The wiring diagram below shows all the electronic components as assembled in the final functional robot.

Note: "µc" is shorthand for microcontroller

The code running on the microcontroller is a simple program which reads the PWM signals coming from the receiver via the arduino PulseIn() function. The arduino outputs appropriate PWM signals to both the L298N board and the servo corresponding to the controls from the transmitter. 

The pulse width value from the steering channel is mapped to a range corresponding to the desired travel of the servo. An offset is applied to trim the steering and ensure straight travel without steering input. This mapping allows the operator to use the full physical range of the steering knob on the transmitter to precisely control a small portion of the servo’s complete range of motion. This also prevents the possibility of the servo overdriving the gait adjustment mechanism outside of its mechanical limits. 

The pulse width value from the throttle channel is between 1500µs and 2000µs for the forward direction. The value is 1000µs to 1500µs in the reverse direction. The code determines the desired motor rotation direction and magnitude. It then gradually ramps the motor up or down to this desired speed by incrementally adjusting the duty cycle applied to the ENA pin via the AnalogWrite() function. This gradual ramp up prevents sudden spikes in current draw, as well as sudden torque on the timing pulley which may cause the belt to slip. 

All final code used in this project may be downloaded or viewed here: https://github.com/ClayBuilds/RMD-GROUP-1-HEXAPEDAL-GAIT-ADJUSTMENT-ROBOT


The video below shows the electronics being tested before integrating them into the mechanical parts of the system.


< Prev Page        Next Page >