Notifications
Clear all

Possible power supply interference problem

24 Posts
5 Users
6 Likes
1,442 Views
(@valkrider)
Member
Joined: 3 years ago
Posts: 16
Topic starter  

I have a home built Rose Engine lathe. This uses a stepper motor and Arduino for control courtesy of the circuit diagram and code on this site. It works well.

 

Until today I have used a small cross slide with a Dremel mounted on it without issue. However I needed a cross slide with more movement and a beefier motor to do the cutting. I bought one of the Chinese CNC motors and power supply the same as this one Today I connected it all up. I have the Arduino mains power  and the CNC motor mains power connected independently to their own wall sockets.

If I keep the speed of the CNC motor at less than about 50% on the potentiometer the Arduino and stepper work correctly. If I up the speed of the CNC motor then the stepper motor stops and does a couple of steps forwards and then a couple of steps back instead of rotating smoothly in one direction.

I suspect that this may be caused by interference from the CNC motor psu. Does that sound right? Any suggestions on how to fix this?

Below is a photo of my Rose Engine lathe and the CNC motor from AliExpress

Screenshot 2022 10 22 at 18.08.41
IMG 2262a

 

--
Colin
My website


   
Quote
barrie
(@barrie)
Member
Joined: 2 years ago
Posts: 86
 

If you are using AccelStepper I found two issues that affected positions. My project is polar opposite to yours but It may be worth checking.

MoveTo re-calculates speed and in some cases it is recommended that setSpeed is called after MoveTo. 

In my project the acceleration setting interfered with positioning.

 

 


   
ReplyQuote
(@valkrider)
Member
Joined: 3 years ago
Posts: 16
Topic starter  

@barrie Thanks for your comment but I am not using that library I am just using the code on the DroneBot website here.

--
Colin
My website


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2531
 
Posted by: @valkrider

I have a home built Rose Engine lathe. This uses a stepper motor and Arduino for control courtesy of the circuit diagram and code on this site. It works well.

I went to the DBWS site and there are no articles using the words "rose engine" so no reference to the circuitry is available.

You specify that the CNC and Arduino each have their own wall socket but don't specify whether the fuse box can supply both of these sockets (and lights, dust collection, heat and anything else connected on the same line) with enough current to power all devices at full power simultaneously.

Since no real detail is available, the only suggestion is to put a 10uF electrolytic and a 47nF ceramic capacitor across the Arduino's power input and see if that helps (by reducing the chances of a voltage spike and/or a dip in supply voltage interfering with the production of stepper pulses).

Do you use a stepper driver (perhaos with a library) or are you feeding the stepper directly ?

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
(@valkrider)
Member
Joined: 3 years ago
Posts: 16
Topic starter  

@will Yes the power to the workshop can more than handle the power requirements of the rose engine lathe and the motor. See the link in my post to @barrie for the code and circuit I am using. I am using a desktop computer PSU to power the Arduino and the stepper motor.

--
Colin
My website


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2531
 

@valkrider 

Then I would think that it's most likely RF interference, "noise" from the CNC motor or driver.

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1684
 

Hi Colin @valkrider,

  As @will says, it does sound like some kind of electrical noise, but the mechanism is not obvious.

Digital systems are not "generally" very susceptible to RF noise ... although if they have sensors or similar subsystems with low level signals, then these signals can be corrupted and the control mechanism gets confused.

---------

Earth wiring can cause all sorts of problems if there are any loops .. check if there is a connection between the power to the CNC motor and the Arduino power lines. One connection route should be fine, but more than one is not.

-----------

Assuming nothing obvious so far, then I suggest you try 'separating' the CNC motor + power supply from the Arduino. That is I am assuming the 'weird' behaviour of the rose engine part of your rig occurs, regardless of whether it is actually cutting into wood or not, providing you run the motor, so it should be possible to try a number of different situations to discover if it makes any difference.

By separating, include a number of trials:

  1. physically moving the CNC motor + power supply, without changing the mains wiring.
  2. Power the CNC motor+power supply by an extension lead, plugged into a different socket as far as possible from the socket used to power the rose engine/Arduino ... preferably on a different mains circuit ring/circuit.

Of course these trials are not meant as a fix, but as a way of trying to discover the linkage mechanism.

You may like to report your findings of such trials if a fix is not apparent.

Best wishes, Dave


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6972
 

Hi Colin @valkrider, I am having difficulty imagining interference causing this. Maybe I misunderstand though. Is the CNC also controlled by the same arduino, a different arduino, or not at all. 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@valkrider)
Member
Joined: 3 years ago
Posts: 16
Topic starter  
Posted by: @zander

