Closed mciantyre closed 3 years ago
Test
This test assumes that no motors are connected. We're going to speed up one motor to 99% throttle...
Flash
pwm-control
to your board:./tasks.py demo pwm-control
Observe a slow-blinking LED.
✅
Run the
imu-parse.py
example on your host:python COMx host/imu-parse.py
Observe accelerometer and gyroscope readings. Skip this test if the IMU isn't connected.
✅ (need to update comment above to say "python host/imu-parse.py COMx"
a.
COMx
is the COM port for the USB peripheral, not the FTDI cable. b. Try changing theenable_readings
anddisable_readings
calls in the script to affect what's printed.
✅
Run the
esc-throttle.py
example on your host, and change the throttle on motor B to 99%:python host/esc-throttle.py COMx B 99
Observe that the LED blinks rapidly, representing the max throttle for all motors is very high.
✅
a.
COMx
is same as 2.a.To see debug log output, connect to your FTDI cable with PuTTY, baud rate 115200. Most noise happens at startup, but it may output warnings during runtime if there's an issue.
✅ Debug info works well for throttle!
@mciantyre are we good to merge this pull request?
Fixed step 2. Yup all good for a merge. Thanks for testing!
The PR modifies the
pwm-control
demo. Rather than sending motion sensor readings over UART, we send it over USB. We should be able to send data much faster than with UART. See discussions in #42 for the numbers. From a quick study of the USB driver, I believe worst-case latency from board to host through the embedded board's USB driver is two microframes (250us) to schedule a bulk transfer, plus movement of data on the bus (480MHz). I've not measured any of this, but I think it should be good enough for our first demo.We were previously using USB for debug logging and user input. We move debug logging to the UART output. The USB peripheral will still receive motor commands. This means that any feedback from an incorrect motor setting comes from a different serial interface. The test below highlights this change (2.a.)
This PR also introduces
pypwm-control
, a Python host-side library forThere's a new example,
esc-throttle.py
, that lets you control the throttle percentage from the command line. See the new entry inhosts/README.md
. The existingimu-parse.py
script is rewritten to usepypwm-control
, serving as an example of streaming IMU readings.Test
This test assumes that no motors are connected. We're going to speed up one motor to 99% throttle...
pwm-control
to your board:Observe a slow-blinking LED.
imu-parse.py
example on your host:Observe accelerometer and gyroscope readings. Skip this test if the IMU isn't connected. a.
COMx
is the COM port for the USB peripheral, not the FTDI cable. b. Try changing theenable_readings
anddisable_readings
calls in the script to affect what's printed.esc-throttle.py
example on your host, and change the throttle on motor B to 99%:Observe that the LED blinks rapidly, representing the max throttle for all motors is very high. a.
COMx
is same as 2.a.To see debug log output, connect to your FTDI cable with PuTTY, baud rate 115200. Most noise happens at startup, but it may output warnings during runtime if there's an issue.