This repository contains code for reading data from the AIKOH RX-2 force sensor. See the example file rx20_read.py.
The code for reading rx-2 force sensor data can be run in any computer, but since this was intended to be used in a Raspberry Pi 3 B+, some code (like PWM outputs) is specific to this board.
If you are not interested in the code pertaining the RPi 3B+, ignore it.
Requirements
- pyserial
- RPi.GPIO
- matplotlib
- numpy
This can be installed by doing from your terminal
pip install -r requirements.txt
If you are using a RPi, you might find a 'Memory Error' while installing matplotlib using the requirements.txt file. This is due to RPi getting out of memory. A quick fix is to install matplotlib using:
apt-get install python-matplotlib
Any code related to PWM has the purpose of making a PWM signal sweep from 0 to 100% duty cycle at a particular frequency X, in order to get thrust data generated by a quadrotor' rotor. The PWM signal is input to an Hobbyking 40A ESC and the RX-2 force sensor tip tied to a rotor, in order to measure the thrust generated by the rotor as the PWM signal changes.
Some useful info:
###Raspbery pi have the following PWM support:
Pin 12 -- PWM-0,channel-0 Pin 32 -- PWM-0,channel-1
Pin 33 -- PWM-1,channel-0 Pin 35 -- PWM-1,channel-1
RPi.GPIO homepage.