There was a video of someone doing this at mrrf, IIRC. If you could build it to have the same interface as the drv8825s, then that’s a good place to start.
Have you ever looked at source code for escs? I know a lot of them have 328p’s in them and are reprogrammable. You’d want physical feedback though, like an encoder, right? Do you have any idea how you would physically attach them?
Not really. I’m not that great when it comes to code in general…
Yeah, but I don’t really care about the feedback going back to the Arduino/Ramps/Marlin. I have no idea if Marlin would even work with feedback, I think the Arduino will be short of available inputs anyways.
What I’d like would be for those motors to behave exactly like steppers behave: the Arduino feeds it with a certain amount of steps in a certain direction, and then the motor tries to match this while using the encoder for his own feedback. So it’d have its own independant circuitry and basically behave like a servo.
I might be wrong but I think an ESC doesn’t work this way, in my opinion an ESC works either with an analog or PWM signals to adjust the output current, not step pulses.
This is the easy part for me. I think I’d just print some kind of bracket, with a similar shape as a regular stepper. Or redesign the motor holders if the shafts are not long enough to allow for the bracket thickness.
Yeah, these are the ones I was thinking of, not MRRF. I think Tom did a vid on them too.
They work that way just because that’s the output from hobby flight controllers. Don’t get me wrong, it would be a big undertaking, but if you could wiggle another two inputs on an ESC for a quadrature encoder, and you were able to write the software for it from scratch, I think that would be a good first revision on the electronics hardware. Unless there is another type of board out there for brushless motors that would work out of the box.
So, in my head, you’ve got a brushless motor attached to an axis of the CNC (maybe through gears or a belt to improve torque, IDK). Then you’ve got an ESC spec’ed for the size of motor you’re driving. Then, you’ve rewritten the software on it to use enable, step, direction, and feedback from an encoder. The encoder is mechanically fixed to give you really really fast updates (something like a quadrature encoder with really high resolution would be great). The software needs to predict a location based on the enable, direction, and step pins, then it needs to compare that desired location to the one produced by the encoder, and it needs to have a stable controller to get there, and stay there (a proportional controller, or a PID controller). The outputs of that is where it gets a little fuzzy for me. You need something that would be able to apply and keep a certain amount of torque depending on the error in position. I’m assuming existing ESCs have that knowledge baked into their source code, so that’s why I was asking about the open source ESCs. There is a GreatScott video about building his own ESC:
So maybe that’s a good place to bail on this stock ESC idea. Making something similar to the GS video would probably be needed just to understand the problem space better. It gets pretty darn complicated though. It sure would be nice if you could just buy a 30A ESC and change the code to read an encoder.
It does seem like they are actually pretty similar to steppers, but with 6 coil configurations instead of 2. I wonder if there are bigger/better stepper controllers that can handle regular BLDC motors. It seems also that if you were to adjust the PWM through a single phase, you could adjust the strength or torque there, until something catches fire. I have no idea if useful torques for CNC machines would require enormous components or not.
GreatScott also uses a setup to measure the BEMF, which is probably an easier way to get feedback instead of a quadrature encoder. He gets it working at low speeds, but his COTS chip gets overheated when doing faster or bigger motors, so you might need to again go straight to higher power components.
Has anyone done anything with the odrive or any other FOC motor drive? I’m looking for people with CNC-related experience since most people working with these are trying to make robot arms which are not quite the same.