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

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.

Hi,

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.

2 Likes

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.

4 Likes

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: -




Enjoy,

Neil.

3 Likes

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.

Neil.

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,

Neil.

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

2 Likes

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.

Enjoy,

Neil.

Part 6 - CNC Mill Conversion

1 Like

Hi all,

Just a little update on this one,

I have been successfully milling on a Joypad Controlled 1 Axis CNC machine, with the ODrive taking ASCII commands from an Arduino Mega 2560.

Not in this video, but I have now removed backlash by monitoring direction changes in the Arduino Sketch and rapidly moving the motor to take up the backlash with excellent results. My Y-Axis has a measured backlash of 0.12mm.

Also, I have now soldered the motor connections directly to the ODrive and (touch wood) had no errors ever since (twas my overtightening of the screw terminals that let me down, MY FAULT).

I say again… AMAZING CONTROLLER!

Here is Part 7 of my mill conversion…

CNC Mill Conversion Part 7

1 Like

Part 8 - The Arduino Sketch, Keypad function, ODrive control and Backlash Compensation.

Here is my latest video of the CNC Mill Conversion, this shows through the Arduino program and various functions to help in the understanding, I know 99% of people on here know this anywhooo, although thought I would share it with you to show you where I am at.

My Mill is now all stickered up ready for the next set of videos, Thank You Oskar for these.

Also, I have received the last two ODrive motors for this project and an ODrive v3.6 56v, so will be getting on with the Z Axis and spindle drive.

I hope you are all well in this crazy time, it has slowed me down with the build, although I am getting back up to speed now.

Stay Safe.

Kind Regards,

Neil.

My Channel - Dev255

1 Like