Friday 6 February 2015

Negative feedback force-haptic device with hacked kitchen scales

Want to jump straight to the video... ? Click here.

I'm developing a system that presents virtual balls to a user, who can catch and throw those balls and feel their momentum and weight via a haptic interface that applied forces to the user's hands.

Previously, I was using an open-loop control, calculating the signal to apply to the motor of the haptic device based on the force on the hands simulated from the virtual balls, and the tracked positions of the users real hands.  However, I realised that this is an inadequate control system for a haptic device where the force applied to the user is the primary concern.

I realised I need a negative feedback system, where the force is measured and compared with the simulated force.  I initially tried deriving the force from the current drawn/generated at the motor, but this is not sensitive enough.  Therefore I decided to measure the force directly (thanks to Oliver Coles' suggestion) using some kitchen scales.

I bought Tanita KD-192-GR kitchen scales, rated to measure up to 2kg with sensitivity of 1g.  There is also a 0.1g mode.  Inside the scales, there is a sensor (a wheatstone bridge load-cell), which is wired to the scales' circuit board.  The signal direct from the sensor is too small to use directly with a micro-contoller like the Arduino, so it need amplification via an instrumental amplifier.  The amplifier is likely in the black blob IC that can be seen in the picture, which makes it impossible to get the amplified signal from the on-board hardware directly.  The signal to the LCD is a complicated multiplex-encoded signal that I wasn't about to try and decode, and besides it looked like there was a lot of lag on that signal.  Therefore I went to Tokyo's Akihabara and bought an instrumental amplifier LT1167 (datasheet) to amplify the signal from the load-cell myself.




In the photo below, the instrumental amplifier (the small black chip with a gain-control resistor) uses the Arduino's 5V and ground, and the output of the amplifier is wired into an analog-in pin on the Arduino. The green thing in the picture below is the motor controller, which is receiving a signal from the Arduino.



Bit of a mess, but you can see the motor with pulley and string on the scales in the foreground, the circuit, and an oscilloscope for checking stuff.


The motor that applies the force is mounted on a heavy weight which is balanced on the scale.  The string would be attached to the user's hands, and the force is measured and fed back to the control system.  The measured force is subtracted from the simulated force, and the difference multiplied by a gain factor and passed to the motor controller.  In this way, the motor always tries to maintain the force calculated in the simulation (see wiki about negative feedback).


Unfortunately, the system is far from stable at the moment and I think I am going to have to delve into negative feedback control system theory to understand how to make it work nicely.  If you have any advice, please send me a message!  Have a look at this video of how the system is now!




No comments: