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/10/06 11:15] – [Encoders] ursgraftest [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
 <code> <code>
-ost@bblue:$ sudo rc_test_motors -m 1 -d 1+ost@bblue:$ sudo gpioset -c gpiochip3 MOT_STBY=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.+Open two other shells and run 
 <code> <code>
-ost@bblue:$ sudo rc_test_motors -m 2 -d +ost@bblue:$ sudo gpioset -c gpiochip1 MDIR_1A=1 
-ost@bblue:$ sudo rc_test_motors -m 3 -d 1+</code> 
 +and 
 +<code> 
 +ost@bblue:$ sudo gpioset -c gpiochip3 MDIR_1B=0 
 +</code> 
 +Changing the polarity of MDIR_1A and MDIR_1B will change the direction. In a forth shell, configure the pwm signal as follows: 
 +<code> 
 +ost@bblue:$ echo 0 | sudo tee /sys/class/pwm/pwmchip2/export 
 +ost@bblue:$ echo 1000000 | sudo tee /sys/class/pwm/pwmchip2/pwm0/period 
 +ost@bblue:$ echo 500000 | sudo tee /sys/class/pwm/pwmchip2/pwm0/duty_cycle 
 +ost@bblue:$ echo | sudo tee /sys/class/pwm/pwmchip2/pwm0/enable
 </code> </code>
  
-==== Encoders ==== +Check the second motor with
-ssh into the BeagleBone blue board and run:+
 <code> <code>
-ost@bblue:$ sudo rc_test_encoders +ost@bblue:$ sudo gpioset -c gpiochip0 MDIR_2A=1
 </code> </code>
-If you move the axis you should see encoder values changing.  +and
-==== LEDs and buttons ==== +
-Next we want to check if all leds and buttons work as desired. Change to root mode +
 <code> <code>
-ost@bblue:su+ost@bblue:sudo gpioset -c gpiochip3 MDIR_2B=0
 </code> </code>
-The password is "root"Change into +Changing the polarity of MDIR_2A and MDIR_2B will change the directionIn a forth shell, configure the pwm signal as follows:
 <code> <code>
-root@bblue:cd /sys/class/gpio+ost@bblue:echo 1 | sudo tee /sys/class/pwm/pwmchip2/export 
 +ost@bblue:$ echo 1000000 | sudo tee /sys/class/pwm/pwmchip2/pwm1/period 
 +ost@bblue:$ echo 500000 | sudo tee /sys/class/pwm/pwmchip2/pwm1/duty_cycle 
 +ost@bblue:$ echo 1 | sudo tee /sys/class/pwm/pwmchip2/pwm1/enable
 </code> </code>
-and add the pins involved to the gpio array with+ 
 +Check the third motor with
 <code> <code>
-root@bblue:echo 49 > export +ost@bblue:sudo gpioset -c gpiochip1 MDIR_3A=1
-root@bblue:$ echo 57 > export +
-root@bblue:$ echo 97 > export +
-root@bblue:$ echo 98 > export +
-root@bblue:$ echo 113 > export +
-root@bblue:$ echo 116 > export+
 </code> </code>
-The blue led should light up with +and
 <code> <code>
-root@bblue:echo out > gpio98/direction +ost@bblue:sudo gpioset -c gpiochip1 MDIR_3B=0
-root@bblue:$ echo 1 > gpio98/value+
 </code> </code>
-and stop lighting with+Changing the polarity of MDIR_3A and MDIR_3B will change the direction. In a forth shell, configure the pwm signal as follows:
 <code> <code>
-root@bblue:$ echo 0 > gpio98/value+ost@bblue:$ echo 0 | sudo tee /sys/class/pwm/pwmchip4/export 
 +ost@bblue:$ echo 1000000 | sudo tee /sys/class/pwm/pwmchip4/pwm0/period 
 +ost@bblue:$ echo 500000 | sudo tee /sys/class/pwm/pwmchip4/pwm0/duty_cycle 
 +ost@bblue:$ echo 1 | sudo tee /sys/class/pwm/pwmchip4/pwm0/enable
 </code> </code>
-Do the same with the red led+==== Encoders ==== 
 +Enable the counters with:
 <code> <code>
-root@bblue:$ echo out > gpio49/direction +ost@bblue:$ echo 1 | sudo tee /sys/bus/counter/devices/counter1/count0/enable  
-root@bblue:$ echo 1 > gpio49/value +ost@bblue:$ echo 1 | sudo tee /sys/bus/counter/devices/counter2/count0/enable  
-root@bblue:$ echo 0 > gpio49/value+ost@bblue:$ echo 1 | sudo tee /sys/bus/counter/devices/counter3/count0/enable 
 </code> </code>
-And the green led+Then watch the counters with
 <code> <code>
-root@bblue:echo out > gpio116/direction +ost@bblue:watch -n 0.5 cat /sys/bus/counter/devices/counter1/count0/count  
-root@bblue:echo 1 > gpio116/value +ost@bblue:watch -n 0.5 cat /sys/bus/counter/devices/counter2/count0/count  
-root@bblue:echo > gpio116/value+ost@bblue:watch -n 0.5 cat /sys/bus/counter/devices/counter3/count0/count 
 </code> </code>
-Read the state of the blue button with+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 with 
 <code> <code>
-root@bblue:echo in > gpio97/direction +ost@bblue:sudo gpioset -c gpiochip2 GPIO3_2=1
-root@bblue:$ cat gpio97/value+
 </code> </code>
-Repeat the last command with the button pressed. Do the same with the red button+Do the same with the red led on pin GPIO1_17 
 <code> <code>
-root@bblue:echo in > gpio57/direction +ost@bblue:sudo gpioset -c gpiochip0 GPIO1_17=1
-root@bblue:$ cat gpio57/value+
 </code> </code>
-And the green button+And the green led on pin GPIO3_20
 <code> <code>
-root@bblue:echo in > gpio113/direction +ost@bblue:sudo gpioset -c gpiochip2 GPIO3_20=1
-root@bblue:$ cat gpio113/value+
 </code> </code>
-Exit root mode with+Read the state of the blue button with 
 +<code> 
 +ost@bblue:$ sudo gpioget -c gpiochip2 GPIO3_1 
 +</code> 
 +When the button is pressed it will return //"1"=active//, //"1"=inactive// otherwise. Do the same with the red button 
 +<code> 
 +ost@bblue:$ sudo gpioget -c gpiochip0 GPIO1_25 
 +</code> 
 +And the green button
 <code> <code>
-root@bblue:exit+ost@bblue:sudo gpioget -c gpiochip2 GPIO3_17
 </code> </code>
  
Line 83: Line 101:
  
 <code> <code>
-sudo cat /dev/input/event1+sudo cat /dev/input/event0
 </code> </code>
  
 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 //HwConfigBBBlue.json// from
-<code> +
-ost@bblue:$ rc_test_encoders  +
-</code> +
-on your target. When raising the TCP the encoder values should be positive. Change each negative encoder in the //HwConfigBBBlue.json// from+
 <code> <code>
 "scale": [ { "id" : "gear", "scale": [ { "id" : "gear",
test.1633511718.txt.gz · Last modified: by ursgraf