BLOG 5
First, following up on the previous blog post, we continued investigating the problem. Since the circuitry inside the robot's base buttons was not aesthetically pleasing, we changed our strategy, directly connecting the motor controller's power supply to the mains power. However, before doing this, we used a multimeter to check the battery voltage; it was 12V, which did not exceed the controller's maximum voltage limit. Sure enough, the motor started making noise.
Battery:
However, the wheel still didn't start turning. Why was that? We continued testing the PWM input controller ports of S1 and S2 and found it to be completely correct, 5V.
S1:
S2:
Next, we carefully reviewed the datasheet and found that we should toggle the switch and select Mixed Mode.
This is because the state machine controls only one output at a time:
rtos_msg_send(output1_rtos_task,100); // Only one output is active
rtos_msg_send(output2_rtos_task,50); // The other output is active then
Therefore, at any given time:
Only one PWM is "actively controlled"
The other is basically at 1500 (median/no action)
actually use the Mixed + Microcontroller mode:
Because my current PWM is:
output_high();
delay_us(1000~2000);
output_low();
| 1000us | full reverse |
| 1500us | stop |
| 2000us | full forward |
However, because in the mixed mode:
Left = throttle + turn
Right = throttle - turn
So,sometime Turn ≠ 0, so it will move forward on one side and backward on the other.
This practical experience cultivated my ability to identify, analyze, and solve problems in engineering projects.
Comments
Post a Comment