A simple Python implementation for closed-loop control of linear actuators and/or motors, developed specifically for the Raspberry Pi platform. Primarily developed for geotechnical centrifuge applications at the Department of Civil Engineering, University of Pretoria.
Demo files of both time- and load-based control is included. The class files for the motor driver and ADC (MCP3424) and motor controller (Pololu 24v13) should be replaced/amended as neccesary repending on the particular type of hardware that is implemented.
Either download or git clone this repository to the desired directory on the Raspberry Pi:
cd /home/pi/Desktop
git clone https://github.com/andrebroekman/FlyByPi
- StressTestADC.py - stress test the ADC to determine the performance and reliability with simple metrics
- TimeControl.py - demonstration code of time-based control for a motor/actuator
- LoadControl.py - demonstration code of load-based control for a motor/actuator
To run any of the scripts, first change to the active directory to where the files are stored, followed by the excecuting the script:
cd /home/pi/Desktop/FlyByPi
sudo python3 TimeControl.py
- mMCP3424.py - class file
- mMotorDriver.py - Pololu 24v3 motor driver class file
Archived implementation scripts. Ensure that these scripts are copied to the same directory as that of the class files if they are to be used. Otherwise, create a copy of one for the template scripts that provide a default framework.
A small test utility to demonstration communication using the UDP protocol. A script for both a sever and client is provided. Tested successfully to send packets between a Raspberry Pi in the centrifuge and a computer in the control room.
Fly-By-Pi repository is maintained by Andre Broekman in conjunction with the Department of Civil Engineering, University of Pretoria, South Africa. Feel free to get in touch via LinkedIn, ResearchGate or Twitter. For more information regarding the geotechnical centrifuge located at the University of Pretoria, please contact Prof. SW Jacobsz
