configuring for servomotors
-
I have pulled the servomotors out of the sand table and installed them in UMMD, my corexy printer. I'm trying to configure it, but it's behaving strangely. When I reboot the Duet 2 Ethernet controller board I get a message "M350 Drive Y does not support 1x microstepping with interpolation".
; UMMD configuration ; for firmware version 2.03b2 3/24/19 ; General preferences G90 ; Send absolute coordinates... M83 ; ...but relative extruder moves M555 P1 ; Set firmware compatibility to look like RepRapFirmare M667 S1 ; Select CoreXY mode ; Drives M584 X5 Y6 ; X and Y motors connected to expansion board M569 P5 S0 R1 T4.0:5.0:6.0:11.0 ; motor A M569 P6 S0 R1 T4.0:5.0:6.0:11.0 M569 P2 S1 ; Z motor goes forwards M569 P3 S1 ; extruder motor goes forwards M350 X1 Y1 Z16 E16 I1 ; Configure microstepping with interpolation M92 X25 Y25 Z800 E411 ; Set steps per mm M906 X1600 Y1600 Z1120 E500 I30 ; Set motor currents (mA) and motor idle factor in per cent M84 S30 ; Set idle timeout M205 X20 Y20 Z2 E50 ; Set maximum instantaneous speed changes (mm/sec) M203 X18000 Y18000 Z900 E3000 ; Set maximum speeds (mm/min) M201 X3000 Y3000 Z1000 E3000 ; Set maximum accelerations (mm/s^2) M204 P3000 T3000 ; Set print and travel accelerations (mm/s^2)
I have the motors jumpered for 1000 steps per rev to match the 1000 line encoders in the motors, with 20 tooth drive pulleys that should give 25 full steps per
revmm. When I try to home it it acts like 25 steps/mm isn't enough- it moves extremely slowly and doesn't travel far enough to hit the endstops. Am I using the M350 command incorrectly?The servos use full steps from the controller and can be jumpered for various ustep settings from 800 to 40000 steps/rev.
-
I guess your error on M350 is down to interpolation not being supported at one step for duet 2s.
Separate out your M350 e.g.
M350 X1 Y1 I0 M350 Z16 E16 I1
-
When using external drivers, the microstepping set by M350 is ignored. So you can leave it as the default x16. What matters is that you set the correct steps/mm in M92.
-
you should check current setting of the servo also, because M906 is also ignored for them.
-
@JoergS5 Yeah, I didn't change that setting because it doesn't do anything with the external drivers. The servomotors take whatever current they need to get the job done. Each has its own power supply connection, and its own power supply.
-
@dc42 Thanks! I'll try again....
-
OK, I got it working, but I don't know why it's working. I jumpered the motors for 1000 steps per rev to match the 1000 line encoders. There are 20 tooth drive pulleys so 1 rev moves 40 mm, so steps/mm should be 1000/40=25, but it isn't. It moves the proper distance at 100 steps/mm.
It's printing slowly- 30 mm/sec on a test print first layer, and the first layer starts out like this:
I previously had it set to 20000 steps per rev with 500 steps per mm and it did essentially the same thing. I completed the test print (50 mm/sec after the first layer) at that setting and this is what it looks like:
It's got a pronounced "tree-ring" or "salmon-skin" effect at all the 45 and 135 degree corners of the print (yes, I know it also looks overextruded).
Here's the same print done with steppers, before I installed the servomotors:
Any ideas?
-
@mrehorstdmd said in configuring for servomotors:
OK, I got it working, but I don't know why it's working. I jumpered the motors for 1000 steps per rev to match the 1000 line encoders. There are 20 tooth drive pulleys so 1 rev moves 40 mm, so steps/mm should be 1000/40=25, but it isn't. It moves the proper distance at 100 steps/mm.
I'm a little rusty on encoders, but I'm going to guess this because its a quadrature encoder (4 sensors), so functionally you get 4x the resolution of the disk.
Sorta.It's printing slowly- 30 mm/sec on a test print first layer, and the first layer starts out like this:
It's got a pronounced "tree-ring" or "salmon-skin" effect at all the 45 and 135 degree corners of the print (yes, I know it also looks overextruded).
Here's the same print done with steppers, before I installed the servomotors:
Any ideas?
Yeah, servo's are at their worst at low speeds, as they are not inherently stable/synchronous in the way steppers are. You are probably seeing the limits of the control loop (its jittering back and forth).
You can try re-tuning the PID of the servo.
Or doing something mechanically so they are turning much faster. Or just don't print slow! -
Here's some video - the file was sliced for 50 mm/sec (except 30 on the first layer). I cranked up the speed to see if the mechanism would remain quiet. At 4x (200 mm/sec) it is still quiet. The print is trash- you can't print PETG anywhere close to 200 mm/sec.
Acceleration is only 3k and jerk is only 20, both of which can be increased a lot based on my experience with the sand table, though that may create more print quality issues. If I can get the accuracy problem sorted out, it's going to make a very fast, very quiet printer.
-
@theruttmeister I don't understand why it worked "properly" (never mind the accuracy problem) when I had the steps/rev set to 20k and 500 steps/mm, but when I changed to 1000 steps/rev, it worked "properly" at 100 steps/mm. "Properly" meaning it moved the commanded distance. I'm thinking there may be an issue with pulse duration.
I can tweak the servo parameters, but have no real info on a tuning procedure, so I am using them at factory settings. The manual is little help, and the software that talks to them isn't much more help. It looks like a couple guys in Germany have figured out how to tune them, so I'll try sending some emails.
-
@mrehorstdmd in https://www.facebook.com/groups/137073107015171/ the comment by Rene Bookwoods from July 15 is a similar problem like yours. He expects a too short pulse signal (in a german forum they recommend 3.5 us), another was to lower frequency from 200 kHz to 100 kHz.
A different user recommends setting switch 5 to falling flank/edge (he said it was a recommendation from Sorotec) (was for iHSV57, may be different switch for your servo).
Other problems were bad cable quality and a PSU too weak. -
My guess is that what you are seeing is a limitation of the accuracy of the servo motors, at least as they are tuned now. Typically, 3D printers can resolve to 1/16 microstepping, which is 3200 steps/rev using 1.8deg motors, or 6400 steps/rev using 0.9deg motors. Increasing to x32 microstepping doesn't usually help because the friction is too great. Do the 1000 line encoders on your motors resolve to 1000 points per rev, or are they sensed by quadrature encoders so that they give you 4000 lines per rev? If it's 1000 points per rev then that's quite a lot worse than for a stepper motor.
It will also depend on whether your servos try to achieve the last commanded position, or whether they attempt to guess when the next pulse is to give smoother movement.
I don't see any evidence of missed steps or layer shift in your print, so I think your timings are long enough. However, I suggest you check the hiccup count in case the timings are too long for the print speed.
-
@JoergS5 Thanks for the link. I'll have to spend some time with google translate... Each motor has a 200W power supply, and speed, jerk, and acceleration are all low in the printer, so I don't think it's a power supply issue. I have the pulse width set to 4 us.
@dc42 the specs on the motors are very limited as they come from China. All I know about the encoders is that they are 1000 lines. No idea if they're read in quadrature. Maybe I better open one of them up and have a look. There's no way to know about the control logic. The English manual is poor and so is the software for tuning the parameters. I'll keep playing with it and see what I can get them to do. They may just end up back in the sand table. They worked great for that application.
-
@mrehorstdmd said in configuring for servomotors:
@theruttmeister I don't understand why it worked "properly" (never mind the accuracy problem) when I had the steps/rev set to 20k and 500 steps/mm, but when I changed to 1000 steps/rev, it worked "properly" at 100 steps/mm. "Properly" meaning it moved the commanded distance. I'm thinking there may be an issue with pulse duration.
I can tweak the servo parameters, but have no real info on a tuning procedure, so I am using them at factory settings. The manual is little help, and the software that talks to them isn't much more help. It looks like a couple guys in Germany have figured out how to tune them, so I'll try sending some emails.
I'm more than a little rusty on encoders it turns out. Quadrature means you get 1/4 of the resolution, so your encoder counts are only 250/rev. That means that you can be getting +-0.16mm of drift in X/Y without the servo knowing. In fact there's a very good chance that the motor is jittering by that 0.32mm constantly. It would certainly explain the defects you are seeing.
No idea on the ratios, who knows with cheap Chinese electronics?
-
@theruttmeister said in configuring for servomotors:
I'm more than a little rusty on encoders it turns out. Quadrature means you get 1/4 of the resolution, so your encoder counts are only 250/rev.
I don't think that't right. Say you have an optical linear encoder with 1 black stripe per mm, each pair of stripes separated by a white band of the same width as the stripes (so alternately 0.5mm black and 0.5mm white). Then a quadrature reader will provide 4 transitions per mm, corresponding to the positions at which either of the readers (which are separated by 0.25mm) passes over one of the black-to-white transitions. In theory this means that with 1 stripe per mm you can get 0.25mm resolution.
In practice, the sensors may not detect the two edges of the stripe exactly. For example, the sensitivity of the sensor may be biased so that it changes its output when it is 0.1mm inside the black stripe instead of exactly over the edge. Then the transitions won't occur evenly, and it may be better to count alternate transitions instead of all transitions. This would worsen the resolution to 0.5mm.
On top of this, if the two optical sensors have different biases or they are not exactly 0.25mm apart, then there will be a further irregularity and it may be best to count 1 transition in 4; which would worsen the resolution to 1mm.
So if "1000 lines" really does mean 1000 stripes read by a pair of optical sensors producing quadrature outputs, then I conclude that the resolution will be 1000, 2000 or 4000 counts per rotation, depending on how the controller uses the quadrature output.
-
according to https://webseite.sorotec.de/download/Technische-Daten/servomotoren/jmc/iHSV_600.pdf page 9 P00-10
the iHSV encoder lines can be set by a parameter and can be between 0 and 65535, but I cannot find detail information about the precision. 1000 is only the default setting. In a document was mentioned 1000, 1250 and 2500 as values. The document is for iHSV 42/57/60/86 series.From the images of the iHSV57 servo, the encoder looks like a hall based one, so there are not optical hard limits, just signal resolution (ADC) and measurement errors as the limit (and magnetic distortions).
The used line encoder is the AM26LS32 https://www.ti.com/lit/ds/symlink/am26ls32ac.pdf -
@JoergS5 I interpreted the factory default of 1000 lines in the firmware to be a factory setting based on the specific encoder setup used in the specific motor. There may be other models of motor in which they change the encoder, or supply issues might force changing the encoder, so they would then set it for whatever matched the hardware being used. I could be completely wrong...
-
@mrehorstdmd I was astonished how many parameters can be set. There is eg an electronic gear mentioned in the document, but no explanation for it. When I tune the iHSV, I will try the tool https://github.com/robert-budde/iHSV-Servo-Tool but the setup seems to be a bit complicated in a windows environment.
I searched a while whether there is information about the tolerances for the encoder, something similar to "5% error of the position of the stepper", but I found nothing.
-
@JoergS5 Yeah, lots of stuff to tune, but no information or even a diagram of the control loop and where the parameters fit. I am using default settings for everything for now because of a lack of information on tuning. I opened and saved every image of every settings page from the JMC software and zipped it all into a file here. It provides more information than the manual, but only a little more.
-
@JoergS5 The JMC software for tuning the motors is here. It runs fine on windows, but the UI is awkward, so you'll have to mess around a little to figure it out. You'll need an RS-232 connection, so pick up a USB to RS-232 adapter cable. Look for cables that have the PL2303 chipset. They cost about $10.