Snap Amp Noise affecting USB connection
Moderators: TomKerekes, dynomotion
Snap Amp Noise affecting USB connection
Is the Snap Amp PWM on all the output channels synchronized. i.e. do all the PWM positive pulses on all the bridges activate at the same time? I realize that the pulse widths would be different for each bridge so they would turn off at different times.
I'm having noise issues with a couple of brushless motors causing USB disconnection even though I have an isolator installed.
The reason I'm asking is I built a system with multiple small DC motors a while back and found that if I installed inductors in each motor leg, all the noise issues were eliminated completely. So, if all the bridges PWM signals activate in the same direction at the same time, maybe I could install one inductor in each bus power leg to accomplish the same effect with fewer inductors.
AZ
I'm having noise issues with a couple of brushless motors causing USB disconnection even though I have an isolator installed.
The reason I'm asking is I built a system with multiple small DC motors a while back and found that if I installed inductors in each motor leg, all the noise issues were eliminated completely. So, if all the bridges PWM signals activate in the same direction at the same time, maybe I could install one inductor in each bus power leg to accomplish the same effect with fewer inductors.
AZ
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: Snap Amp Noise affecting USB connection
Hi AZ,
I don't think they switch at the same time depending on mode, enable/disable, direction and such. Shorting SnapAmp Full Bridge Outputs together would likely cause damage. Probably not a good idea to put an inductor in series with the supply either.
I don't think they switch at the same time depending on mode, enable/disable, direction and such. Shorting SnapAmp Full Bridge Outputs together would likely cause damage. Probably not a good idea to put an inductor in series with the supply either.
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: Snap Amp Noise affecting USB connection
What is the SnapAmp switching frequency?
I'm looking at installing inductors in the motor lines and the ones that look like they'll be best are frequency dependant.
AZ
I'm looking at installing inductors in the motor lines and the ones that look like they'll be best are frequency dependant.
AZ
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: Snap Amp Noise affecting USB connection
Thanks Tom,
I was looking too deep in the documentation, I should have just referred to the first website page and there it is!
AZ
I was looking too deep in the documentation, I should have just referred to the first website page and there it is!
AZ
Re: Snap Amp Noise affecting USB connection
I installed inductors on all the brushless motor phases, 2 motors , 3 phases. and I have two ferrite cores on the stepper motor wires. These are all installed within 6 inches of the SnapAmp output terminals.
The inductors seem to have eliminated the USB comms disconnections due to the servos but it looks like the stepper still causes intermittent disconnect. If I run the system with inductors with the servos only and disconnect the power input to the stepper bridge, the system will run for hours without problems either standing still or running G code. If I connect the bus power to the stepper bridge, the USB will disconnect after 30 min to 1 hour of running whether stationary or running G code.
I have dual SnapAmps and this happens no matter which Snap Amp I use for the stepper, and it doesn't matter whether I have the Stepper sharing an amp with a brushless servo or running on it's own.
I have also tried adding inductors to the stepper outputs and it made no difference.
The USB disconnection are the only indication of a problem as there is no other indication of noise issues on the encoder counts or mis positioning and everything runs smoothly. Oscilloscope readings on the 5 volt supply at the 50 pin ribbon cable shows very minimal (0.5 volt) noise. I have used a Snap Amp on dual microsteppers before with no issues so I'm wondering if there is something slightly different when using the stepper bridge configuration in the SnapAmp that could cause this?
Also, when I perform a HomeBrushless C program on init, sometimes it takes multiple revs past the marker channel to detect it and sometimes it catches it immediately. How can I make this more consistent? See attached init program.
AZ
The inductors seem to have eliminated the USB comms disconnections due to the servos but it looks like the stepper still causes intermittent disconnect. If I run the system with inductors with the servos only and disconnect the power input to the stepper bridge, the system will run for hours without problems either standing still or running G code. If I connect the bus power to the stepper bridge, the USB will disconnect after 30 min to 1 hour of running whether stationary or running G code.
I have dual SnapAmps and this happens no matter which Snap Amp I use for the stepper, and it doesn't matter whether I have the Stepper sharing an amp with a brushless servo or running on it's own.
I have also tried adding inductors to the stepper outputs and it made no difference.
The USB disconnection are the only indication of a problem as there is no other indication of noise issues on the encoder counts or mis positioning and everything runs smoothly. Oscilloscope readings on the 5 volt supply at the 50 pin ribbon cable shows very minimal (0.5 volt) noise. I have used a Snap Amp on dual microsteppers before with no issues so I'm wondering if there is something slightly different when using the stepper bridge configuration in the SnapAmp that could cause this?
Also, when I perform a HomeBrushless C program on init, sometimes it takes multiple revs past the marker channel to detect it and sometimes it catches it immediately. How can I make this more consistent? See attached init program.
AZ
- Attachments
-
- HomeBrushlessCGI_0_2j.c
- (10.21 KiB) Downloaded 300 times
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: Snap Amp Noise affecting USB connection
Hi AZ,
Regarding noise/disconnects. You might see here. Can you describe/diagram your grounding and shielding? Are your supplies isolated? What current are you running the Steppers at? Can you tell is KFLOP is being reset or is only the PC disconnecting the USB? You might turn off an LED that will turn back on if KFLOP resets.
Regarding detecting Index pulse: That program loops every 1 millisecond so the Index pulse must be longer than 1 millisecond to be reliably detected. You can change:
Delay_sec(0.001); // wait a millisecond
to:
WaitNextTimeSlice();
to loop every 180us which is more than 5X faster.
You should also change the rotation speed by changing this line:
Write3PH(ch2,A, ++k/1000.0); // move the pole
This causes the motor pole to be moved one cycle every 1000 loops (originally 1 second). So you might change this to 10000.0 to be about 2 seconds after the above change.
Regarding noise/disconnects. You might see here. Can you describe/diagram your grounding and shielding? Are your supplies isolated? What current are you running the Steppers at? Can you tell is KFLOP is being reset or is only the PC disconnecting the USB? You might turn off an LED that will turn back on if KFLOP resets.
Regarding detecting Index pulse: That program loops every 1 millisecond so the Index pulse must be longer than 1 millisecond to be reliably detected. You can change:
Delay_sec(0.001); // wait a millisecond
to:
WaitNextTimeSlice();
to loop every 180us which is more than 5X faster.
You should also change the rotation speed by changing this line:
Write3PH(ch2,A, ++k/1000.0); // move the pole
This causes the motor pole to be moved one cycle every 1000 loops (originally 1 second). So you might change this to 10000.0 to be about 2 seconds after the above change.
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: Snap Amp Noise affecting USB connection
See attached sketch. It's wired this way currently to isolate the issue. There are other motors but they will be running on the other SnapAmp and are not connected now. None of the power supplies are grounded. The stepper motor frame is not currently grounded but will be once mounted on the machine, as will be the other motors / encoders.
It turns out that the K flop must be resetting as I have a flashing led running in a C program that shuts off when the disconnect happens. During the last test it ran about an hour with the motor running at about 10% FRO on a G code program.
Conversely if I have the servo motors running the same program or just sitting idling enabled, It will stay running over 2 hours (when I stop the test) as long as the stepper DC bus is not connected. It also doesn't matter which Snap Amp I connect it to or which channel of the amps is used.
The 9mh inductors were added to try to deal with this issue because they seemed to eliminate all the noise issues with the servos. The inductors extended the run time on the stepper from 15 minutes without the inductors to about 70 minutes with the inductors.
Stepper motor current is set to microstepper amplitude of 60, Snap Amp curr limit set to 10
I also attached an init file that includes all the stepper settings ( Axis 1) as well as all the currently disconnected motors. I modified the C program and G code axis designation so the stepper is on the x axis and is the only one enabled.
BTW:" the modification to the Home Brushless marker channel detection worked great! Thank you.
AZ
It turns out that the K flop must be resetting as I have a flashing led running in a C program that shuts off when the disconnect happens. During the last test it ran about an hour with the motor running at about 10% FRO on a G code program.
Conversely if I have the servo motors running the same program or just sitting idling enabled, It will stay running over 2 hours (when I stop the test) as long as the stepper DC bus is not connected. It also doesn't matter which Snap Amp I connect it to or which channel of the amps is used.
The 9mh inductors were added to try to deal with this issue because they seemed to eliminate all the noise issues with the servos. The inductors extended the run time on the stepper from 15 minutes without the inductors to about 70 minutes with the inductors.
Stepper motor current is set to microstepper amplitude of 60, Snap Amp curr limit set to 10
I also attached an init file that includes all the stepper settings ( Axis 1) as well as all the currently disconnected motors. I modified the C program and G code axis designation so the stepper is on the x axis and is the only one enabled.
BTW:" the modification to the Home Brushless marker channel detection worked great! Thank you.
AZ
- Attachments
-
- HomeBrushlessCGI_0_2j.c
- (10.21 KiB) Downloaded 297 times
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: Snap Amp Noise affecting USB connection
Hi AZ,
What Rev of KFLOP do you have? Rev 1.3 (years ago) add more filtering on the Reset. Most of the KFLOP connectors expose Reset on one pin. If this is connected to a long wire/cable and noise or cross talk affects it a Reset can occur.
What Version of KMotion are you using?
One possibility is the 5V Power Supply and/or its wiring. What is its rating? Could it be overheating or intermittent? How close is it to KFLOP?
The 50 pin breakout also has 5V (and GND) going to your encoders and hand wheel. You might remove that as a test to see if noise is entering there.
On a minor note regarding the C Program. It is poorly formatted and hard to read. Please read this.
Also there is forever loop inside a forever loop which doesn't make logical sense. See also here.
So that would indicate it is not a USB issue but rather a power/GND/noise/Reset issue.It turns out that the K flop must be resetting as I have a flashing led running in a C program that shuts off when the disconnect happens. During the last test it ran about an hour with the motor running at about 10% FRO on a G code program.
What Rev of KFLOP do you have? Rev 1.3 (years ago) add more filtering on the Reset. Most of the KFLOP connectors expose Reset on one pin. If this is connected to a long wire/cable and noise or cross talk affects it a Reset can occur.
What Version of KMotion are you using?
One possibility is the 5V Power Supply and/or its wiring. What is its rating? Could it be overheating or intermittent? How close is it to KFLOP?
The 50 pin breakout also has 5V (and GND) going to your encoders and hand wheel. You might remove that as a test to see if noise is entering there.
On a minor note regarding the C Program. It is poorly formatted and hard to read. Please read this.
Also there is forever loop inside a forever loop which doesn't make logical sense. See also here.
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: Snap Amp Noise affecting USB connection
I must apologize for the C code and formatting. I'm a novice at C so I've a lot to learn. My C programming amounts to "see and hack until it works". Not too much finesse yet.
The Kflop has version 1.3 silkscreened on it and I purchased it July of 2019. I also have another k flop that is at least 2 years old with the same silk screen.
The Kflop software is 4.34.
I have a hard time seeing anything but the stepper setup causing the problem because if the Stepper DC bus is disconnected the problem goes away. Both servos running will run for hours. The stepper system is so compact and there is nothing there but SnapAmp, Kflop motor and 2 feet of motor wire that is no where near any other wiring. No feedback wiring, no shielding, No grounding. It seems that there is no external path to generate a reset so it must be coming from within the boards.
I agree that the K flop is being reset and I keep thinking that it has something to do with the little ground wires running from the the Snap Amps to the K flop. Or that there are two SnapAmps and somehow with the two of them running they will occasionally get into a PWM "Beat frequency" that permeates the system and causes a reset. But I keep getting back to the fact that it only happens with the stepper in the system no matter how the dual amps are configured. The symptom seems to follow the stepper and I've tried with two different stepper motors, different brands etc. so that would seem to eliminate power supply issues or other wiring.
If I install a filter cap on one of the ribbon cable connectors RESET lines, would this same capacitance / filtering be "seen" on all the other reset lines to the other connectors or would I have to install a filter at each connector??
I will also try running it without the 50 pin breakout. As you can see in the sketch, the only connectors on the K flop are to the Konnect and the SnapAmps. I'm going to completely remove one of the SnapAmps to see what happens if I run one SnapAmp with the stepper. I ran a system with two steppers on a Snap Amp about 6 years ago and never saw this problem. Report coming...
AZ
The Kflop has version 1.3 silkscreened on it and I purchased it July of 2019. I also have another k flop that is at least 2 years old with the same silk screen.
The Kflop software is 4.34.
I have a hard time seeing anything but the stepper setup causing the problem because if the Stepper DC bus is disconnected the problem goes away. Both servos running will run for hours. The stepper system is so compact and there is nothing there but SnapAmp, Kflop motor and 2 feet of motor wire that is no where near any other wiring. No feedback wiring, no shielding, No grounding. It seems that there is no external path to generate a reset so it must be coming from within the boards.
I agree that the K flop is being reset and I keep thinking that it has something to do with the little ground wires running from the the Snap Amps to the K flop. Or that there are two SnapAmps and somehow with the two of them running they will occasionally get into a PWM "Beat frequency" that permeates the system and causes a reset. But I keep getting back to the fact that it only happens with the stepper in the system no matter how the dual amps are configured. The symptom seems to follow the stepper and I've tried with two different stepper motors, different brands etc. so that would seem to eliminate power supply issues or other wiring.
If I install a filter cap on one of the ribbon cable connectors RESET lines, would this same capacitance / filtering be "seen" on all the other reset lines to the other connectors or would I have to install a filter at each connector??
I will also try running it without the 50 pin breakout. As you can see in the sketch, the only connectors on the K flop are to the Konnect and the SnapAmps. I'm going to completely remove one of the SnapAmps to see what happens if I run one SnapAmp with the stepper. I ran a system with two steppers on a Snap Amp about 6 years ago and never saw this problem. Report coming...
AZ