Hi Colin @valkrider, I am having difficulty imagining interference causing this. Maybe I misunderstand though. Is the CNC also controlled by the same arduino, a different arduino, or not at all. 

No the CNC motor is totally independent of the Arduino side. I have a computer PSU supplying the 12v and 5v for the Arduino and the stepper motor. The CNC motor (as per the photo in my OP) has its own PSU and no electrical connection (other than being powered from my workshop 240v supply) to the Arduino side. It is purely when I ramp up the speed of the CNC motor that the problem occurs. It is as though when the pot is turned and the speed increases something happens to the Arduino side that causes it to stop working properly. I will try and do a video later.

 

--
Colin
My website


   
ReplyQuote
(@valkrider)
Member
Joined: 3 years ago
Posts: 16
Topic starter  
Posted by: @davee

Hi Colin @valkrider,

  As @will says, it does sound like some kind of electrical noise, but the mechanism is not obvious.

Digital systems are not "generally" very susceptible to RF noise ... although if they have sensors or similar subsystems with low level signals, then these signals can be corrupted and the control mechanism gets confused.

---------

Earth wiring can cause all sorts of problems if there are any loops .. check if there is a connection between the power to the CNC motor and the Arduino power lines. One connection route should be fine, but more than one is not.

-----------

Assuming nothing obvious so far, then I suggest you try 'separating' the CNC motor + power supply from the Arduino. That is I am assuming the 'weird' behaviour of the rose engine part of your rig occurs, regardless of whether it is actually cutting into wood or not, providing you run the motor, so it should be possible to try a number of different situations to discover if it makes any difference.

By separating, include a number of trials:

  1. physically moving the CNC motor + power supply, without changing the mains wiring.
  2. Power the CNC motor+power supply by an extension lead, plugged into a different socket as far as possible from the socket used to power the rose engine/Arduino ... preferably on a different mains circuit ring/circuit.

Of course these trials are not meant as a fix, but as a way of trying to discover the linkage mechanism.

You may like to report your findings of such trials if a fix is not apparent.

Best wishes, Dave

Thanks @davee I will give what you suggest a try later. I have ordered some ferrite beads which will be here tomorrow to see if that helps.

 

--
Colin
My website


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1684
 

Hi Colin @valkrider,

Does your Arduino have any sensor inputs connected for control? That could include things like microswitches, hall effect, light sensors, etc.

Wires connected to sensors, etc, feeding inputs to the Arduino, will be more susceptible to any stray electric or magnetic fields.

Good luck with your search, Dave

 


   
ReplyQuote
(@valkrider)
Member
Joined: 3 years ago
Posts: 16
Topic starter  

@Dave the only input is from a pot to set the speed of the stepper as per the link in my previous post. No luck today but the ferrites arrive tomorrow.

--
Colin
My website


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1684
 

Hi Colin @valkrider,

  Assuming the potentiometer track is between a voltage supply and ground, you might try putting a capacitor between the slider pin and ground to absorb any spikes ..

Of course, the voltage source should be stable and noise free.

Without analysing the circuit, it is difficult to give 'accurate' values, but perhaps a small electrolytic of 10uF or so and a 0.1uF ceramic in parallel might be a good starting point, assuming the pot is in the 10 kiloOhm region. (Capacitor values are not critical - try what you have - make sure electrolytic is connected the right way round.) Try to get the capacitors near the Arduino inputs.

This might make the control seem a bit 'sluggish' in response to rotation, but this effect may not be noticeable - it depends on componenet values, etc. which I don't know. The first aim is to find a cause for the interference.

Best wishes, Dave


   
ReplyQuote
(@valkrider)
Member
Joined: 3 years ago
Posts: 16
Topic starter  

@davee Dave which potentiometer do you mean the Arduino one or the CNC motor one?

--
Colin
My website


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1684
 

Hi Colin @valkrider,

  Re: Which potentiometer do you mean the Arduino one or the CNC motor one?

  The Arduino one  ...

----------

From the symptoms you describe, I am guessing something is 'confusing' the Arduino, causing its program to run in an unexpected manner.

I am trying to make sure minimise the routes that any electrical noise can be 'seen' by the Arduno program. Digital inputs typically require a large noise signal (e.g. more than a Volt with the 5V Arduino) to disrupt them, but analogue inputs may give false readings with much lower signals.

------------

If this fails to make any difference, then I would look at connecting any unused Arduino inputs to ground by short links on the Arduino board. Although this would be normal practice on a 'production' design, you can normally 'get away' with not doing, providing the inputs are not called up in the program.

Dave


   
ReplyQuote
Page 1 / 2