Skip to content

Setting Up the Motors

bdring edited this page Aug 23, 2020 · 8 revisions

Stepper Motor Setup

Overview

The MidTbot uses the CoreXY feature of Grbl_ESP32. With a CoreXY machine both motors must coordinate motion even for simple moves along one axis. If an axis moves the wrong way, you cannot simply change the $3 setting for that axis. You must leave the $3 settings for X and Y at the default of 0 and correct the direction issue with the wiring.

Reseting Default settings

Set $rst=$ to reset all of the default Grbl settings. This will make sure any previous settings that could be in the controller.

Testing Motor Direction

Plug the motors into the controller as shown in this image (You might get lucky and it will work). Power on the controller and connect to it via USB/Serial port (115200, N,8,1). Check the status by sending the ? character. Make sure your serial terminal sends appends carriage return. It should report that there is an alarm. This is because you have not homed yet.

Send $X to clear the alarm. You then need to send some small test moves to check the direction. Send G91 to put it in (incremental distance mode). Next send G0X2 to move the X axis 2mm to the right. Send G0Y2 to move the Y axis 2mm back. If either of these go the wrong direction you have to rotate one or more of the motor connectors 180 degrees.

Rotate a connector and retry the direction moves. There are 4 possible orientations. You may need to try them all to get it to work.

Homing Test

Send $H to home the machine. It should home the X axis first, then the Y. Each axis should move towards the limit switch mounted on the PCB.

Setting Motor Current.

The motor drivers have a potentiometer to adjust motor current. You want the motor to run just a little warm. If they get too hot, adjust the pot to lower the current. Search for documentation on your driver for more specific details. Hot motors will probably soften and warp your 3D printed parts.

Setting the X,Y 0,0 point.

Homing does not set a 0,0 point. You need to tell it where that is. Typically you would want jog to the lower left point and the set the 0,0 there. After homing move the down in negative Y. Be sure you don't hit the limit of travel. If you do, re-home and try again. Once there, set the 0,0 by sending G10L20P0X0Y0 via the console. There are also zeroing buttons near the jog panel in the GUI.


Pen Servo Setup

Overview

The horn needs to be mounted on the servo at a precise angle. This will be done by moving the servo shaft to the pen up location and mounting the arm in a position that lifts the pen. The machine should be fully assembled except for the servo horn before doing this procedure.

Test the Motion

Plug the servo connector into the PCB and power on the controller. Clear the homing alarm by sending $X over the serial port. Next send $rst=#. This will reset any machine offsets that might be in memory. Send G0Z5 the servo should move to one end of the travel. You can see the other end of the travel by sending G0Z0. Send G0Z5 again to move to the pen up position. The servo should be rotating clockwise to lift the pen and counterclockwise to lower it. Not all servos travel the same way. If yours is going the wrong way, send $3=4 to reverse the Z direction.

Install The Horn

With the machine at Z5, mount the servo horn in a position that holds up the pen lift part. You want it to be holding the pen up close to the max height, but there should be a little travel left. You don't want the servo pushing against the end of the travel. This would stress the servo.

Test and Calibrate

Now test the servo, by sending G0Z0 and G0Z5 a few times. The pen mechanism should be operating properly. If you want to tweak the travel a bit, you can adjust the endpoints by changing the $102 (adjusts Z0) and $132 (adjusts Z5) values. The default for each is 100. That represents 100%. Sending $102=110 would add (towards Z5) about 10% to the Z0 position. Sending $102=90 would subtract (away from Z5) about 10%. The same concept applied to $132 and the Z5 position.

Typically Z5 will be close to where you want because that is how you installed the horn. Z0 might be moving past the point at which the pen is fully down, so you might need to send a $102 value. The valid ranges are 20 to 180. If you go outside that range, it will ignore the value and use 100.

Setting a Z work offset.

During homing the pen should move up. After homing it should move to the current work Z position. That will be 0 (pen down) if you do not offset the work coordinate system from the machine coordinate system.

Send G10L2P0Z-5 via a serial console or the console in in the WebUI. This will make the work Z 5 when the machine Z is 0. You only need to do this once, because the machine will store it in flash memory.