Adaptive Speed Control System for Smart Wheelchairs on Uneven Terrain
by rifqieeeee in Circuits > Assistive Tech
1331 Views, 12 Favorites, 0 Comments
Adaptive Speed Control System for Smart Wheelchairs on Uneven Terrain
Problem:
Individuals with mobility impairments often experience discomfort and back pain when using motorized wheelchairs on uneven terrains. Discord user Paul highlights the limitations of conventional wheelchair designs, emphasizing the challenges posed by seemingly smooth surfaces. Drew shares similar concerns about the inadequacy of off-road power chairs, pointing out difficulties with bumps and lips. These user experiences underscore the need for innovative solutions that go beyond traditional wheelchair design.
Solution:
Our project introduces an Adaptive Speed Control System to address the challenges faced by users of motorized wheelchairs. This cutting-edge system incorporates advanced sensor technologies, such as an Inertial Measurement Unit (IMU) for terrain detection and ultrasonic sensors for obstacle avoidance. The central control unit, Swan MCU, forms the core of the system. Users can easily navigate through three speed settings—slow, medium, and fast—using a simple button controller. A proactive warning system alerts users to uneven pathways, empowering them to make informed route decisions. This comprehensive approach not only minimizes discomfort and back pain but also enhances safety, providing a confident and comfortable mobility experience for individuals with disabilities.
How It Works:
The system continuously monitors the wheelchair's surroundings through integrated sensors. The IMU sensor detects variations in terrain, prompting the Swan MCU to autonomously adjust the wheelchair's speed based on road conditions. Ultrasonic sensors contribute to obstacle detection, preventing collisions and improving safety. The simple button controller offers an intuitive interface for speed control. The proactive warning system utilizes real-time data to alert users to bumpy roads ahead, enabling them to choose smoother paths. This user-centric approach revolutionizes the motorized wheelchair experience, prioritizing comfort, safety, and ease of use for individuals with mobility impairments.
Supplies
Hardware Components:
- Blues Swan
- SparkFun Triple Axis Accelerometer and Gyro Breakout - MPU-6050
- DC Motor, 12 V (2pcs)
- DRV8833 Dual H-Bridge Motor Driver
- DC Motor Wheel (2pcs)
- Lipo Battery 12V
- Step Down Module LM2596 DC 3A
- Push Button (4pcs)
- Cut Acrylic Board
- Printed Circuit Board a.k.a. PCB
- Pin Header
- Some cables
Software Apps:
Hand Tools and Fabrication Machines:
- Soldering Iron and Solder Tin
- Hot Glue Gun
Setting Up Swan With Arduino IDE
Swan, a cost-effective microcontroller built on STM32L4, is engineered to streamline the development and deployment of battery-powered IoT solutions. Particularly suitable for projects demanding substantial memory and expandability at an affordable cost, such as edge inferencing and remote monitoring, Swan is Feather-compatible, lending versatility to both preliminary testing and large-scale endeavors. Developers can seamlessly integrate Swan with Adafruit's sensors and FeatherWing-compatible carriers. For economical deployment, Swan can be directly soldered onto a parent PCB, harnessing its complete I/O capabilities.
Swan provides three power options – USB, battery, or line power – and features a software-switchable 2 Amp regulator for external sensor power. In low-power mode, Swan draws a mere 8uA while retaining all its memory, making it ideal for battery-operated devices. It supports multiple programming languages, including C/C++, Arduino, and CircuitPython, and is equipped with a CORTEX Debug connector for advanced development using Visual Studio Code, IAR, and STM32CubeIDE.
To initiate the use of the Swan board with Arduino IDE, the initial step involves preparing and installing the necessary drivers. Begin by adding the following URL to the Additional Boards URL in Preferences:
https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json
Once this step is complete, navigate to Tools > Board, select "STM32 Boards groups," and then choose "Blues Wireless boards." Subsequently, under Tools > Board Part Number, opt for "Swan R5". Please see figure 1.1. and figure 1.2.
For Swan programming without using the STLink-V3Mini, go to Tools > Upload method and select "STM32CubeProgrammer (DFU)." Connect Swan to your computer using a USB cable, plugging it into the Micro USB port. To enter the bootloader mode on Swan, press and hold the BOOT button, press and release RESET, and then release BOOT. It is essential to follow this sequence each time firmware needs to be uploaded to Swan. Please see figure 1.3.
With these preparations completed, proceed to the next step by following the instructions to Blink the Onboard LED. This ensures that the Swan board is ready for further development and testing with the Arduino IDE.
Testing the MPU6050 Sensor
The MPU6050 stands as a widely recognized inertial measurement unit (IMU) that seamlessly combines a gyroscope and accelerometer within a single integrated circuit. Originating from InvenSense, now part of TDK, the MPU6050 finds extensive application in electronic projects, robotics, and motion sensing endeavors. Its gyroscope measures angular velocity, offering insights into the rate of rotation across three dimensions, while the accelerometer gauges acceleration within those same dimensions. Through the amalgamation of data from both sensors, the MPU6050 delivers precise information regarding the device's orientation and motion. Renowned for its compact size, low power consumption, and dependable performance, this sensor communicates with microcontrollers via I2C (Inter-Integrated Circuit) or other communication protocols, facilitating its integration into diverse electronic systems. It proves particularly valuable for tasks like orientation tracking, gesture recognition, and stabilization in applications such as drones or motion-controlled devices. Overall, the MPU6050 stands out as a versatile and widely embraced sensor catering to projects requiring exact motion-sensing capabilities.
To access data from the MPU6050 sensor, the Swan board's I2C pins can be employed, please see Figure 2.1. Connect the sensor to Swan following the provided configuration. Subsequently, download the sensor library from the given file. Incorporate it into the Arduino IDE by navigating to Sketch > Include Library > Add.ZIP Library and selecting the downloaded file. Open the provided example, aiming to upload the MPU6050_accel_simple.ino. Before initiating the upload, ensure compliance with the instructions detailed in step 1. Upon completion of the upload, the results depicted in the accompanying image will be obtained, please see Figure 2.2. This streamlined process ensures the seamless integration and utilization of MPU6050 sensor data in Swan-based projects, furnishing valuable insights into orientation and motion for a myriad of applications.
Downloads
Testing DC Motor and DRV8833
The DRV8833, a motor driver integrated circuit, is crafted for the precise control of speed and direction in two brushed DC motors. Developed by Texas Instruments, this dual H-bridge motor driver excels in bidirectional control of two motors or the control of a single stepper motor. Operating efficiently across a broad spectrum of input voltages, the DRV8833 stands as a versatile choice suitable for diverse applications. With built-in protection features like overcurrent protection and thermal shutdown, it guarantees the robustness and safety of the motors it controls. The DRV8833's compact design and adaptability render it particularly well-suited for applications in robotics, mechatronics, and other projects where accurate motor control is paramount.
#define AIN1 5
#define AIN2 6
#define BIN1 9
#define BIN2 10
void setup() {
Serial.begin(9600);
pinMode(AIN1,OUTPUT);
pinMode(AIN2,OUTPUT);
pinMode(BIN1,OUTPUT);
pinMode(BIN2,OUTPUT);
}
void loop() {
digitalWrite(AIN1,HIGH);
digitalWrite(AIN2,LOW);
digitalWrite(BIN1,HIGH);
digitalWrite(BIN2,LOW);
delay(1000);
digitalWrite(AIN1,LOW);
digitalWrite(AIN2,LOW);
digitalWrite(BIN1,LOW);
digitalWrite(BIN2,LOW);
delay(1000);
digitalWrite(AIN1,LOW);
digitalWrite(AIN2,HIGH);
digitalWrite(BIN1,LOW);
digitalWrite(BIN2,HIGH);
delay(1000);
digitalWrite(AIN1,LOW);
digitalWrite(AIN2,LOW);
digitalWrite(BIN1,LOW);
digitalWrite(BIN2,LOW);
delay(1000);
}
Within the scope of this project, the DRV8833 assumes a pivotal role in governing the forward, backward, left, and right movements of the prototype wheelchair's DC motors. The accompanying circuit diagram delineates the precise connections between Swan (assumed to be a microcontroller or control system) and the DRV8833 module, necessitating accurate wiring for optimal functionality, please see Figure 3.1. To enact motor control, the corresponding code must be uploaded to Swan. The code has been crafted to orchestrate the synchronized control of two DC motors. Initially, the motors execute a clockwise rotation, followed by a 1-second pause. Subsequently, they pivot in a counter-clockwise direction, pausing again for 1 second. This cyclic pattern perpetuates to facilitate the intended movements of the wheelchair prototype.
Downloads
PCB Creation Using EAGLE
In this project, the decision to embark on the creation of a printed circuit board (PCB) serves dual purposes: simplification and aesthetic enhancement. The adoption of a PCB aims to reduce the complexity of cable connections, promoting a more streamlined and organized setup. Additionally, the integration of a PCB introduces an element of aesthetic appeal to the overall project. The design process for the PCB will be executed utilizing the Eagle application, with its primary role being the establishment of connections between Swan Boards, the DRV8833 driver module, and the MPU-6050 sensor.
The initial step involves the creation of a schematic design outlining the components to be employed. In the absence of a library containing Swan's schematic and board designs, a common pin header is utilized to generate the necessary pads. PCB dots serve as a practical tool in this context, allowing users to manually create them within the Eagle application. Despite this workaround, the conceptual integrity of the design remains intact, please see Figure 4.1.
Various inputs and outputs are designated for utilization on the PCB. Four output pins are specifically allocated for DC motors, while input pins encompass a power supply pin interlinked with the entire circuit and an input for a remote control. Notably, due to pin limitations, analog input pins are repurposed for the remote control input. While unconventional, this adaptation retains the core concept.
Following the completion of the schematic design phase, the subsequent step involves generating the board file, please see Figure 4.2. During this process, components are meticulously arranged to form a shield-like structure, and tracks or pathways are established to interconnect one component with another. The resulting board layout, exemplified in the accompanying image, showcases the organized and interconnected components of the PCB, please see Figure 4.3. and Figure 4.4.
Download the file on this link.
Creating a Motorized Wheelchair Prototype With SolidWorks
For the efficient development of a motorized wheelchair, a prototype will be meticulously crafted using the SolidWorks application to streamline the 3D modeling process. The prototype, subsequently laser-cut from acrylic sheets, will be constructed with a focus on simplicity and efficiency. The step-by-step prototyping process ensures meticulous attention to detail for each component, aiming to closely replicate the actual motorized wheelchair with slight modifications to accommodate a DC motor for propulsion.
The prototype design incorporates a storage slot beneath the user's seat, strategically housing essential components such as the microcontroller, driver, sensors, and the battery. To enhance maneuverability, the front section is equipped with two swivel wheels, granting the user greater flexibility in adjusting the wheelchair's direction of movement, please see Figure 5.1.
After creating individual parts, the subsequent phase involves generating an assembly file that seamlessly integrates all components. Assembly files offer a comprehensive view of the entire structure once all individual parts are combined. This step is crucial for ensuring the accuracy of size and alignment when the various sections are assembled into a cohesive unit. The mates feature is employed in the merging process, allowing precise attachment of one part to another. This meticulous approach guarantees that the assembled motorized wheelchair functions seamlessly as a unified entity, considering the correct positioning and interaction of each part for optimal performance, please see Figure 5.2.
Download the file on this link.
Assembly and Programming of Wheelchair Prototype (+Partial Testing)
With the completion of all project development phases, we now proceed to integrate the acrylic pieces, cut in the preceding step, into a unified prototype for the electric wheelchair. The assembly process involves securing the acrylic components together using a glue gun. Due diligence has been applied during the prototype design to minimize errors, ensuring a straightforward assembly process.
Following the assembly, attention shifts to the installation of the PCB onto the prototype, please see Figure 6.1. The PCB comprises two main sections. The initial segment incorporates Swan Boards, an MPU-6050 Sensor, and a DRV 8833 Driver. The second PCB section houses push buttons designated for motor movement control, alongside a stepdown converter connecting the main board to the battery. Placement of these components occurs on the lower section of the motor, as illustrated in the above image. Once all components are securely in place, an initial test will be conducted to verify the proper functioning of the prototype device.
The testing phase encompasses forward, backward, right turn, and left turn maneuvers. A video showcasing the test results is available for reference above, ensuring transparency and visibility into the operational capabilities of the prototype.
Downloads
Battery Test With StepDown Converter
Moving forward, the next phase involves testing the battery, a crucial element for closely simulating a functional motorized wheelchair, please see Figure 7.1. The chosen battery is a lithium-polymer (LiPo) battery with a 12V output. In this segment, we will employ a StepDown module to decrease the battery voltage to 5V, please see Figure 7.2. The output from the StepDown module will be linked to the VIN and GND pins of the Swan Boards. Upon connecting the battery to the StepDown module, the activation of LED lights can be observed, indicating successful power supply to the Swan Boards.
Collecting Data
Once all components are prepared, encompassing both the circuit connections and the data reading procedures, the subsequent step involves the data collection process. In this project, data collection is facilitated through a data forwarder directed towards Edge Impulse.
For guidance on the necessary installations, please refer to the following links (1) (2). The installation requires several applications:
- Node.js version 12 or higher
- Arduino IDE
- Edge Impulse CLI, installable through the command prompt or terminal with the command (for Windows):
npm install -g edge-impulse-cli
Several considerations should be taken into account during the installation:
- Ensure the installation of additional tools when installing NodeJS (not selected by default).
- The Arduino IDE version must be a minimum of 1.15. Further details can be found on this link.
Once all the applications are successfully installed, the subsequent procedure involves incorporating a program for the Serial monitor. This program will be utilized to transmit data through a data forwarder. The subsequent step involves launching the Edge Impulse CLI through the Node.js command prompt using the following command:
edge-impulse-data-forwarder
Proceed to log in with the Edge Impulse account, select the port associated with Swan Boards, choose the relevant project on Edge Impulse, and assign distinctive names to each data feature. With these configurations, the device is now prepared to initiate data collection. Verification of the device's connection to Edge Impulse can be confirmed.
In this particular project, the classification task entails categorizing data into two distinct classes. The first class pertains to roads in good condition, denoting minimal damage. Data collection for this class is conducted on even surfaces, such as well-maintained cemented roads without significant holes or irregularities. The second class focuses on damaged roads, specifically those characterized by rough and uneven terrain. These conditions pose potential risks for electric wheelchair users, potentially causing prolonged back pain. Data for this class is collected from asphalt or standard roads with uneven surfaces.
Downloads
Creating Machine Learning Model
The initial step in constructing a machine learning model involves Impulse Design. This phase commences by generating an impulse designated for utilization. Users are required to choose both the processing block and learning block to be employed in this stage.
The project utilizes raw data to be further processed to generate classifications for the bumpy and normal classes. It is observed that in the bumpy class, the graph exhibits more undulations compared to the normal class. Subsequently, we can generate features using the features provided by Edge Impulse.
It is evident from the analysis that the outcomes of the classification process are notably promising and effective. The system has demonstrated a commendable level of accuracy in distinguishing between different classes. This robust performance is indicative of the system's proficiency in accurately categorizing data into distinct classifications.
Model Implementation on the Device
The final step involves integrating the model we've created into Swan Boards. Edge Impulse is equipped with features to seamlessly convert machine learning models for diverse devices and programming languages. Within the Deployment tab, you can choose the specific type of device or programming language you intend to use. Following that, all you need to do is patiently wait for the process to conclude, after which you can effortlessly download the finalized model.
What's fascinating is its usage mirrors that of the standard Arduino library, making it directly importable into Arduino by clicking on Sketch > Include Library > Add.ZIP Library. Subsequently, you can promptly incorporate it into your project.
Downloads
Testing the Device
Please watch the video.
Closing
This Prototype signifies an innovative approach aimed at benefiting individuals with disabilities. While it currently exists as the initial model of a motorized wheelchair, my aspiration is to catalyze the development of numerous practical and impactful creations. Looking ahead, my intention is not only to maintain this project as a prototype but also to bring it into reality, incorporating several enhancements in the future:
1. Streamlining the Controller: The goal is to simplify the controller, considering potential drawbacks of cable usage. While Bluetooth is an alternative, concerns arise regarding potential errors and their impact on the user's mobility. I am open to suggestions for better solutions that ensure continuous functionality in case of unexpected errors.
2. GPS Integration for Enhanced Safety: To augment safety measures, I plan to integrate GPS functionality to relay the wheelchair user's location to their guardian. This feature aims to provide immediate assistance in unforeseen events. This proposition is feasible, leveraging Blues Wireless products, particularly the Notecarrier F, capable of accommodating Swan GPS and Notecard simultaneously. Addressing the challenge of combining devices from the "Apply for Hardware" section in this contest remains a consideration.
3. Development of an Actual Motorized Wheelchair: This ambitious endeavor demands substantial resources and a collaborative effort across diverse fields of expertise to ensure its genuine benefits. Critical aspects include constructing a secure framework, designing an ergonomic structure, selecting appropriate materials, choosing suitable motors and drivers, implementing a comfortable suspension, and more. Collaboration and potential sponsorship (please 😀😀😀😀😀) may prove indispensable for the successful realization of this impactful project.