top of page

Installing a grblHAL Teensy based motion controller in a MillRight Mega V

Here is the process to upgrade a MillRight Mega V from an Arduino Mega Grbl board to a Teensy based grblHAL breakout board (T41U5XBB). It is fairly straightforward though there are quite a few steps. I have grouped them logically so it is a little easier to understand than a long laundry list.


First get the parts you will need.

  1. Obtain the Teensy break out board. There is also an assembly kit available that has all the connectors. You can find them cheaper if you work at it though shipping can add up fast..

  2. Get a Teensy 4.1 from PJRC.com or one of their distributors like Digikey or Mouser. Don't get the lockable version.

  3. Get a USB B to MicroUSB panel cable extension. I got this one from Amazon.

  4. Get or make a mounting bracket. See below.

Prepare the components.

  1. Assemble the T41U5XBB following the instructions in the User Manual. Or, follow step by step in pictures. This will require soldering.

  2. Download and install grblHAL. I have prebuilt versions so you can skip source code building. You will want to install the "grblHAL_T41 3X gangY qei.hex" file by following the instructions.

  3. Configure the T41U5XBB. Run your favorite GCode Sender (I like ioSenderXL) and connect to grblHAL. Using the grblHAL wiki first run info, configure your board to use NO limit switches and control inputs. You may need to power cycle the Teensy to get all the settings to work. Try jogging an axis - if the DRO changes, you are good to go! For an alternative to the wiki page (which is a bit cut and dried) take a look at this blog.

  4. Save all the Grbl settings from the Arduino in the MillRight control box. In ioSender, there is a Backup button that will write them out to a text file. But there are many ways to do it. Display the settings and copy paste or even a screen shot works fine, too.


Install the T415UXBB

  1. Unplug the MillRight Mega V control box, disconnect the probe, limit switch and stepper motor cables. Move the box to a comfortable, well lit work area. Remove the acrylic cover. Label all the wires based on the screw terminals they plug into. There will be two wires per stepper motor (4 pairs total), 2 wires per limit switch, a pair of wires for the probe. There will also be several ground wires. Label all these wires so you can easily hook them up again. Did I mention to label the wires?

  2. Disconnect all the wires from the Arduino Mega V board. You will need a small Phillips head screwdriver. Unscrew the 4 screws holding the board in place and remove it. Carefully move the wires out of the way.

  3. If you are using a mounting bracket, install it now.

  4. Remove the USB panel cable and replace it with the USB B to microUSB one. The one I got (listed above) was an exact match but if yours is different you may need to drill holes or nibble sheet metal to get it to fit.

  5. Study the T41U5XBB - you will see labels for the various terminals. It should be fairly obvious where you will connect the wires. Unscrew the terminals you will be connecting until you hear them click - that means they are fully open. You will need a very small flat bladed screwdriver. Position the T41U5XBB over the opening with the USB port facing the power supply.

  6. I recommend you use ferrules but it is not absolutely necessary. Twist any stranded wire as tight as you can - it will be a tight fit into the screw terminals. You may want to trim the bare wire a bit - mine were stripped a little longer than needed. Be careful not to get any bits of wire onto the board or into the controller box. You might want to practice inserting the wire a couple of times. Try to avoid "cat whiskers" as they can cause shorts and system malfunction. Once the wire is well inserted into the screw terminal, tighten the screw. Repeat that for each wire.

  7. Plug in the USB panel cable and gently rest the board on the control box. You might want to use some cardboard to make sure it doesn't short on anything.


Testing

  1. Move the control box back to the machine and hook up the cables but not the power cord.

  2. Plug in the USB cable to the control box and PC.

  3. Open up your GCode Sender and verify that it can talk to grblHAL and that it sees the limit switches.

  4. Plug in the power cord and reset the EStop button if needed. Watch for any bad signs and be ready to hit EStop.

  5. In your GCode Sender, reset your stepper motor settings (that you saved earlier). - $100-102, $110-112, $120-122 and $130-132. Do not change any other settings yet.

  6. Try jogging each axis. If it jogs in the wrong direction, change the Stepper Direction Invert ($3) setting for that axis.

  7. Once the stepper direction is correct, turn on homing ($22=1). Give it a few seconds and power cycle the controller by unplugging and replugging the USB cable. You may need to restart your GCode Sender. Now, press homing (or send a $H). If any of the axes move in the wrong direction, stop the homing (End key in ioSender) and use Homing Direction Invert ($23) to change it. I had to invert the X axis on our machine. Once you have it homing, your are ready to finish it up.

Finalizing

  1. If using a mounting bracket, attach the board to the bracket. Power the system down and unplug USB first.

  2. Reinstall the acrylic cover.

  3. Place the controller box where you want it.

And thus it is done!


Mounting the T41U5XBB.


You could mount the board on the bottom of the control box. You will need to drill 4 1/8" holes in the bottom. Use the T41U5XBB as a template or use the hole diagram below. Nylon stand offs (or similar insulating tube) are need to keep the board from contacting the metal case. Use 4-40 screws. This will work ok but makes it hard to gain access to the board.


Sheet metal mounting bracket. This is a work in progress. [Update: new blog on mounting the PCB.]


I plan on adding a front panel to give access to cycle start, feed hold and EStop so wanted the board to be more accessible. A bracket could hold t