I think I understand the basic GoPiGo3 theory of operation:
Raspberry Pi is a non-RT OS that runs “Robot Brain” code, and
- communicates via SPI (at 500kbit max) using
set and polled-get messages with
GoPiGo3 ATSAMC20J 32-bit MicroController that is controlling and reading
GoPiGo3 sensors (
- 2x “Grove” A or D,
- 2x I2C,
- 2x 720 count/rev encoders)
and GoPiGo3 actuators (
- 2xMotors,
- 2xServos,
- 2x red LED,
- WiFi Multi-color LED,
- Power Multi-color LED,
- 2x “eyes” Multi-color LEDs)
Using a microcontroller for time critical operations frees the brain to think deeper without FOMO and allows more precise control loops between actuators and sensor feedback, and can increase safety.
One example of this architecture allowing precise control would be:
- setting one or more wheel movement limits,
- commanding “run until [any | multiple] limit is reached”,
- provide either interrupt or polled status - (GoPiGo3 provides polled status)
Examples of allowing increased safety, would be:
- setting one or more safe operation limits such as
– current draw to detect stalled motor (not available on GoPiGo3)
– current draw to detect shorted output pin (not available on GoPiGo3)
– low battery voltage (GoPiGo3 provides polled status value) - stopping or blocking related operations such as:
– stop motors if current spikes after initial rise (not intrinsic on GoPiGo3)
– interrupt brain with “Low Voltage - shutdown now to prevent damage”
(I see some sort of GoPiGo_Power_management process running that might be polling battery voltage.)
Q: Does the EasyGoPiGo3.drive_cm( 25.4 , True) stop the motors, or only polls roughly 10 times per second to see if the limit (both wheels +/-5 deg) is reached?