User Tools

Site Tools


test

This is an old revision of the document!


Test the Hardware

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

debian@beaglebone:$ rc_test_motors -m 1 -d 1

-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.

debian@beaglebone:$ rc_test_motors -m 2 -d 1
debian@beaglebone:$ rc_test_motors -m 3 -d 1

Next we want to check if all leds and buttons work as desired. Change to root mode

debian@beaglebone:$ su

The password is “root”. Change into

root@beaglebone:$ cd /sys/class/gpio

and add the pins involved to the gpio array with

root@beaglebone:$ echo 49 > export
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

The blue led should light up with

root@beaglebone:$ echo out > gpio98/direction
root@beaglebone:$ echo 1 > gpio98/value

and stop lighting with

root@beaglebone:$ echo 0 > gpio98/value

Do the same with the red led

root@beaglebone:$ echo out > gpio49/direction
root@beaglebone:$ echo 1 > gpio49/value
root@beaglebone:$ echo 0 > gpio49/value

And the green led

root@beaglebone:$ echo out > gpio116/direction
root@beaglebone:$ echo 1 > gpio116/value
root@beaglebone:$ echo 0 > gpio116/value

Read the state of the blue button with

root@beaglebone:$ echo in > gpio97/direction
root@beaglebone:$ cat gpio97/value

Repeat the last command with the button pressed. Do the same with the red button

root@beaglebone:$ echo in > gpio57/direction
root@beaglebone:$ cat gpio57/value

And the green button

root@beaglebone:$ echo in > gpio113/direction
root@beaglebone:$ cat gpio113/value

Exit root mode with

root@beaglebone:$ exit

Adjust Hardware Configuration File

Check the direction of the encoders. Lower your TCP and run

debian@beaglebone:$ rc_test_encoders 

on your target. When raising the TCP the encoder values should be positive. Change each negative encoder in the HwConfigBBBlue.json from

"scale": [ { "id" : "gear",
		"minIn": 	0, "maxIn": 1,
		"minOut":	0, "maxOut": 76 },
	   { "id" : "enc",
		"minIn": 	0, "maxIn": 6.283185307179586476925286766559,
		"minOut":	0, "maxOut": 4096},
	   { "id" : "fqd",
		"minIn":	0, "maxIn": 1,
		"minOut":	0, "maxOut": 4}
	 ],

to (changed sign in id:enc)

"scale": [ { "id" : "gear",
		"minIn": 	0, "maxIn": 1,
		"minOut":	0, "maxOut": 76 },
	   { "id" : "enc",
		"minIn": 	0, "maxIn": -6.283185307179586476925286766559,
		"minOut":	0, "maxOut": 4096},
	   { "id" : "fqd",
		"minIn":	0, "maxIn": 1,
		"minOut":	0, "maxOut": 4}
	 ],

Check the encoder and gear values and adjust them if necessary. You can change HwConfigBBBlue.json on the host before deploying to the target or on the target directly. After that you can run the Delta application.

debian@beaglebone:$ cd /opt/eeros/bin
debian@beaglebone:$ sudo ./delta -c HwConfigBBBlue.json

Next: Running the Delta Application

test.1565186525.txt.gz · Last modified: 2019/08/07 16:02 by visentin