Hitachi VFD Connection

The VFD alarm signal to controller estop could potentially be nice to if controller “goes rouge”. I don’t know if the controller would even know if it’s own stepper commands weren’t being followed, but the VFD might sense something and send out the alarm.

By the way, I like your idea of requesting Onefinity to give controller ability to shut down if spindle speed is too far out of range. I don’t know if it can do that or not

As a machinist, not an electrician, all of the schematics and explanations flew over my head. That’s kind of the problem, though. This can be a somewhat highly technical environment to wade through even though a lot of what’s being discussed is in the realm of reasonable safety protocols.

I would wager that this would be easy enough to implement since the software is already monitoring spindle speed in real time. I’d implement a function to further monitor that data and pause the job / terminate the spindle with an M5 command in the event that the expected rpms don’t match the feedback rpms within a given range. Whether or not that range can be at the discretion of the operator or should be based on a hard-coded percentage is up to the developer, I suppose. As an example…

internal class spindle_check
    private void RPM_Check(int program_rpm, int feedback_rpm, status_rpm)
        if (feedback_rpm <= program_rpm * 0.75) // if actual rpms drop 25% or more below programmed rpms
            // pause the running program
            // send M5 command to terminate spindle
            // update UI with status "Spindle Fault" through status_rpm variable

        else { // do nothing but keep the disco ball spinning and update UI with status "Spindle Okay" }

Run that on a timer to scrutinize on a reasonable interval, done and done.

We’re in the same boat with the electronics.
Spindle feedback fault sounds useful in a lot of ways. @OnefinityCNC Any thoughts?

Thanks for the fantastic writeup! Just getting my ducks in a row to move the machine to a spindle and I’m curious if the built-in BRD requires a resistor for a 2.2kw?

I did not add a resister to my setup, and it seems to be working fine.

1 Like

Hey Martin,

The Onefinity has open-loop steppers, which means the controller does not sense whether steps are followed or not. It is a hobbyist machine which means operator usually stands besides the machine full of fascination, with the finger hovering the pause button :slight_smile:. If you have a larger budget and need reliability of unattended operation you can use closed-loop steppers, or servos together with linear encoders on glass scales, which provide feedback to the controller whether the movement was executed correctly or feed back the absolute position of axes respectively. The Onefinity Controller however does not support this.

The Onefinity CNC Controller sees overcurrent and short-circuit of steppers though. And stepper stalling (stall detection is a feature of the Texas Instruments DRV8711 stepper drivers).

The VFD by itself has nothing to do with the steppers of the CNC machine. However should the power needed to hold the spindle speed be exceeded beyond the set current limit (e.g. bit is stucked), the VFD will alarm.

Unlike the trim router, which is a series-wound commutated motor whose speed is dependent of load and with which the frequency of the alternating current has no effect, with a spindle, which is an asynchronuous induction motor, the speed is only dependent from the frequency the VFD produces, and the spindle will hold the speed nearly perfectly no matter what the load is (and if the load drives the current beyond the current limit that was set inside VFD, the VFD will trip and alarm). But if you choose at least a 2.2 kW spindle and you mill only wood, that will rarely happen. However the VFD may trip if you suddenly switch to a lesser speed by a large step and your brake resistor is not able to absorb the current produced by the spindle. A spindle is an induction motor, which immediately turns into being an induction generator if spinning with no power.

After the spindle upgrade, less fascination, a lot more intimidation. Needing full-body safety glasses at this point. :wink:


Hey Martin,

This is right, the Onefinity Controller and the Buildbotics controller do not support this (yet). (It is a feature requested on both).

Yes, see below.

It was not, this is perfectly possible with the Hitachi or Omron VFDs.

Temporarily Overriding ModBus Control on Omron and Hitachi VFDs

For this you have the “Force Operator Mode” (OPE) and the “Force Terminal Mode” (F-TM). While the users of the cheap chinese VFDs have to choose whether they either have manual control of the VFD on the front panel keypad and/or potentiometer, or to leave the control to the CNC controller via ModBus, and have to brachiate through the menus if they want to change this (once for speed control, and once again for RUN/STOP control), users of the Hitachi or Omron VFDs can simply wire a little switch to one of the Intelligent Input Terminals and assign either the OPE or the F-TM function to this input to to be able to use this little switch to temporarily override the assignment of speed and run/stop to ModBus control.

By wiring a little switch to one of the Intelligent Inputs 1-7 and programming this input to OPE or F-TM function, you can switch the selected mode on and off.

  • If you use the “Force Operator Mode” (OPE), enabling the switch will divert control from ModBus to control via the front panel keypad (with Hitachi/Omron, the front keypad is called the “Digital Operator”). This mode allows the use of the keys on the front panel to control spindle run/stop and speed.

    Hitachi WJ200 Front Panel Omron MX2 Front Panel



  • If you use the “Force Terminal Mode” (F-TM), enabling the switch will divert control from ModBus to the digital and analog inputs to control run/stop and speed. For run/stop, usually you use Intelligent Input 1 (see circuit diagram below) and for speed you use a potentiometer of 1-2 kΩ. This means that for enabling F-TM, you will not have your little switch wired to Intelligent Input 1 (which is already in use by the “Run” switch), but to one of 2 to 7.

Note that if you switch to OPE or F-TM mode while the VFD is in “Run” mode (=when the spindle runs), the VFD will first stop the spindle before it follows the new, manually overridden speed setting. Therefore you shouldn’t do this while the CNC is moving, so while running a g-code program, you should first press “Pause” on the Controller before switching to one of these forced override modes, and resume g-code program only after the spindle reached the new, manually overriden speed.

Note that this, as Alan @Alphonse already reported (thanks to Alan!), also answers the spindle pause problem: With a Hitachi or Omron VFD, during a g-code program, you can press pause on the Onefinity CNC display and control the spindle by switching to OPE or F-TM mode in order to be able stop the spindle, and next morning to switch it back on and resume from pausing the g-code program.


Manufacturer's page PDF

Hitachi WJ200


Omron MX2



Yeah, servos - that could be fun! Not anytime soon.
I probably didn’t phrase it the best, but not thinking of direct sensing as in servos or the VFD somehow monitoring the steppers. More just something that would trip VFD even though the controller keeps blindly sending out stepper commands. You listed a couple scenarios, but you’re right - I have a 2.2kw spindle for mostly wood so I’m sure those scenarios are generally pretty unlikely.

1 Like

You know, I actually saw those forced override paragraphs in the manual, but noticed it couldn’t be used on the fly, so I moved on. However, the spindle pause in itself would be well worth it, and maybe a speed change here and there. Now to check out the switch requirements. If only electronics were always plug and play :slightly_smiling_face:. Thanks again for a useful insight

Hey Martin,

Nevertheless, for safety reasons it is always good to record this and other cases in a risk assessment and to ensure that the right thing happens in all cases that may arise. For example, people could hook their VFD/spindle to an undersized circuit breaker. In this case, if the circuit breaker blows, the controller (on a separate circuit breaker) should know it happened.

In any case, with the information above and the further links you have some suggestions on how you can implement such a security concept.

maybe my text is misleading. You can override the ModBus setting on the fly for spindle speed. You just should press “pause” on the Controller before doing this :slight_smile: and resume the program after the spindle reached the new (manually overriden) speed. I think when I will make the addition of a howto of the detailed settings, I will go over the text again.

Agreed. Good to cover as many bases as possible, and automatically, again, if possible.

No, I think I understood you correctly. By “on the fly” I meant tweaking the speed up and down while the program was running. But, even though it’s not quite as convenient, using pause - switch - change speed on VFD - switch back - unpause could certainly be helpful, and not that inconvenient.
Also, the pause and turn off/on spindle is a big bonus for overnight, something comes up and you have to leave garage, lunch break, etc. Appreciate the conversation! Good things come out of it

This seemed like a useful enough feature that I got around to reading up in the Hitachi manual and selector switch specs. But, so I hopefully don’t fry my first VFD or cause other problems …
Is using Forced Operator Mode as simple as …

  1. wiring a shielded twisted pair cable to P24 terminal and Logic Input 1 Terminal on one side, and a, for example, 2-position 24V normally open selector switch on the other side? Leaving short bar in PLC - L position for “sourcing”, which apparently is default in EU and US, and using the internal 24V power.
  2. Setting parameter C001 to 31 (OPE Operator Control), and leaving C011 at 00 (normally open, active high)

I’m looking specifically at this simple selector switch (GCX3300, two-position maintained, N.O.)

Seems to fit with the VFD input specs

So I’m guessing it wouldn’t matter which wire from VFD goes to which terminal on switch contact because it’s just opening and closing a simple circuit?

I realize this post goes in to quite a bit of detail that is probably very simple for the electronics guys out there, but that’s about my electronics level at this point!
Thanks for any input you have

Hey Martin,

yes, it is.

Here I show you an example wiring if you want to be able to override ModBus control with the “Force Terminal Mode (F-TM)” (or with “Force Operator Mode (OPE)”, in this case you simply omit SW 1 and VR 1 and use any of the Intelligent Inputs for your switch you like).

  1. As you can see, in this example I left untouched the switch on Intelligent Input 1 which serves as “Start/Stop Spindle” switch when this input is programmed this way (C001 to 00). This is SW 1 in the diagram.
  2. To choose a unused Intelligent Input to use it for switching to the “Force Terminal Mode” (or the “Force Operator Mode”), you are free to use Intelligent Inputs 2–6 in this example, but since Intelligent Input 6 has not dual use to expect, I chose this one in this example. This is SW 2 in the diagram.
  3. Finally I showed the wiring for a speed knob for spindle speed. It is called VR 1 (VR = variable resistor, aka potentiometer). It acts as voltage divider here by providing a variable analog voltage setting to pin “O”.

If you program Intelligent Input 6 to “F-TM” and you switch it on, then the states of SW 1 (spindle running or stopped) and VR 1 (spindle override speed) will come into effect.

If however you don’t want to use “Force Terminal Mode (F-TM)” but “Force Operator Mode (OPE)” instead, which will enable to control Run/Stop and Spindle Speed from the VFD’s Front Keypad, you can simply omit SW 1 and VR 1. SW 2 will then switch the “Force Operator Mode” on (if you programmed Intelligent Input 6 to this function).

Note that this all assumes that you have set A001 (“Speed Source Selection”) and A002 (“Run Command Source Selection”) both to 03 (“ModBus (RS485)”), which means, the VFD is controlled by the CNC Controller via the ModBus serial communication (with VFD pins SP and SN connected to pins 13 and 14 on DB-25 I/O port on CNC controller). The switch SW 2, wired to Intelligent Input 6 in this example, will then, if activated, override the speed and run commands received via ModBus from the CNC Controller. For this, the Intelligent Input 6 (setting C006) has to be programmed to either 51 “Force Terminal Mode (F-TM)” or 31 “Force Operator Mode (OPE)”. If you choose “Force Terminal Mode (F-TM)”, you should also have Intelligent Input 1 (setting C001) left to default setting 00 “Forward Run/Stop (FW)” which means it will act as a switch for starting and stopping the spindle.

This is correct.

This is a rather beefy switch. The smallest microswitch available would be sufficient :slight_smile: You just switch a logical signal. But your switch is beautiful, I like it.

Terminal 6 is a good option to leave other terminals for their default or dual purposes.

I’ll start with OPE, but leave the F-TM option as a future possibility.

Yes to both

Overcompensation for lack of understanding? :slightly_smiling_face:
Thanks again for sharing your prodigious knowledge with a beginner. I’ll leave you in peace for a bit!

1 Like