This repo contains a K64F MCU program for Venkat’s Stiffness Tester.
Use uScope to view the live data: https://bitbucket.org/ctw-bw/uscope
- MBED K64F microcontroller
- ME TS70 5Nm torque sensor
- HX711 loadcell amplifier
- Pololu D37 DC motor
- DFRobot 2x2A DC motor shield
- 9V DC adapter
On the HX711 development kit, the RATE pin of the HX711 chip itself was loosened from ground and connected to VDD, to increase the output rate from 10 Hz to 80 Hz.
By hanging a known weight at a measured distance from the sensor we calibrated the sensor together with the HX711 amplifier.
This turns out to be
251733.6 bit/Nm. The sensor has a 24 bit ADC and a default gain of 128. It is run at 5V. Therefor the sensitivity of the torque load cell is
853 Nm/V. (Such that
torque = input / 2^23 * 5V / 128 * 853 Nm/V).
The motor shield should be stacked on top of the K64F. The BioRobotics shield should be stacked on top op the motor shield.
The jumpers on the motor shield should be set to
PWRIN, such that the external power supply is used.
The female 2.1 mm DC jack should be connect to the
PWRIN +/- terminals on the motor shield.
M1 +/- and
M2 +/- of the motor shield should be connected to the
M2 terminal on the BioRobotics shield. (The order of + and – for the motors will flip the direction but otherwise matters not.)
The 6-wire motor connectors need to be connect to the ‘M2’ connector (white to white and red to red).
The other end should be connected to the motor (also white to white and red to red). The motor cable extension can also be used here.
On small HX711 breakout board, connect:
GNDto MCU ground
VCCto MCU +5V
D2on the MCU
D3on the MCU
E+to the sensor Vcc (red wire)
E-to the sensor ground (black wire)
A+to the sensor output 1 (white wire)
A-to the sensor output 2 (green wire)
On the K64F, connect:
D3to the amplifier (see above)
D12to encoder 2, channel B
D13to encoder 2, channel A
A0to POT2 (if using the potmeter)
Baked into the motor shield are the connections:
D4direction motor 2
D5PWM motor 2
D6PWM motor 1
D7direction motor 1
The program can be compiled locally with MBED Studio, or using the online compiler at mbed.org.
MBED includes submodules through the .lib files. They are not literal Git submodules.