Blog5
Introduction
Over the past two weeks, our team has begun investigating the 'baby sworm,' including research on Jason's codes of PWM, and existing hardware (distance sensors, motor controllers).
PMW
We found that the given code or system implements a real-time multitasking control architecture using RTOS, where input events (button and ADC) trigger a finite state machine that dynamically updates PWM signals with pulse widths of 0.5 ms, 1 ms, 1.5 ms, and 2.0 ms (for different speed), to control two motor outputs which will be used in the motor controller(Sabertooth 2x12).
Below are the results displayed on the oscilloscope:
0.5ms
1.0ms
Distance sensor
To study the ranging sensor, we found the datasheet for SHARP 2Y0A02YK0F and used an oscilloscope with white paper to test the distance to verify whether the displayed voltage accurately matched the test distance.
The line graph below shows distance measuring characteristics of the sensor,
ranging from 20 to 150cm:
1.58V for 40cm
The results show that the measured voltage has a small error, but the overall result is accurate.Although there were minor errors at the beginning, such as using the wrong output pin of the distance sensor and mistakenly using AC during measurement, the test was eventually completed thanks to the team's efforts.
Motor controller
This part of the investigation took the longest. We first found the Sabertooth 2x12 User’s Guide online to understand how to connect other cables to the motor controller, and then clarified the internal wiring and voltage issues of the system.
After some time disassembling and studying, we understood the wiring and tried connecting the MCU and power supply to start the motor controller.The controller's state1 indicator light was on, but the state2 and error indicators kept flashing. According to the datasheet, this indicated low voltage.
After understanding the problem, we tested the voltage at the controller pin and found it was only 2V which is low than the User's Guide asked. Furthermore, the wire connected to the green relays in the diagram had no voltage. We adjusted the interface and wires to restore the voltage. The good news is that we were able to detect the PMW signal mentioned at the beginning. However, the MCU's error indicator light continued to flash, and the tire did not turn. We are currently searching for possible solutions and hope to resolve this in the next class. This is the final and most important step.
Other progress
On another 'baby sworm' without a motor controller, our team implemented the use of a warning light and a 'gun' by connecting a relay and replacing the fuse respectively
Overall, although the implementation process was challenging, most of the goals were achieved thanks to the mutual assistance among team members.
Comments
Post a Comment