08M2 motor drive.

shamu

Member
Hi all.

I am using an 08M2 to drive a motor through a FET with PWM.
I started out using two seperate power supplies, 4.5v for the picaxe, 6v for the motor, but have modified the circuit using a voltage regulator so only one power supply is needed.

The problem now is that the picaxe appears to be turning off and back on as though there is a random voltage drop on the supply, can the FET be drawing too much current?

Thanks.


Code:
#picaxe 08M2
#no_data

setfreq m8

pwmout 2, 99, 200
symbol motorspeed = w0
symbol potsetting = w1

Main:

 

 readadc c.1, b8 ' Reads pin6 for an analogue value and stores it in variable b1

 
 

let potsetting = b8*100
let w2 = potsetting/255

 motorspeed = 4 * w2


pwmduty 2,motorspeed

 

goto main
 

Attachments

Last edited by a moderator:

bluejets

Senior Member
First diagram shows short across 4.5v output.
No sign of any caps anywhere.
Might be a good start.
As has been said before, you may need a driver to the mosfet depending on how fast you are switching also.
Mosfet is fairly standard type and probably not switching properly as it requires a much higher gate voltage.
Maybe use a logic level mosfet.
 

besupreme

New Member
Pin 2 needs a ground connection. Logic level Mosfet must be used. The pwm setting is probably too high for direct drive. Add a shottky diode across the motor.
 

shamu

Member
Hi, thanks for the advice.
Can anyone suggest a 'Logic level' FET?
I've had a look but can't decide on which one.
 

westaust55

Moderator
You need to have capacitors around the MCP1702 as per the Datasheet:
http://ww1.microchip.com/downloads/en/DeviceDoc/22008b.pdf

Would also be worth putting a diode a larger (eg 100uF) cap in front of the MCP1702 to provide a bulk energy reservoir to ride through the voltage dips as motor starts.

As mentioned, you need to pull the serial input line of the PICAXE low otherwise it will keep resetting.
See the minimum circuit for PICAXE chips in manual 1. Usually easiest to leave a programming circuit in place.

Note if you have the caps and serialIn pin pull-down the n you need to show these ( ie show your full/entire circuit) or you always get the recommendations to add these.
 

cactusface

Senior Member
PWM.....

Hi,
I have only just got PWM really working for the first time!! This is on my new BOT? But I discovered that driving the motors with anything over 100Hz just made them hum or whistle... These are only small model motors, but it is perhaps the same with most, 1KHz & 10KHz is more then likely fine for dimming LEDs and lamps, but not motors, etc.

And what Westy says too!!

Regards
Mel.
 

shamu

Member
You need to have capacitors around the MCP1702 as per the Datasheet:
http://ww1.microchip.com/downloads/en/DeviceDoc/22008b.pdf

Would also be worth putting a diode a larger (eg 100uF) cap in front of the MCP1702 to provide a bulk energy reservoir to ride through the voltage dips as motor starts.

As mentioned, you need to pull the serial input line of the PICAXE low otherwise it will keep resetting.
See the minimum circuit for PICAXE chips in manual 1. Usually easiest to leave a programming circuit in place.

Note if you have the caps and serialIn pin pull-down the n you need to show these ( ie show your full/entire circuit) or you always get the recommendations to add these.
Hi.
Not sure where you mean when you say 'Put a diode & cap in front of the MCP1702'
 
Top