Motor and solenoid

Hello. I have a brushless dc motor running from a driver and 24v battery that is controlled by pwm from my arduino. From the same battery i have a push pull solenoid, activated by a limit switch but not wired into arduino. The limit switch is on the ground side.

The problem I'm having is when the limit switch is pressed the motor speeds up. How do I stop this from happening.

Any help would be much appreciated

Cheers

Alex

Hello. I have a brushless dc motor running from a driver and 24v battery that is controlled by pwm from my arduino. From the same battery i have a push pull solenoid, activated by a limit switch but not wired into arduino. The limit switch is on the ground side.

The problem I'm having is when the limit switch is pressed the motor speeds up. How do I stop this from happening.

Any help would be much appreciated

Cheers

Alex

You should post your code, a schematic and a link to the motor and driver for faster, more informed help.

By troubleshooting(!)

Without providing complete details of your hardware and how everything is wired up its not really
possible to say. Also you should measure the battery voltage with the solenoid on and off and see if
its changing. Normally it would be expected if the solenoid was taking too much current for the battery
the voltage would drop and the motor would slow down, not speed up, so please give a lot more detail
of the setup.

My guess the problem is in line 23 of the code you have not posted.

Here is the diagram of the motor and driver. I don't have alarm, break or speed connected. The AVI is connected to arduino pwm pin. Arduino is powered by 9v battery. Motor is powered by a 6Ah 25.8v lithium iron battery. The positive terminal is connected to the positive on solenoid. The negative from the battery is connected to the common on limit switch, the N/O is connected to the negative on the solenoid.

Hope this clarifies things.

I was thinking a diode? But not really sure.

Same question here.

Please do not cross post.

How much current is the solenoid drawing? I'd bet it's pulling the driver supply voltage down and making the PWM look relatively higher, so the motor speeds up.
EDIT: You DO have the driver ground connected to Arduino GND?

I would guess the collapsing magnetic field on the solenoid is reeking havoc, but that would be a fairly short pulse. Yes, it might spin a motor a little faster for a blip, but the more important thing is what that pulse is doing to the chips.

Yes, a flyback diode would mitigate those spikes. You never said how big this solenoid is. The bigger, the bigger the spike.

One other thing , is the driver AVI compatible with raw PWM?

@Plex1981, please do not cross-post. Threads merged.

Hi,

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Please show your power supply and how it is ALL connected together.

Thanks.. Tom.. :slight_smile: