Touching the signal cable changes PWM signal (DC motor speed)

Hi,

I'm working on precise automatic speed regulation for the 24 V DC motor (aprox. 50 W) which drives a 8 mm film projector. I'm using Arduino Uno and L298N module.

The DC motor can be regulated via a transistor system with a potentiometer, that is original and built into the projector. However, it doesn't offer precise enough regulation and the speed of the projector changes slightly with time and with the imperfections on the film perforation. But exact frames per second are crucial to conversion using a DSLR thus the usage of arduino and PWM for powering the motor.

I've also installed a speed sensor (for the shutter disc) which will be essential to the speed regulation. Next step will be automatic a PID regulation.

So far the system measures speed and powers the projector with manually set speed by hardware PWM signal sent from arduino Pin 5 to ENA input of the L298N. Arduino is powered from USB or 9V adapter. But there's a slight problem.

The DC motor of the projector has 4 cables - two are for energising (armature or something I guess) and the voltage between them is stable 24 volts (whatever the speed of the motor). Those I left connected as they were. Two other cables have a voltage of 10 to 24 volts according to the position of the potentiometer - that's how it changes speed. Their polarity reverses via a mechanical switch - that's how it changes direction. But I'm using only one direction, so I don't send the wrong voltage to the L298N.

The power to the second pair now goes from the projector to the Vcc and GND inputs of the L298N module which is then connected to arduino pins 5 (ENA - PWM), 7 (In 1 - HIGH) and 9 (In 2 - LOW). Then the motor is connected to the L298N output via port 1 (HIGH) and 2 (LOW). The arduino, L298N module and the DC motor have the same ground and are connected to one of the motor cables (the one with lower potential, so I guess it's the ground).

The projector can now be regulated via the potentiometer (voltage change) and by PWM as well. By sending AnalogWrite (PWM) signal to EN1 (interval of 140 to 255 seems to work) I can regulate the speed of the motor.

Now if I don't touch anything, it works like it should. But if I touch the cable (just the rubber isolation, basically anywhere) that goes from PIN 9 to In2 of the L298N module, the speed of the motor decreases significantly. The only thing that I think could be the problem is, that the ground of the projector is of different electric potential than the ground of the rest. This is probably due to the armature ground being different to the rest of the motor. But I can't connect them together, because it may damage something in the transistor regulation circuit of the projector and I would lose the option to reverse the motor direction via the mechanical switch on the projector.

Any ideas what could cause the speed decrease when touching the cable?

Thank you in advance.
With regards
Daniel Krnac

DanielKrnac:
The power to the second pair now goes from the projector to the Vcc and GND inputs of the L298N module

I think I understood it up to that point. Then it lost me. What is the second pair. Why would they need power. Why would they be connected to the L298N.

It will be a lot clearer if you make a simple pencil drawing showing all the connections and post a photo of the drawing.

...R

The Arduino and L298 must have common grounds. If the winding it is driving isn't isolated from
the rest of the system that could cause issues. - have you checked this (multimeter continuity testing).

I'd expect the two windings in the motor will be armature and field, and lowering the field voltage will
increase speed, lowering armature voltage will decrease speed so you can figure out which is which.

Its important to keep high current noisy motor wiring well away from any sensitive parts of the circuit,
its good practice to always run twisted pair to motors and power, and use shielded cables for sensors or
remote inputs. Understand what star-grounding is too - ground loops are always trouble.

50W for 8mm film advance? Surely not...

Thanks everyone for the replies.

Robin2: Sorry, I didn't realise it was this confusing (only after I read it today)

So I've made a schematic. There was no symbol for the DC motor that I have (separate winding, separate armature, thus 4 cables) so I sort of made one up by overlaying two normal motors.

The power is supplied from the projector to the L298N and from it to the motor itself.

MarkT: They have common grounds.

I've identified, which two cables are paired (low resistance) and then I measured source voltage and how it changes. That's how I figured out what's what. The armature is powered separately from the field.

The projectors built in speed regulation is done by changing the field voltage (or at least that's what I've figured out).

Good point about the wiring, I'll try to keep them as far away as possible and twist the power cables, thanks. True about the grounding loops, it's a nightmare here in Slovakia trying to connect speaker monitors that use PE conductor without hum or buzz.

About the power, It says - 24 Volts, 2 amps on the motor, but I may have misread that.

Thanks.

I am probably out of my depth here so please don't hesitate to say so.

I don't understand why you have two separate power supplies to the motor - one from the L298 and one from something else.

Are you producing PWM signals on both of pins 5 and 9?

...R

Its a motor with a separate field winding I think.

Robin2:
I am probably out of my depth here so please don't hesitate to say so.

I don't understand why you have two separate power supplies to the motor - one from the L298 and one from something else.

Are you producing PWM signals on both of pins 5 and 9?

...R

By design the film projector changes DC motor direction by reversing the polarity of the field while the polarity of the armature stays the same. Thus it has to be wired separately (and probably for some other reason as well). It's quite a sophisticated projector, it also has a circuit for synchronisation with external audio player so you have 8 mm movies with sound as well.

The pins 7 and 9 are just to tell the L298N to move in the right direction - digitalWrite(7, HIGH) and digitalWrite(9, LOW). Strangely enough, the motor seems to rotate even if pin 9 was set to HIGH as well, which I find odd...

Pin 5 sends PWM signal, analogWrite(5, speed) to L298N in order to change the speed of the motor.

Any ideas, why the speed changes when I touch the cable from Pin 9 to In2?