Saturday 19 September 2015

Magstim 200 Hacked: Charging & Triggering Success!

So it's taken a couple of months to figure this Magstim 200 out and i have finally made it charge, trigger and discharge the capacitor.

After my last blog entry where i had disabled the 'Replace Coil' error / interlock by brute-forcing the PAL (Programmable Array Logic IC that seems to control the final safety interlocks to find the correct combinations that would disable the lock, this worked but left me with the device unable to trigger.


The PAL IC on the breadboard along with a binary counter IC (Motorola MC14060B) 
to run through all the 512 combinations of logic inputs to find the state that would disable the 'Replace Coil' error.

You can see on the scope picture above the top trace is the 4th stage counter output to the PAL, the other stages connect to each of the other PAL input pins so it will cycle through every combination as the counter (a Motorola MC14060B) counts upwards. The 2nd lower trace is the output pin that controls the replace coil error, so this is showing there are only two input states that bring the coil error output low indicating a fault.

Note there is a total of 512 output states from this PAL IC but not all the input pins will be applicable to this output condition. Clearly you can see there is only a few input states that control the output which is why there is only 9 clock cycles before the pattern repeats.

I simply clocked the counter first at high speed (a 100khz or so) watching the output on my oscilloscope in roll mode to first check the coil error state does change, then slow down the clock (to just a few hz) so i can stop it when it's in the output condition i want. I can then read off the state of the inputs. This can then be compared to the states seen when the IC is in the actual magstim board when the error is showing. In my case pin 5 was low and should be high. Disconnecting the input pin from it's source and bringing it high removes this lock.


Bodge wire from VCC to pin 5, this should be pulled high to disable the interlock. The bodged on resistor is from the factory!

I also look at the charge voltage of the capacitor, i see a maximum reading of around 1700v, this is less than i expected. In the documentation i have seen from Magstim it indicated it would be around 2800v as seen in this excerpt from "Guide to Magnetic Stimulation" by Reza Jalinous:-



Full video after removing the interlock:


I spent much time tracing the trigger circuit, and found the front panel board supplies 5v to the trigger input of the potted trigger block. This is pulled low by the front panel trigger button only when pin 'K' on the front panel connector is also pulled low to ground.

This pin would be for the interlock switch located on the Magstim coil itself, intended to be held in by the operator when they are ready to trigger the device. So typically they would place the coil where they wanted, hold in the coil interlock and then either press the front panel 'Trigger' or depress a pneumatic foot switch to actually trigger the unit.

So a simple fix, once this was discovered i could remove the multi-way connector from the front panel and solder a bridge wire across those pins on the front panel board.


Bodge wire to remove the coil switch interlock.

In the future i will make some binding posts for the front panel to allow easy connection and disconnection of things i want to blow up or experiment with.

So currently the unit will charge the capacitor to about 1700v in 1% steps. I have done some measurements of this and found the accuracy of this is very approximate and certainly at the higher charges the charge leaks away requiring the unit to keep topping up the capacitor. At the higher voltages the hysteresis of this can be as much as 40v or so. At the moment i am not sure if this self discharge is natural leakage in the capacitor or other parts of the circuit.

At 100% the capacitor is charged to about 1680v so has about 268 Joules of energy stored. The lowest power (1%) will charge the capacitor to about 40v which is 0.15 Joules. The scaling of the % power value to the actual voltage is non-linear, certainly at power levels below 30%. Upto 30% it is much better, at 30% the charge will be about 525v which is actually closer to 10% of full power. Above the 30% the power does rise in more linear fashion to 100%.

The capacitor seems to measure 190uF and is oil filled. Magstim rated the capacitor to a minimum 200,000 full charge cycles. Quite impressive for what it does. I would expect the capacitor was a significant part of the BOM for this device along with the Thyristor. The capacitor i believe is a General Atomics DP Series 39504 which are general purpose pulse capacitors capable of upto 25kA. The 39504 is rated at 185uF at 3000v.

I have also noticed that the mechanical counter only counts when its triggered at over 80% power.

Power Levels vs Voltages vs Joules
1% = 40v = 0.152 Joules
25% = 425v = 17.1 Joules
50% = 850v = 68.6 Joules
75% = 1,275v = 154.4 Joules
100%  = 1,680v = 268.1 Joules

Full video after i resolved the triggering issue: