Turning a Mill into CNC to help with an electric car conversion

Hi Nicholas,

My initial thought was for the easy placement of the motor, where I didn’t want it sticking out the front too much as it has to squeeze through a doorway when taking it out and putting it away. So the front motor sits neatly to the side, plus the belt drive allowed for a reduction with hardly any backlash (with the heavy-duty HTD belts). Also, I wanted to use the ODrive with the motors it was tested with as it needs to be reliable (or fun to tweek).

With the backlash, this should be easily removed in programming/Mach 3, I think it’s impractical to chase down and try to fix all backlash, although as you said you wouldn’t want to introduce more :slight_smile:

The motors produce around 2Nm at full current draw, so this would give somewhere below 8Nm at the leadscrew (taking into account friction) although probably wouldn’t need to run it at that. To eliminate chatter and the mill table drifting while cutting, I will play around with the X & Y axis locks and how much torque goes through the leadscrew to drive them.

Here is Part 2 of the milling conversion, where I am currently editing Part 3.

Plus some pictures of where I am at with it now.

I hope that answers your questions :smiley:


Kind Regards,


1 Like

Hi all,

Just a little update,

I am well on the way to testing the first ODrive, just doing some more milling tonight so that I can fit the rotary encoder, then test off the machine.

I’ll be adding a tensioner idler pulley to each belt to take the slack away too.

It takes me a while due only being able to do this in the evenings and a couple of hours at the weekend. Would love to do this full time :smiley:

Hope you like so far.




Hi all,

Wow, just wow, these ODrive systems are fantastic, so stable and accurate.

I am putting together a video of first install and setup of the system, where my first attempt shows my own shortfalls not reading the help and then stepping through the fine setup. Hopefully, this will help others setup their ODrive’s.

Please let me know if I’m just covering old ground or if this will actually help anyone.

Here is a couple of pictures from the video files I’m using.

Kind Regards,

Neil. (A keen ODriver).

1 Like

Hey Neil

This is a cool project! Excited to see how it turns out.
Quick note, as Wetmelon mentioned, you can use absolute encoders to avoid any movement on startup. You calibrate once, after that no rotation when starting up! It works well, I’m using that myself.


Thanks, what encoders are you using? I may look into them and put them directly on the milling table as well as the motors. With the startup sequence, I would get 0.5mm of movement on the table (minus backlash) so absolute would work better.

My machine is getting noisy too, the motor brushes on the 240v 150W motor are suffering after 10 years, so I may just order another ODrive, 1800W BLDC and some belts to do a little upgrade.


I’m using the AS5047P (Digikey Link).
To use them you’ll need the RazorsEdge firmware branch (from here).

To set up the encoder, follow the instructions at the bottom of the page here ( Under AS5047/AS5048 Encoders)

More info:

Hope that helps!

Thank you that helps a lot, I will take a look through the datasheet and the firmware.

I have the latest ODrive, so all should be good on that front :slight_smile:

No problem!

Heads up though, the latest ODrive comes with the latest firmware from master branch, not RazorsEdge. If you want those features you’ll have to specifically build and flash RazorsEdge. Since you have the latest ODrive you can follow the procedure here to flash.
I don’t know of any precompiled releases of RazorsEdge, but you can follow this guide to build it yourself.

Let me know how it goes :grinning:

Thank you, will try it out.

At the moment I will test with the AMT-102’s as I’ve already machined the mounts for that and see how they fare, then try the AS5047P’s for a bit of comparison. Ideally with any Mill you don’t want any movement on startup :smiley:

The video is taking a while to edit as I am using 2 cameras and capturing the screen too.

I will keep you posted.

Wow @Dev255, this is a cool project. I’m curious as to what you’re planning to use for a CNC firmware. Are you planning on using one of the more traditional options and using the step/direction interface or are you planning to do something different?

Thank you @robopilot99, I’m looking at a few options, possibly Step/Direction initially from Arduino G-code or something similar, plus a direct control mode to tap in co-ordinates and choose a hole to cut (so kind of like manual control’ish). This will help with quick projects that need a quick feature cutting out so I don’t have to 3D CAD every time.

The control part is a little up in the air at the moment as the plan usually changes by the time I get to that point :smiley:

Hi all,

I have now successfully set up and tested the ODrive and BLDC motor :slight_smile:

I decided to make a video covering the whole journey for a new/novice/noob ODrive user. Where I had never set up one of these or used python, so this video will hopefully give those that are unsure of trying this system more confidence to just give it a go.

All of the set up was done by following the “Getting Started” guide on the ODrive website, so hats off to all who wrote that :smiley:

This video steps through: -

  • Installation of the Anaconda Software
  • Installation and configuration of the Zadig software to communicate with the ODrive
  • Stepping through the Getting Started guide while carrying out the setup
  • Actually reading the Getting Started guide (I forgot to put it back into Loop Control Mode, doh!)
  • Tweaking the tuning to get more out of the BLDC

Here is the video (CNC Part 4 - ODrive Set up): -

I hope this helps

Also I can’t remember sharing Part 3, so here is that one also: -

Please let me know what you think,

Thank you.


Hi, fellow ODriver’s,

I am currently editing my Mill conversion Part 5 video and thought I’d put a little update on here.

Wow, again these ODrives are cool and very accurate. I have the Y-Axis up and running on batteries that re continuously charged by a 50W solar panel (not at night obviously ;-). The D5065 Motor runs well with the AMT102 encoder now I have the system re-tuned on batteries, where I can achieve a velocity limit of 350k :smiley:

I have very little backlash on the whole drive system and can accurately repeat table movement shown using a co-axial dial indicator (ignoring the 0.01mm per graticule, I can’t accurately test the distance with this).

I think the system will have to be tweaked more, although very happy with the current performance.

The next step is to connect an Arduino, write a sketch and machine out the X-Axis items.

Will keep you posted. Here are some current pictures so far: -




Good Morning/Evening/Afternoon all,

I have just made Part 5 pubic on YouTube, so here it is: -

Feel free to comment, I’m learning a lot about G-Code and Arduino control at the moment and will be looking to control the ODrive via the ASCII commands as I feel this gives a good level of control for CNC and getting feedback from the ODrive.

From the tests in the video, I will be using the Arduino to control end stops, backlash compensation and G-Code control, so the ODrive has a nice time just looking after the precision motor control.

I have tested the whole table crashing into the back at various speeds with the motor current set to 20A (more than adequate with 4:1 drive reduction) with no damage to anything or belts slipping, where the ODrive just jumps out of Closed Loop Control as expected. Very happy with that :smiley:.

I hope you are enjoying this project, please let me know what you think, even if you spot something wrong that I am doing (I’m learning too).

Happy ODriving.


1 Like

Hi all,

Well, I have the milling machine working on the Y-Axis with a Joypad pinched from a faulty indoor toy helicopter (re-using a redundant item is always best in my book).

The Joypad connects to an Arduino Mega2560 which directly sets up and controls the ODrive.

An LCD and LED 8x8 Matrix is also connected to the Arduino to see all the necessary control and status information from the Arduino Sketch (program).

I have been away for a good few days recently, although took everything with me apart from the Milling Machine. Hence why there is an 8x8 LED matrix connected, this replaced the milling machine to show each mm moved by the Y-Axis in order to tune all the values in the program.

So, what videos am I currently working on?

Connecting up the components to the Arduino.

Explaining through the Sketch (Arduino program).

Tuning the ODrive, Testing its accuracy and milling out an Airsoft part using the Joypad control. (Very accurate by the way :slight_smile:

As you can see there has been a lot of work carried out in the background and now with most of the program written it will be easy to set up the X and Z-Axis when connected. Just the G-Code element to write for the CAD to CNC function, this will allow for parts designed on CAD to be automatically machined out.

I hope you are enjoying this project, all this will greatly speed up the MGF Electric Vehicle Conversion, where I will be able to machine out 3 parts at a time and much faster than I can manually machine them :-D.

Please feel free to comment on anything.

Kind Regards,


P.S. I can’t seem to upload pictures at the moment (popup with “undefined method `original_sha1=’ for #”), so here are the links to them: -

1 Like

Have you had any problems with noise on the encoder lines? I’m working on a similar project with linux CNC and I think noise on the encoder lines is causing the odrive to pick up the index pulse wrong during startup. I haven’t tried adding filter capacitors yet tho. Nice Work!

1 Like

Hi Noodles, sorry, I just spotted your post, I’ve been so busy with the project and working my day job.

Thank you, it’s coming along nicely.

I haven’t had any issues with noise at all, everything works very well even with the standard lead that comes with the encoder running next to the motor lines for 50cm and with the motor current set to 60A. This is running on 12v lead-acid batteries; I believe most people have issues with power supplies, where ripple noise could come from that or don’t have a very solid mount for the AMT102. Even when I knock my drive unit fairly hard, there is no movement from the motor.

You could try adding a large capacitor close to the ODrive power input, or better still have a lead-acid battery connected as a reservoir then the PSU output would be smoothed out and just keeps the battery topped up. I would recommend a cheap wheelchair battery and set the PSU to 12.8v (float charge).

I hope that helps


Hmm good point. I would have never thought of the power supply. I am testing with a REALLY cheap power supply that is 100% not suitable for the final build and never thought to look at that. Thanks so much for pointing this out.

1 Like

No worries a cheap power supply would still be fine to top-up a reservoir battery. Hope you get it sorted.

Hi fellow ODrivers,

As suggested above, here is the video connecting up the Joypad and showing the sketch for this.

I will be showing the full sketch, although it needs a few more tweaks first, I have sorted out backlash too, where the Arduino sketch tests the commanded position for direction changes, then takes over and adds or takes away the backlash amount.

I’m working on the video showing that part at the moment, although in the mean time, here is the video showing the Joypad Sketch and circuit behind connecting it all up.



Part 6 - CNC Mill Conversion

1 Like