User Tools

Site Tools


test

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
test [2021/03/31 18:25] – [Motors] ursgraftest [2026/05/20 11:35] (current) 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
 <code> <code>
-ost@bblue:$ rc_test_motors -m 1 -d 1+ost@bblue:sudo rc_test_motors -m 1 -d 1
 </code> </code>
 //-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 ''Ctrl-C''. The test program is located in ///usr/bin// and can be run from anywhere. Check this for all 3 motors. //-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 ''Ctrl-C''. The test program is located in ///usr/bin// and can be run from anywhere. Check this for all 3 motors.
 <code> <code>
-ost@bblue:$ rc_test_motors -m 2 -d 1 +ost@bblue:sudo rc_test_motors -m 2 -d 1 
-ost@bblue:$ rc_test_motors -m 3 -d 1+ost@bblue:sudo rc_test_motors -m 3 -d 1
 </code> </code>
  
 ==== Encoders ==== ==== Encoders ====
-Ssh into the BeagleBone blue board and run:+Enable the counters with:
 <code> <code>
-debian@beaglebone:$ rc_test_encoders +ost@bblue:$ echo 1 | sudo tee /sys/bus/counter/devices/counter1/count0/enable  
 +ost@bblue:$ echo 1 | sudo tee /sys/bus/counter/devices/counter2/count0/enable  
 +ost@bblue:$ echo 1 | sudo tee /sys/bus/counter/devices/counter3/count0/enable 
 </code> </code>
-If you move the axis you should see encoder values changing.+The counter0 does not have to be enabled. Then watch the counters with 
 +<code> 
 +ost@bblue:$ watch -n 0.5 cat /sys/bus/counter/devices/counter0/count0/count  
 +ost@bblue:$ watch -n 0.5 cat /sys/bus/counter/devices/counter1/count0/count  
 +ost@bblue:$ watch -n 0.5 cat /sys/bus/counter/devices/counter2/count0/count  
 +ost@bblue:$ watch -n 0.5 cat /sys/bus/counter/devices/counter3/count0/count  
 +</code> 
 +If you move the axis you should see counter values changing. 
  
 ==== LEDs and buttons ==== ==== LEDs and buttons ====
-Next we want to check if all leds and buttons work as desired. Change to root mode +Next we want to check if all leds and buttons work as desired. 
 +The blue led should light up on pin GPIO3_2 with 
 <code> <code>
-debian@beaglebone:$ su+ost@bblue:$ sudo gpioset -c gpiochip2 2=1
 </code> </code>
-The password is "root". Change into +Do the same with the red led on pin GPIO1_17 
 <code> <code>
-root@beaglebone:$ cd /sys/class/gpio+ost@bblue:$ sudo gpioset -c gpiochip0 17=1
 </code> </code>
-and add the pins involved to the gpio array with+And the green led on pin GPIO3_20
 <code> <code>
-root@beaglebone:$ echo 49 > export +ost@bblue:$ sudo gpioset -c gpiochip2 20=1
-root@beaglebone:$ echo 57 > export +
-root@beaglebone:$ echo 97 > export +
-root@beaglebone:$ echo 98 > export +
-root@beaglebone:$ echo 113 > export +
-root@beaglebone:$ echo 116 > export +
-</code> +
-The blue led should light up with  +
-<code> +
-root@beaglebone:$ echo out > gpio98/direction +
-root@beaglebone:$ echo > gpio98/value +
-</code> +
-and stop lighting with +
-<code> +
-root@beaglebone:$ echo 0 > gpio98/value +
-</code> +
-Do the same with the red led +
-<code> +
-root@beaglebone:$ echo out > gpio49/direction +
-root@beaglebone:$ echo 1 > gpio49/value +
-root@beaglebone:$ echo 0 > gpio49/value +
-</code> +
-And the green led +
-<code> +
-root@beaglebone:$ echo out > gpio116/direction +
-root@beaglebone:$ echo 1 > gpio116/value +
-root@beaglebone:$ echo 0 > gpio116/value+
 </code> </code>
 Read the state of the blue button with Read the state of the blue button with
 <code> <code>
-root@beaglebone:$ echo in > gpio97/direction +ost@bblue:$ sudo gpioget -c gpiochip2 1
-root@beaglebone:$ cat gpio97/value+
 </code> </code>
-Repeat the last command with the button pressed. Do the same with the red button+When the button is pressed it will return //"1"=active//, //"1"=inactive// otherwise. Do the same with the red button
 <code> <code>
-root@beaglebone:$ echo in > gpio57/direction +ost@bblue:$ sudo gpioget -c gpiochip0 25
-root@beaglebone:$ cat gpio57/value+
 </code> </code>
 And the green button And the green button
 <code> <code>
-root@beaglebone:$ echo in > gpio113/direction +ost@bblue:$ sudo gpioget -c gpiochip2 17
-root@beaglebone:$ cat gpio113/value +
-</code> +
-Exit root mode with +
-<code> +
-root@beaglebone:$ exit+
 </code> </code>
  
Line 91: Line 68:
 Check the direction of the encoders. Lower your TCP and run Check the direction of the encoders. Lower your TCP and run
 <code> <code>
-debian@beaglebone:$ rc_test_encoders +ost@bblue:$ rc_test_encoders 
 </code> </code>
 on your target. When raising the TCP the encoder values should be positive. Change each negative encoder in the //HwConfigBBBlue.json// from on your target. When raising the TCP the encoder values should be positive. Change each negative encoder in the //HwConfigBBBlue.json// from
test.1617207937.txt.gz · Last modified: by ursgraf