Digital Beamformer Brief: ...
First I tested to see if I could get the steering servo and ESC to work. This was easy using pre-made servo libraries.
First I tested to see if I could get the steering servo and ESC to work. This was easy using pre-made servo libraries.
Next, used a potentiometer, ADC, and servo PWM lib to run the motor via the ESC.
Next, used a potentiometer, ADC, and servo PWM lib to run the motor via the ESC.
After getting the basic electromechanical functionality down, I realized that Bluetooth support on Arduino would reqire a BT shield, aka MORE hardware overhead, so I made a pivot to the RaspberryPi Zero W here.
Next I did some Python dev in to break the functionality into three parts: [ controller input, steering, throttle ]. This resulted in three modules: controller_input.py, esc.py, servo.py
controller_input.py leveraged the pyPS4Controller library.
KEY TAKEAWAYS: Although I accomplished my goal of getting the rover to function without any hardware add-ons, I learned that the dedicated hardware was probablly the better choice. The Raspberry Pi, running Python (and using using the BT interface library mentioned above) had an ever-so-slightly noticable latency that made driving the rover annoying. Furthermore, the small range of motion on the joysticks on the controller made controlling the rover at higher speeds difficult. I'm glad I did the project, as I learned a lot about PWM, hardware PWM generation via DMA, and Bluetooth, but all in all I now understand why dedicated hardware is much better for this purpose.
The DS4 rover project came into existance when I saw a chassis from a trashed AWS DeepRacer Kit [ esc, steering servo, 7.4v lipo ] laying around in a parts bin. I set a goal to reverse engineer the chassis and electronics into a remote control rover with the smallest hardware overhead possible. This meant no purchase of a reciever module or an RC transmitter. Instead I opted for what I could find laying around: a DualShock4 controller, and some microcontroller boards [including a Raspberry Pi Zero W].
First I tested to see if I could get the steering servo and ESC to work. This was easy using pre-made servo libraries.
First I tested to see if I could get the steering servo and ESC to work. This was easy using pre-made servo libraries.
Next, used a potentiometer, ADC, and servo PWM lib to run the motor via the ESC.
Next, used a potentiometer, ADC, and servo PWM lib to run the motor via the ESC.
After getting the basic electromechanical functionality down, I realized that Bluetooth support on Arduino would reqire a BT shield, aka MORE hardware overhead, so I made a pivot to the RaspberryPi Zero W here.
Next I did some Python dev in to break the functionality into three parts: [ controller input, steering, throttle ]. This resulted in three modules: controller_input.py, esc.py, servo.py
controller_input.py leveraged the pyPS4Controller library.
KEY TAKEAWAYS: Although I accomplished my goal of getting the rover to function without any hardware add-ons, I learned that the dedicated hardware was probablly the better choice. The Raspberry Pi, running Python (and using using the BT interface library mentioned above) had an ever-so-slightly noticable latency that made driving the rover annoying. Furthermore, the small range of motion on the joysticks on the controller made controlling the rover at higher speeds difficult. I'm glad I did the project, as I learned a lot about PWM, hardware PWM generation via DMA, and Bluetooth, but all in all I now understand why dedicated hardware is much better for this purpose.