Stepper acceleration Issues

With that kind of amperage and voltage and nema 23s, there should be no skipping steps. I don’t have experience with those drivers.

I am still guessing though.

  1. What are the steps/mm? It doesn’t quite fit, but we used to have a Z with 4500 steps/mm and we had to slow it way down because the arduino couldn’t actually toggle the pin that fast and still do all the rest of the computation. That seems like it wouldn’t fit this issue because it would limit your top speed, not your top acceleration.
  2. As I mentioned a little, if the rpms of the motor are very high, the motor creates a reverse voltage that fights the power supply. This ends up making the current going to the motor drop, if the driver gets into saturation. 36V is a lot of voltage to me, so it seems hard to saturate it. But these are nema 23s, which may have much more reverse voltage. If this is the problem, you need to reduce the mechanical advantage, or increase the source voltage. This fits a little better because even though it only has an effect at high speed, it will reduce the torque. The reduced torque, with higher accelerations could cause skipped steps (as in, it can handle 5mm/s/s from a stop. But when it reaches high speed, it can’t.

I have another idea.

What if your drivers are being disengaged between jogging. And there is a delay between enabling them and the driver being ready to move? The uno doesn’t know this. It turns on the enable, starts sending pulses, and the driver ignores them for 500ms and it loses 3mm. If you drop the acceleration, the number of steps in the 500ms is smaller.

When you engrave, it leaves the drivers enabled, so there is no delay and everything is fine.

There is a setting in $$ for how long to leave them enabled after a move, and setting it to 255 or something will make them on permanently. Try that and then make the jogs again.

The thing that doesn’t make it seem like skipping steps is that skipping steps is loud. So if the only symptom is a bad measurement, then that doesn’t sound like skipped steps.

Now we’re talking!

Steps/mm are 320 for x and y/a, 400 for Z. 1600 pulses/revolution (8X microstepping) and 5 mm/rev for X/Y and 4 mm/rev for Z. (1605 and 1204 ball screw respectively). I have tried 2X microstepping and 16X with no real difference in the performance during jogging. As for voltage, the driver can take 48 volts but 36 was a compromise, otherwise I would have to have two supplies. Hard to believe back EMF is a problem but people do discuss it. I have never had to deal with that issue in my past.

I don’t feel missed steps is my issue. Curiously, I don’t have any hold current either. There is a DIP switch that sets hold current at either 50% or 100% of current. I complained to the manufacturer that I don’t measure any voltage in the idle condition on either phase of any of the motors (there are 4 total, with 4 drivers). The manufacture performed a test and measure either 1.8 volts or 3.5 volts across one phase (nothing across the other) depending on the switch setting. I measure 0.0 either way and can easily rotate the ball screw by hand with power applied to the system. This may be a clue to what is happening as well but is it a faulty set of drivers I have or a setting?

Thanks for the thoughtful analysis! I will experiment with the enabling issue, looking for the $$ code.

Keep thinking!

Gary

Here is the machine for reference.

I’m at my computer, so I can see that it would be $1=255. In this case, it would be grbl disabling the motors when idle, not the drivers disabling themselves.

I sure hope that is it.

I maybe spend too much time around here, or maybe I just don’t understand the scale, but that machine looks too small to have so much power in the motors :slight_smile:. Especially for wood. But, like I said, around here, nema17 and belts are the norm.

I will try it. Reprap.org shows a command, M17, that turns on all stepper motors. Since I don’t seem to have any holding current, I thought I might try this as well. Not sure of the syntax however.

As for the machine, I want the capability of machining aluminum as well, hence the beefiness. Most of my medical designs were NEMA 17s w/ belts but they didn’t have to do any work, just move fast.

1 Like

I am in no way trying to make you regret or second guess your choices. It looks nice and beefy.

Just to give you an example of what I am used to though, the machines around here are all nema 17 with belts and controller boards used on 3D printers with integrated drivers. And we definitely have a lot of success. Even with aluminum and a few with thin sheets of steel. gallery-mpcnc

A few other GRBL settings to consider that set jog speeds:
$110 - X max rate, mm/min
$111 - Y max rate, mm/min
$112 - Z max rate, mm/min
$113 - A max rate, mm/min
$114 - B max rate, mm/min
$115 - C max rate, mm/min

These could easily be set too high.

$120 - $125 are acceleration settings for jogs.

Yes. These are the only places I know of to set these values so I have been changing the rates here using UGS.
Since I see a problem jogging if the acceleration is > 1 mm/s/s, with no load, I don’t think acceleration is the problem. You can’t go slower than 1 mm/s/s.

Regards,
Gary Watson

Setting the $1 to 255 seems to have solved two problems!

  1. I now have holding current. I can measure a couple of volts on one of the phases even when the system is idle. Not really necessary with a ball screw system, but It bothered me that it wasn’t there before.

  2. The jogging problem is improved or fixed, not sure quite yet but I will check that out today.

Great detective work! Surprised the vendor didn’t suggest this.

PS - Since you are on a roll, after I leave my system on and connected to my laptop for long idle periods, I often find that the Universal Gcode Sender is no longer responding to the Uno. The Uno is still connected to the com port and UGS recognizes this but all the buttons are greyed out or give an error. I must totally shut down the laptop, not just restart but shut down! I’ve tried disconnecting UGS from the Uno during idle periods, then reconnecting when I want to use the system but that does not seem to help. Any ideas?

:tada:

You’re very good at coming up with confusing problems :frowning:

My first thought is that maybe the uno is in some kind of alarm state. Is there a serial log you can see or a place to force a few commands over to the uno? Even sending ? On a console might help give useful data.

The difference between restart and shutdown is interesting. During shutdown, the hardware gets turned off and back on, but not during a restart. So that makes it sound like some component of your laptop (like a usb hub ir something) is not working right until it gets reset.

Maybe one of the more versed grbl users will know something but I haven’t seen that before.

You could try using cncjs on the v1pi image on a raspberry pi and skio the UGS all together and that would probably skip this peripheral that is acting up.

I haven’t seen that behavior myself, but I only used UGS for a little while for initial troubleshooting and don’t recall leaving it connected for a long time. I switched to cncjs on the v1pi image. I haven’t used my machine in several days, but the pi is running and the USB is connected, so I just tried pulling it up and it responded immediately with status - no greyed out icons.

I realize this doesn’t shed any light on the issue you’re experiencing.

It may not be relevant, but most laptops will turn power off to the USB ports when in sleep mode and there are a lot of different sleep mode levels. Perhaps the port is getting shut down and not getting turned back on. A restart doesn’t do a hardware initialization, but of course a power cycle does.

Yes, this was my first thought. I told the laptop never to sleep, but do let the display shut down. It is a Windows 7 Dell, i5.

What is strange is that the Arduino still returns its status when polled via COM 3 yet UGS, when connected, says it is off line and won’t read the Arduino. Restarting either or both software doesn’t work.

Switching to Raspberry Pi and cncjs is an option but I just got this thing running and am not excited about redoing the electronics already. As I use it more, perhaps I will find more clues as to the problem.

There is definitely something scrambled because yesterday, after a cold restart, there was a big lag in response after requesting a jog. Click -Z, nothing, click again, nothing, click again, wait… three jogs! Computer OFF, restart everything… working like a champ again. Something still wonky!

For future reference, the existence of the v1pi image pretty much removes any barrier to entry on cncjs as long as you’ve got a pi and a power supply for it. There was no “redoing the electronics” when I implemented cncjs beyond plugging the existing USB cable into the port on the raspberry pi. There was about 5 minutes of “configuration” picking the proper firmware type and baud rate, and then it just worked.

There’s a bit more configuration if you connect the pi via wifi or want it to be its own access point, but I don’t trust wifi in the shop environment and have a little ethernet switch.

1 Like

Thanks for the Raspberry Pi encouragement! I’ll admit I haven’t researched that option much so my comments could easily be a misconception of the required effort.

I would like to get rid of the laptop! I will take a serious look, thanks.

So I “bit the bullet” and converted to cncjs on Raspberry Pi. Originally I was choosing between Pi and Arduino to run my router, hence the “rewiring” comment. Now the Arduino is run by the Pi instead of the laptop which solved the problem of lost communication, just as you suggested! Bit of a pain to set up and configure, as I am new to the intricacies of Linux, but I fought through.

I would like the WiFi to work but while the Pi sees my network, it won’t connect. Everything is working and I know my password, it just doesn’t connect. I don’t have ethernet in my garage so WiFi needs to work or I get a WiFi extender w/ethernet but why won’t the Pi connect to my WiFi?

Also, I can’t do anything with files on the Pi due to lack of permissions. I understand that
sudo chmod -R
or something like this will give full permission to all files and folders, but I haven’t tried that yet.

I felt I should give an update on my saga. Thanks again for all the help and suggestions.

Be careful changing permissions too much. It can lead down a rabbit hole of changing stuff.

I made a (slightly older) image with cncjs called v1pi. It has cncjs set up. There is also a hotspot version that will make it’s own wifi if you want to use that.

I’ve had good luck connecting to my network, so I don’t have any tips for your wifi connection. But there are a bazillion users of pi, and there are a lot of beginners and a lot of beginner guides for the pi. I would just start searching for error messages or guides for connecting a generic pi to wifi.

I can’t create a folder or copy files from my flash drive. Is that so much to ask?

I scoured the internet for WiFi help with none so far. “Is it plugged in?”, “Is it too far away?”, and other nonsense comments when talking to someone who understands the basics of WiFi, just not the intricacies of the Pi. I feel I missed a step in the original install of the OS but ??

I’ll keep digging. Thanks.

I don’t have the specs of the pi in front of me but it is possible that your wireless access point or router is doing what’s called band steering. If something sees and connects to the 2.4ghz band, it may shift it to the 5ghz band, even if the connecting device doesn’t support 5ghz. I’ve seen this a lot with older wifi printers. Does your wifi only broadcast one SSID or does it have split bands like SSID, and then SSID_5g, or SSID_2g, or something like that? Just a guess.

My router is old and only shows one SSID which I presume is 2.4 gHz. The Pi sees the ID but when the correct password is entered, it won’t connect.