====== Experimental Setup with a Beaglebone Blue Board ====== Back to [[oneaxis|]] Use a [[https://wiki.ost.ch/spaces/EDS/pages/359858325/BeagleBone+Blue|Beaglebone blue]] board. Connect all the necessary signals according to your hardware configuration file. {{:getting_started:tutorials:bbbmotor.jpg?400|}} ===== Testing the Hardware ===== ==== Analog Output ==== There are 4 connectors denoted with //DC Motors//. Connect number 1 with the motor. Before testing plug in the 12V DC power supply or the Li-Po battery, otherwise the motors won't run. ssh into the Beaglebone blue board and run ost@bblue:$ sudo gpioset -c gpiochip3 MOT_STBY=1 Open two other shells and run ost@bblue:$ sudo gpioset -c gpiochip1 MDIR_1A=1 and ost@bblue:$ sudo gpioset -c gpiochip3 MDIR_1B=0 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 /sys/class/pwm/pwmchip2/export ost@bblue:$ echo 1000000 | sudo tee /sys/class/pwm/pwmchip2/pwm0/period ost@bblue:$ echo 200000 | sudo tee /sys/class/pwm/pwmchip2/pwm0/duty_cycle ost@bblue:$ echo 1 | sudo tee /sys/class/pwm/pwmchip2/pwm0/enable ==== Enable Signal ==== On the Beaglebone blue we do not use an external motor controller and therefore, we cannot really control the motor power with this signal. However, we put the signal onto the green led on the board. Check the function with ost@bblue:$ echo 1 | sudo tee /sys/class/leds/green/brightness ost@bblue:$ echo 0 | sudo tee /sys/class/leds/green/brightness ==== Encoder Inputs ==== There are 4 connectors denoted with //4 Quadrature encoder inputs//. Connect number 1 with your encoder. Make sure that your encoder works with 3.3V as delivered by this connector. Test the encoder with ost@bblue:~$ echo 1 | sudo tee /sys/bus/counter/devices/counter3/count0/enable ost@bblue:~$ watch -n 0.5 cat /sys/bus/counter/devices/counter1/count0/count Turning the motor in positive direction must lead to the encoder counting upwards. If not, change the MDIR_1A and MDIR_1B signals above. ==== Ready Signal ==== The ready signal signals to the controller that the motor controller has powered up. As there is no external motor controller on the Beaglebone blue we simply put this signal on a digital input pin which is connected to the on board push button //Mode//. ost@bblue:$ sudo gpioget -c gpiochip1 MODE_BTN ==== Emergency Signal ==== The emergency signal is used to bring the application in a safe mode. We put this input signal on a digital input pin which is connected to the on board push button //Pause//. Later when the application runs we can cause the safety system to switch to an emergency state by pressing the //Pause// button. ost@bblue:$ sudo gpioget -c gpiochip1 PAUSE_BTN =====Run Application===== Start the application by choosing the appropriate configuration file: $ sudo ./simpleMotorControl -c HwConfigBBBlue.json