Posts

Showing posts from June, 2018

Improving dcservo accuracy

Image
Not being an expert in motor control, I created dcservo project to make a basic platform to create cheap servomotors that could replace stepper motors on certain systems, like 3D printers. I chose to implement a full PID controller but that might have been a bit overkill.

I was talking today to a more knowledgeable colleague who asked me why I needed a PID. My answer was that without the integral action I was getting a significant position error in the steady state, and the derivative action, though a really small value, was needed to keep the system from overshooting. However, he suggested me to focus only on a simpler, proportional controller with a twist: most of my position error is coming from the fact that there is a dead zone where motor does not respond to control action.

It is true, though the motor will move faster the higher the PWM value it is applied to the motor drive, it is also true that low values (between 1 and 50 in my test system) do not cause the motor to move.

I …

Marlin's Bézier vs sinusoidal speed profile

Image
Bugfix-1.1 branch of Marlin firmware does include a fifth-degree (quintic) Bézier polynomial for the speed profile. If you want to use it enable S_CURVE_ACCELERATION define. You can have a look at the source code, luckily well commented so we can understand where it is coming from.

I was curious to check how different that curve was from the sinusoidal speed profile I mentioned in a previous entry. Although the source code comments are very thorough on how they reach their expression, in layman's terms is something the speed along a move is

s(t)= (6*t5-15*t4+10*t3)*|v1-v0|+v0
where v1 is the final speed, v0 is the initial speed and t varies from 0 to 1 to trace the motion.

I was surprised on how it looked quite similar to the sinusoidal case, so I went on and did a comparison with the sinusoidal s-curve:

And the result is that there is not much of a difference so I don't expect much different behavior when using one or the other. 

Too much pressure

Image
A local company built a ram extruder for us. Not very different from a syringe extruder but massive in terms of size and pressure.

Our assumption was that parts had been sized properly, so we did not question the 8.7Nm NEMA34 stepper, nor the 5mm-thick acrylic tube with a 60mm internal diameter. After all, it was not the first time they have built a similar contraption to be used with clay.

Unfortunately, though we try to be very gentle on the extrusion test, we manage to break the tube in a few minutes. Luckily for us, it cracked without sending debris around. We did not expect that at all and when we contacted the seller all sorts of questions were asked, questions we did not have an answer for, like "what was the operating pressure?". I did not have a clue as I was just trying to get the stepper rotating very slowly. Their diagnose was we did it wrong as we set the nominal current (6A) for the stepper driver.

From torque to pressure So I was determined to figure out how …