Close

Added PWM Motor Control Component

A project log for Robot Tank Using NASA FPrime

Building a tank steer robot using NASA JPL's FPrime framework.

joe-kaleJoe Kale 03/21/2021 at 18:160 Comments

The H-Bridge motor driver that came with the Kookye kit allows PWM input on the the ENA and ENB pins. After getting things functional with simple enable/disable logic I added PWM control from the Raspberry Pi.

To enable the PWM sysfs driver for Raspberry Pi pins 12 and 13 add the following line to your /boot/config.txt.

dtoverlay=pwm-2chan,pin=12,func=4,pin2=13,func2=4

As a Pro-Tip, to debug errors in your config.txt use the following command to print the logs from starting up

sudo vcdbg log msg 

After figuring out the process for enabling and setting PWM settings, I got to work developing the F' Component to control them. You can see the final result in the Tank/PWMMotorControl directory in my fork of F'.

Next step is a Component for Gamepad input for simple testing of the motor controls.

Discussions