Magnetic Encoder Board (Deprecated) - ProjectHexapod/Main GitHub Wiki

Overview

We are no longer using a magnetic encoder to sense the compliant linkage position. Instead we have moved to a Compliant Link Sensor.

SPI Connection to Magnetic Encoder Board

The Cape of Stomping reads the angular position of the parallel linkage on the calf from the Magnetic Encoder board using a SPI interface over Ethernet cable. The SPI interface uses three signals: MISO (Master In Slave Out), CLK, and CS (Chip Select). MOSI (Master Out Slave In) is tied high on the Magnetic Encoder board so that the AS5048A will continually be sending back angle data. The fourth twisted pair in the Ethernet cable will be used to carry 3.3V power.

Issues with extending a SPI bus include noise and synchronization problems due to propagation delays. Stompy uses RS422 drivers and receivers to drive twisted pair balanced signals over an Ethernet cable. This provides good noise immunity.

The propagation delay of Ethernet cable is ~5ns/m. If we call the distance between the Cape of Stomping located on the thigh and the Magnetic Encoder board located on the calf ~2m, the cable delay will contribute a delay of 10ns in each direction. The worst-case delay added by the differential receiver (uA9637AC - 25ns) and differential driver (uA9638C - 20ns) is 45ns, so there will be a delay of 55ns between the CoS sending a clock and the ME receiving the clock and replying with data. The data will take 55ns to make it back to the CoS, and must arrive there before it is read on the falling clock edge. The maximum clock rate therefore is 1/( (5ns/m * 2m + (25ns + 20ns) ) * 2 * 2) = 4.5MHz

Stompy runs the SPI clock at ???MHz, so propagation delay is not an issue.

The Cape of Stomping and Magnetic Encoder boards include two-pin debug headers for the differential MOSI signal. If necessary, they can be connected with an additional twisted pair wire to send commands to the Magnetic Encoder. This can be used for debug and for setup.

SPI timing

Some good discussions and resources:

Extending SPI bus:

http://electronics.stackexchange.com/questions/33125/short-distance-board-to-board-communication https://www.ti.com.cn/cn/lit/an/slyt441/slyt441.pdf http://www.avrfreaks.net/forum/max-spi-distance

SPI on BeagleBone Black:

http://hipstercircuits.com/enable-spi-with-device-tree-on-beaglebone-black-copy-paste/ http://www.linux.com/learn/tutorials/746860-how-to-access-chips-over-the-spi-on-beaglebone-black

Magnetic Encoder board physical layout

1.5” x 1.5” board, holes in each corner .116” diameter holes (# 32) for thread size 440 Place center of sensor in center of board

Magnetic encoder magnet selection

http://www.digikey.com/Web%20Export/Supplier%20Content/AustriaMicrosystems_961/PDF/austriamicrosystems-AS5XXX-magnet-selection-guide.pdf?redirected=1

Recommended magnet:

6mm diameter, 2.5mm height, diametrically magnetized Neodymium N35H grade ordered: http://www.madscientisthut.com/Shopping/agora.cgi?cart_id=4252133.30523&product=CNC%20/%20Robotic%20Sensors&user4=Sensor%20Magnets&xm=on

Magnetic field calculator:

https://www.kjmagnetics.com/fieldcalculator.asp