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 [2026/05/20 11:35] 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>
  
 +Check the second motor with
 +<code>
 +ost@bblue:$ sudo gpioset -c gpiochip0 MDIR_2A=1
 +</code>
 +and
 +<code>
 +ost@bblue:$ sudo gpioset -c gpiochip3 MDIR_2B=0
 +</code>
 +Changing the polarity of MDIR_2A and MDIR_2B will change the direction. In a forth shell, configure the pwm signal as follows:
 +<code>
 +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>
 +
 +Check the third motor with
 +<code>
 +ost@bblue:$ sudo gpioset -c gpiochip1 MDIR_3A=1
 +</code>
 +and
 +<code>
 +ost@bblue:$ sudo gpioset -c gpiochip1 MDIR_3B=0
 +</code>
 +Changing the polarity of MDIR_3A and MDIR_3B will change the direction. In a forth shell, configure the pwm signal as follows:
 +<code>
 +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>
 ==== Encoders ==== ==== Encoders ====
 Enable the counters with: Enable the counters with:
Line 19: Line 60:
 ost@bblue:$ echo 1 | sudo tee /sys/bus/counter/devices/counter3/count0/enable  ost@bblue:$ echo 1 | sudo tee /sys/bus/counter/devices/counter3/count0/enable 
 </code> </code>
-The counter0 does not have to be enabled. Then watch the counters with+Then watch the counters with
 <code> <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/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/counter2/count0/count 
Line 32: Line 72:
 The blue led should light up on pin GPIO3_2 with  The blue led should light up on pin GPIO3_2 with 
 <code> <code>
-ost@bblue:$ sudo gpioset -c gpiochip2 2=1+ost@bblue:$ sudo gpioset -c gpiochip2 GPIO3_2=1
 </code> </code>
 Do the same with the red led on pin GPIO1_17  Do the same with the red led on pin GPIO1_17 
 <code> <code>
-ost@bblue:$ sudo gpioset -c gpiochip0 17=1+ost@bblue:$ sudo gpioset -c gpiochip0 GPIO1_17=1
 </code> </code>
 And the green led on pin GPIO3_20 And the green led on pin GPIO3_20
 <code> <code>
-ost@bblue:$ sudo gpioset -c gpiochip2 20=1+ost@bblue:$ sudo gpioset -c gpiochip2 GPIO3_20=1
 </code> </code>
 Read the state of the blue button with Read the state of the blue button with
 <code> <code>
-ost@bblue:$ sudo gpioget -c gpiochip2 1+ost@bblue:$ sudo gpioget -c gpiochip2 GPIO3_1
 </code> </code>
 When the button is pressed it will return //"1"=active//, //"1"=inactive// otherwise. 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>
-ost@bblue:$ sudo gpioget -c gpiochip0 25+ost@bblue:$ sudo gpioget -c gpiochip0 GPIO1_25
 </code> </code>
 And the green button And the green button
 <code> <code>
-ost@bblue:$ sudo gpioget -c gpiochip2 17+ost@bblue:$ sudo gpioget -c gpiochip2 GPIO3_17
 </code> </code>
  
Line 61: 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.1779269742.txt.gz · Last modified: by ursgraf