Blog 4 | Qimeng Liu
The PWM test
pwm1 is the PIN3
pwm2 is the PIN4
We can use button to control the state machine task go to different tasks and get the different PWM times. For example, 0.5ms, 1ms, and 2ms.
There are some diagrams from the Oscillator scope.
This is the 0.5ms PWM.
This is the 2ms PWM.
This is the 1ms PWM.
The practise state machine of the bin bot is shown below:
There are five different satae and 3 motor in this state machine block diagram. Which the motor1 and motor2 to control the left and right wheel and motor_lip control the lip on the top of the bin bot.
STATE 1: The bot stop moving, since the motor1 and motor2 is 0. This is the default state as well. It can go to the STATE 5 and STATE 2.
STATE 2: The Turn Right state, since the left wheel is faster than the right wheel. Thus, the bot is suppose to turn right.
STATE 3: The Turn Left state, since the right wheel is faster than the left wheel. Thus, the bot is suppose to turn left.
STATE 4:The Go Stright state, since the right wheel and left wheel have the same speed. Thus, the bot is suppose to go stright.
STATE 5:The oepn lip state, open the open lip motor. Thus the lip opne.
The bot
First of all, the distance sensor in this bot.
The sensor is Sharp2Y0A02. The datasheet is shown below: sensor datasheet
Sharp GP2Y0A02YK0F is an infrared distance sensor that measures about 20 cm to 150 cm and gives an analog voltage output for distance reading. It runs on about 4.5–5.5 V, so it is commonly used with microcontrollers for obstacle detection and distance measurement.
The most important table is the distance to voltage table, it is shown below:
As this table, we can see that the different distance have the different distance output.
The different Oscillator scope screen shot diagrams are shown below:
The 40 cm distanace measurment:
The 100 cm distance measurement:
After that, we try to move this bot with motor control and board. But, unfortunately we meet some problems.
The connect the Microcontroller, the motor control and the battery. The connection is shown below:
The lights of motor controller is ON, but the motor does not work. The motor controller datasheet is shown below:
The motor controller diagram is shown below:
The 0V PIN in this motor controller:
The 5V PIN in this motor controller:
The S1 PIN in this motor Controller:
The S2 PIN in the motor controller:
Of all these signal are great, but we find that the B+ (the power supply) is pretty low, the Oscillator scope screen shot of it is shown below:
I think it is the most important problem cause the motor do not work. I will fix it in the next two weeks.




Comments
Post a Comment