Anybody wants a stepper motor analyzer?
-
@dogma2k, can you swap the connections of two analyzers to see if the problem follows the stepper or the analyzer?
BTW, some of the artifacts, but not the noise you marked with arrows, are due to the screen being refreshed during the camera's exposure. You can pause the analyzer (using the || button at the bottom) if you want to avoid it.
-
@rjenkinsgb
At the moment, the power supply comes from a 5V / 5A power pack with 2x1mm² wires to the analyzer housing. In the housing, USB cables are used to distribute to the analyzers.The cables to and from the analyzer for the motors are LIYCY-OB 4x0.5mm² (i.e. shielded cable)
However, I think that the cross-section of the eagle of the USB cable is sufficient. Because the problem only occurs when more than 2 analyzers work at the same time with active engines (with 3 it gets worse over time)
However, I noticed that if I press a button longer with 4 active analyzers, the display then reacts. Just not with the analyzer at the top left, it even switches back and forth on its own
-
@zapta said in Anybody wants a stepper motor analyzer?:
@dogma2k, can you swap the connections of two analyzers to see if the problem follows the stepper or the analyzer?
I can at least swap the analyzers to see if the noise moves with it. But only tonight
BTW, some of the artifacts, but not the noise you marked with arrows, are due to the screen being refreshed during the camera's exposure. You can pause the analyzer (using the || button at the bottom) if you want to avoid it.
That with the II is a good tip.
Another question, I just have the APPLICATION.uf2 from https://github.com/zapta/simple_stepper_motor_analyzer/tree/main/temp
taken and copied. Is this still a beta version or is it already stable? -
@dogma2k , I am not sure what is in that temp dir.
This is the latest stable release of the firmware
https://github.com/zapta/simple_stepper_motor_analyzer/releases/tag/F1.0.4
-
@zapta
So the artifacts with the analyzer. So I can actually rule out everything else.
If I disconnect the stepper with the noise and only have the 3 other analyzers in operation, there are no problems (regardless of whether the steppers are on or off).
Did I possibly break a current sensor while soldering or simply get it defective?P.S. Thx for the link
-
@dogma2k, it's not clear from 'only have the 3 other analyzers in operation' if you tried to monitor the motor that had noise with another analyzer.
Please try this two cases:
-
Operate the analyzer that gave you noise with another motor in and see if you still see noise with the new motor.
-
Operate the motor that gave you noise with another analyzer and see if you still see noise with the new analyzer.
This tell us if the problem is related to the motor and its driver or to the analyzer.
-
-
@zapta
Sry I think the google translator didn't translate it the way I wanted it to.I swapped the analyzer with several analyzers and each time the error (the artifacts) moved with it.
So no matter which stepper or driver is connected to this one analyzer, it always shows artifacts.In addition, I shut down the analyzer with the artifacts and since then there have been no more delays in the other 3 analyzers during printing.
I hope google translates it now understandable
-
@dogma2k said in Anybody wants a stepper motor analyzer?:
I swapped the analyzer with several analyzers and each time the error (the artifacts) moved with it.
So no matter which stepper or driver is connected to this one analyzer, it always shows artifacts.That sounds like some kind of short circuit between the motor side connections and the internal electronics - a faulty current sensor IC or some kind of bridge or shorted pins on the circuit board.
Can you check with a multimeter (on resistance) between the motor connector pins and USB ground, to see if there is an obvious cross-connection, with all cables disconnected?
-
@dogma2k, the blue channel is made of this connector, U2 current sensor, capacitor c2 and the CHB input of the Pico. I suggest to inspect it carefully for anything strange.
Also, when you swap motors and analyzers, if the cables stayed with the same analyzer, I suggest to inspect the cable and connections as well.
-
The cables were always different when I exchanged the analyzer.
In the picture you can see from the red arrows how I rotated the analyzers (all) and each time the noise moved with it.!!This is an old image and is for illustrative purposes only!!
So start top left -> bottom left -> bottom right -> top right. Thus, the possibly defective analyzer was connected to all possible cables and motors.
As I said, the error has migrated and did not remain at the top left.I'll probably just get a new analyzer. Since I find it strange that if the possibly defective analyzer is not connected, all the other three analyzers work without problems
-
@rjenkinsgb
I thought about that today but didn't find the time.
I'll probably get another analyzer. Then I can calmly check the "possibly defective". -
Apparently the analyzer can also be used as a magnetometer. Placing a magnet at the upper left corner gives a reading at Coil A. Positive values means magnet's north pole faces the screen and negative values magnet's south pole.
Useful for example when matching the magnet polarity of a Klicky probe. For higher sensitivity, open the base and place the magnet directly on the sensor.
The current sensor doesn't seems to have memory or hysteresis so I don't think it is effected long term.
-
Hi.
I have made the analyzer using TMCS1101A4B.
It is very nice. Thanks for developing it
I took a video of it in running.
https://youtu.be/eDaxUO8Hbqo?t=115And I have questions.
-
"Current Patterns" and "Phase Patterns" screens are choppy, is this normal?
It sample data for 20ms, but it feels like 2fps.
Is this due to the heavy load of data post-processing on the Raspberry Pi Pico? -
The ACS70331 has a bandwidth of 1MHz, whereas the TMCS1101A4B has a bandwidth of 80KHz.
I think 80KHz is sufficient for measuring stepping motor pulses, is that correct?
-
-
Hi @nyaru, I am glad that it works for you.
- The current and phase pattern, which use signal capturing, have intentional delay between screen updates to allow the user to view the signal. It could update at a higher rate but would be difficult to use.
- The signal is sampled at 100Khz. I am not an expert but by Nyquist–Shannon, 80Khz should be sufficient and maybe theoretically even better than 1Mhz due to lower probability of aliasing. I never used the TMCS1101A4B I believe it should just as fine for this application.
-
Hi @zapta ,I'm currently adapting the schematic and firmware for a different sensor, the MCA1101-5-5 (available on Mouser). They are +-5A, 350 mV/A, 1.5 MHz and they use the SOIC-16 package, but that's not an issue.
The question I have regards the firmware. I've read the source, and to my understanding, I should changestatic const SensorSpec GMR_2P5_SENSOR("G2P5A", 5000, 0.35)
inhardware_config.cpp
, and possibly the initial voltage offset (or is that handled by the Zero calibration?). I should also change the Y-axis values of many of the graphs, but that's easy. Do I have to adjust anything else? (don't bother reading the datasheet if you don't have time, I just need to know if there are other user-defined parameters or constants).
I'll fork the repo once I'm finished
Cheers! -
@keybored, I looked briefly at the chip you linked and it may be doable. I would focus first on the hardware aspects and worry latter about the firmware.
The chip seems to require 5v nominal so if you can't run it on 3.3V you need to power it from the 5V rail and make sure that its analog output doesn't go beyond the 3.3V that is accepted by the Pico's input. Maybe add a resistor in series (e.g. 2K) to limit the current when the analog output goes beyond 3.3v? Or maybe add also a clamping diode to 3.3V if we can't rely on the Pico's internal diodes? Or maybe use a voltage divider (this will increase the 350mv/A but you can compensate in the firmware).
As the max Y range of the firmware, I am not sure if 5A is better than 2A because most hobby steppers are < 2A and you will get better resolution on the screen. Also, if the no current output voltage is 2.5V and it can be measured only up to 3.3V, your max range will be only (3.3-2.5)/0.35 = 2.3V
Anyway, I would start with tackling the 5V aspect. let me know if you will have more questions.
EDIT: looking at the datasheet, the zero current voltage is 2.175V and not 2.5V as I assumed above. In this case, you can achieve +/-3A with the 3.3V adc input of the Pico.
-
@zapta
Thanks for the input! I was thinking about a voltage divider too. That should be extremely easy to compensate for. About the output voltage, I've yet to find how high it goes (shouldn't be more than 4V if we consider the 350mV/A range plus the offset).The main idea behind this adaptation is to use it above the +/-2.5A range on Nema23 and over. +/-3A would be acceptable but not ideal. I perfectly agree on tackling the 5V issue first. I'm quite sure a divider would work fine with the relatively high frequency of the signal, but insight on that would be much appreciated.
I'm still unsure if the firmware is as easy to adapt as you say. Plus, now that you pointed out, I'll probably keep the 2.5A scale.
Thanks for the help and I'll update you with the schematics
-
@zapta Slight change of plans: I found the same sensor, but that works on 3.3V. It's still ±5A, with a lower resolution (230mV/A compared to 350mV/A). It has a lower offset (1.5V) and the full range can be read by the Pico's 3.3V I/O. https://www.mouser.it/ProductDetail/ACEINNA/MCA1101-5-3?qs=PzGy0jfpSMs%252BNw%2FnqBFIdA%3D%3D
It's (theoretically speaking and pinout aside) a direct replacement for the ACS70331. My question now is: firmware-wise, what do I have to adjust? If I understand this correctly, I just have to adapt
//static const SensorSpec GMR_2P5_SENSOR("G2P5A", 2500, 0.4)
to suit my specs
//static const SensorSpec GMR_2P5_SENSOR("G2P5A", 5000, 0.23);
.
Should I also uncomment//constexpr int kMaxMilliamps = 2500;
and set it to 5000 to read the full scale?
For now, I'm just thinking about the analyzer changes, UI and graphs axis can be adjusted later.
Also, what about the offset? It's the same as the ACS70331, so we should be alright?
Thanks in advance for your time and patience. I really like the project and I want to keep it alive.
Cheers! -
@keybored, I would suggest to start with just changing 0.4 to 0.23 and run it as is. The Reset function in the setting page should take care of the different offset level.
Once that works, if you would like to increase the range (and decrease the screen sensitivity which I am not sure is useful for most 'normal' stepper motors), you can look into increasing the range. That would require adding in a few places additional Y scale definitions for 5000ma similar to this
-
@zapta Thanks! I'll change the board design and proceed on this track then. Do you think the lower sensing resolution will impact the quality of the readings?