Quote Originally Posted by Mr*Beaver View Post
Hi Doddy, thanks for coming back.

Unfortunately I next tested the spindle whilst the machine was in the living room being built, however the spindle never caused me an issue in the past so when I swapped it from one machine to the next I thought nothing of it. That was till I blew the power. It's also why I'm ruling out wiring the spindle wrong etc and I have seen it working. I did however run the spindle on a different circuit whilst in the garage and had the same result.

I don't believe it is my RCD as I haven't had any random trips in the past and have been using this VFD and spindle in the past. I do know it has something to do with the arduino board - as really thats the only thing that has changed.

When I initially wired it up I found multiple people who had connected it in the way I describe. I can control the speed to the nearest 1000rmp - from the instructions it does state 'Analog Voltage Frequency Reference Input' I'm not sure it's a true PWM input? However looking at the manual I could also try hooking it into the AI terminal? I'd need to check the current is between - 4~20mA.

I will try feeding a 5v input into it, I like that idea as it should tell me is the issue lies with the PWM/gnd or the DCM/For enable spindle.
Chinglish at it's best - Analogue Voltage Frequency Reference Input... to me at least... refers to the per-unit proportion of the VFD output frequency. So, for a 2.5V (of 5) input = 0.5, then the output frequency would be 0.5 x 400Hz (or 12000 RPM). Nothing to do with a PWM mark/space ratio. My guess is that there's a simple R/C filter on the VI input that is providing crude integration of the PWM signal.

The problem is that without a well-designed input circuitry that the VFD is unlikely designed to suit the PWM output of the arduino (which is not particularly conventional) - the integration function required for the PWM conversion (assuming it's analogue - not unreasonable) requires a timing constant suited to the PWM source - and I think it's optimistic to assume that this will work well (you might find that you have good control over only a small portion of the PWM variable range - but not linearly across the full range).

To use the AI/4-20mA current loop requires more circuitry - you need to generate a constant current, a value of 4mA representing 0 RPM and 20mA representing 24000 RPM, and all the steps between. This is an industrial signalling system that helps avoid errors due to voltage drops in the system. You won't do this easily with an Arduino PWM output. I'd give up on this until you get your tripping bug ironed out.

Quote Originally Posted by Mr*Beaver View Post
I will try feeding a 5v input into it, I like that idea as it should tell me is the issue lies with the PWM/gnd or the DCM/For enable spindle.
If it trips - it's earth leakage. If it doesn't, but does with the PWM input, it is the Type-A RCD reacting to repeated surges from the VFD as it switches rapidly between on and off (though I doubt this, but it's the rationale for this test) - or maybe capacitively coupled earth leakage... which leads me onto...

Quote Originally Posted by Mr*Beaver View Post
Do you think it's worth me grounding the machine earth through an additional power supply? Currently it runs through the laptop power.
Eh?, I'm a little confused - I'm assuming that you have an adequately earthed connection to the machine?, my next thoughts would be how the supply earth is exported to the garage - whether through a 3-core cable or a local earth rod... but you're clear that the trip also occurred in the house and that the RCD circuit is okay, so I won't pursue that.

What do you mean by grounding the machine earth through an additional PSU - currently laptop power - I'm not aware of a laptop PSU that exports an earth - I'm guessing from the language that you've connected the negative supply to the machine earth??, if that's the case then that isn't earthing the machine and this could be a cause of your problem. Absolutely provide a low-impedance earth strap from the machine to the garage supply earth. Also - from your picture of the machine - make sure that all exposed metalwork has a reliable earthing.