test
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| test [2021/10/06 11:14] – [Encoders] ursgraf | test [2026/06/03 15:14] (current) – [Mouse] ursgraf | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| Before testing your assembled electronics plug in the 12V DC power supply or the Li-Po battery, otherwise the motors won't run. We will now test each component individually. ssh into the BeagleBone blue board and run | Before testing your assembled electronics plug in the 12V DC power supply or the Li-Po battery, otherwise the motors won't run. We will now test each component individually. ssh into the BeagleBone blue board and run | ||
| < | < | ||
| - | ost@bblue:$ sudo rc_test_motors | + | ost@bblue:$ sudo gpioset |
| </ | </ | ||
| - | //-m 1// selects the first motor while //-d 1// specifies a duty cycle of 1. The motor should lift its bar. If a motor turns in the opposite direction, change the + and - wire of the motor. You can stop the program by pressing '' | + | Open two other shells |
| < | < | ||
| - | ost@bblue:$ sudo rc_test_motors | + | ost@bblue:$ sudo gpioset |
| - | ost@bblue:$ sudo rc_test_motors | + | </ |
| + | and | ||
| + | < | ||
| + | ost@bblue:$ sudo gpioset | ||
| + | </ | ||
| + | Changing the polarity of MDIR_1A and MDIR_1B will change the direction. In a forth shell, configure the pwm signal as follows: | ||
| + | < | ||
| + | ost@bblue:$ echo 0 | sudo tee / | ||
| + | ost@bblue:$ echo 1000000 | sudo tee / | ||
| + | ost@bblue:$ echo 500000 | sudo tee / | ||
| + | ost@bblue:$ echo 1 | sudo tee / | ||
| </ | </ | ||
| - | ==== Encoders ==== | + | Check the second motor with |
| - | ssh into the BeagleBone blue board and run: | + | |
| < | < | ||
| - | ost@bblue:$ sudo rc_test_encoders | + | ost@bblue:$ sudo gpioset -c gpiochip0 MDIR_2A=1 |
| + | </ | ||
| + | and | ||
| + | < | ||
| + | ost@bblue:$ sudo gpioset -c gpiochip3 MDIR_2B=0 | ||
| + | </ | ||
| + | Changing the polarity of MDIR_2A and MDIR_2B will change the direction. In a forth shell, configure the pwm signal as follows: | ||
| + | < | ||
| + | ost@bblue:$ echo 1 | sudo tee / | ||
| + | ost@bblue:$ echo 1000000 | sudo tee / | ||
| + | ost@bblue:$ echo 500000 | sudo tee / | ||
| + | ost@bblue:$ echo 1 | sudo tee / | ||
| </ | </ | ||
| - | If you move the axis you should see encoder values changing. Lifting the bar must lead to decreasing encoder positions. If not, switch A and B signals of the encoder or change sign in the hardware configuration file. | ||
| - | ==== LEDs and buttons ==== | + | Check the third motor with |
| - | Next we want to check if all leds and buttons work as desired. Change to root mode | + | |
| < | < | ||
| - | ost@bblue: | + | ost@bblue: |
| </ | </ | ||
| - | The password is " | + | and |
| < | < | ||
| - | root@bblue: | + | ost@bblue: |
| </ | </ | ||
| - | and add the pins involved to the gpio array with | + | Changing the polarity of MDIR_3A |
| < | < | ||
| - | root@bblue:$ echo 49 > export | + | ost@bblue:$ echo 0 | sudo tee / |
| - | root@bblue:$ echo 57 > export | + | ost@bblue:$ echo 1000000 | sudo tee / |
| - | root@bblue:$ echo 97 > export | + | ost@bblue:$ echo 500000 | sudo tee / |
| - | root@bblue:$ echo 98 > export | + | ost@bblue:$ echo 1 | sudo tee / |
| - | root@bblue: | + | |
| - | root@bblue: | + | |
| </ | </ | ||
| - | The blue led should light up with | + | ==== Encoders ==== |
| + | Enable the counters | ||
| < | < | ||
| - | root@bblue:$ echo out > gpio98/direction | + | ost@bblue:$ echo 1 | sudo tee /sys/ |
| - | root@bblue:$ echo 1 > gpio98/value | + | ost@bblue:$ echo 1 | sudo tee / |
| + | ost@bblue:$ echo 1 | sudo tee / | ||
| </ | </ | ||
| - | and stop lighting | + | Then watch the counters |
| < | < | ||
| - | root@bblue: | + | ost@bblue: |
| + | ost@bblue:$ watch -n 0.5 cat / | ||
| + | ost@bblue:$ watch -n 0.5 cat / | ||
| </ | </ | ||
| - | Do the same with the red led | + | If you move the axis you should see counter values changing. |
| + | |||
| + | ==== LEDs and buttons ==== | ||
| + | Next we want to check if all leds and buttons work as desired. | ||
| + | The blue led should light up on pin GPIO3_2 | ||
| < | < | ||
| - | root@bblue: | + | ost@bblue: |
| - | root@bblue: | + | |
| - | root@bblue: | + | |
| </ | </ | ||
| - | And the green led | + | Do the same with the red led on pin GPIO1_17 |
| < | < | ||
| - | root@bblue: | + | ost@bblue: |
| - | root@bblue: | + | </code> |
| - | root@bblue: | + | And the green led on pin GPIO3_20 |
| + | <code> | ||
| + | ost@bblue: | ||
| </ | </ | ||
| Read the state of the blue button with | Read the state of the blue button with | ||
| < | < | ||
| - | root@bblue: | + | ost@bblue: |
| - | root@bblue: | + | |
| </ | </ | ||
| - | Repeat the last command with the button pressed. Do the same with the red button | + | When the button |
| < | < | ||
| - | root@bblue: | + | ost@bblue: |
| - | root@bblue: | + | |
| </ | </ | ||
| And the green button | And the green button | ||
| < | < | ||
| - | root@bblue: | + | ost@bblue: |
| - | root@bblue: | + | |
| - | </ | + | |
| - | Exit root mode with | + | |
| - | < | + | |
| - | root@bblue: | + | |
| </ | </ | ||
| Line 84: | Line 101: | ||
| < | < | ||
| - | sudo cat /dev/input/event1 | + | sudo cat /dev/input/event0 |
| </ | </ | ||
| If you move the mouse you should see some characters on the screen. This shows that the mouse inputs are received by the BBBlue. | If you move the mouse you should see some characters on the screen. This shows that the mouse inputs are received by the BBBlue. | ||
| + | |||
| ===== Adjust Hardware Configuration File ===== | ===== Adjust Hardware Configuration File ===== | ||
| - | Check the direction of the encoders. Lower your TCP and run | + | Check the direction of the encoders. Lower your TCP and run watch your encoder values.When raising the TCP the encoder values should be positive. Change each negative encoder in the // |
| - | < | + | |
| - | ost@bblue:$ rc_test_encoders | + | |
| - | </ | + | |
| - | on your target. When raising the TCP the encoder values should be positive. Change each negative encoder in the // | + | |
| < | < | ||
| " | " | ||
test.1633511658.txt.gz · Last modified: by ursgraf
