Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

pwm?

Status
Not open for further replies.

hjl4

Member
Just a simple question.

When using Pic 16f84, is it possible to do pwm?

Can pwm be acheived using delay routine?

If so, Am I able to adjust "ON TIME", using tables?

I code in asm.

P.S. This is for DC shunt wound motor control.

Also pwm needs to be adjustable, as I am using variable resistor, as accelerator.

I'm building an electric mini bike with starter motor. 1 car battery, and need 10 miles minimum range.

Reason for starter? Lots of power, and cheap to convert for continuous duty.

Thanks.
 
Yes, all very easily done. This question should be in the Microcontrollers forum.

Is a starter motor mini bike going to make 10 k with a single car battery? Have people done this before? These motors take up alot of current.

I'm sure others would be able to help you with the circuit. Driving a starter motor is going to need some pretty hefty switchers, and your uC power should definitely be decoupled from the motor power.
 
I hope you're using PWM because connecting the motor straight to the battery would drain the battery extremely quickly. I think a car can only start a couple of times before the battery is dead.
 
hjl4 said:
Just a simple question.

When using Pic 16f84, is it possible to do pwm?

Can pwm be acheived using delay routine?

If so, Am I able to adjust "ON TIME", using tables?

Yes it can, but why bother?.

The 16F84 is long obselete, if you use it's replacement the 16F628, this has hardware PWM which makes your task trivial, and increases performance massively.

If you go for another (even more modern) PIC, like the 16F818 or 16F88, these also have analogue inputs - which simplify reading your controls.

As the processor no longer has to do PWM (as it's a hardware function), it leaves it 100% free to read your controls.
 
I'm building an electric mini bike with starter motor. 1 car battery, and need 10 miles minimum range.

Reason for starter? Lots of power, and cheap to convert for continuous duty.
This sounde like a great project. :D
Your choice of a motor is critical to the projects success ..
If you choose too large a motor , your range will be less.
But a smaller motor like a used motorcycle starter motor should give you more range.. :)
 
williB said:
I'm building an electric mini bike with starter motor. 1 car battery, and need 10 miles minimum range.

Reason for starter? Lots of power, and cheap to convert for continuous duty.
This sounde like a great project. :D
Your choice of a motor is critical to the projects success ..
If you choose too large a motor , your range will be less.
But a smaller motor like a used motorcycle starter motor should give you more range.. :)

Certainly 10 miles sounds rather optimistic?, and a starter motor is a VERY poor choice for such a design.
 
Nigel Goodwin said:
williB said:
I'm building an electric mini bike with starter motor. 1 car battery, and need 10 miles minimum range.

Reason for starter? Lots of power, and cheap to convert for continuous duty.
This sounde like a great project. :D
Your choice of a motor is critical to the projects success ..
If you choose too large a motor , your range will be less.
But a smaller motor like a used motorcycle starter motor should give you more range.. :)

Certainly 10 miles sounds rather optimistic?, and a starter motor is a VERY poor choice for such a design.
Optimistic maybe , but not out of the question.. and if there are any hills on your route maybe you could recharge the battery on the way down.. just food for thought.

I assume your choice of a starter motor is because you happen to have one on hand?
Maybe another choice of a 12V DC motor would be better .
 
williB said:
I assume your choice of a starter motor is because you happen to have one on hand?
Maybe another choice of a 12V DC motor would be better .

A number of years ago I remember seeing "bar stool racing" on the news, adding a car starter motor, a battery, and wheels to bar stools and racing them round the pub. I seem to recall the battery life wasn't very great?, and there was no attempt at speed control - VERY hard to do with a starter motor!.
 
Nigel Goodwin said:
If you go for another (even more modern) PIC, like the 16F818 or 16F88, these also have analogue inputs - which simplify reading your controls.

Doesn't the 16F628 offer analog inputs also? Were you refering to the ADC instead, which the 16F628 lacks?
 
Joel Rainville said:
Nigel Goodwin said:
If you go for another (even more modern) PIC, like the 16F818 or 16F88, these also have analogue inputs - which simplify reading your controls.

Doesn't the 16F628 offer analog inputs also? Were you refering to the ADC instead, which the 16F628 lacks?

It only offers comparator inputs, an ADC is simpler to use for reading your controls.
 
Thanks to all who responded. I'm at work, and just trying to squeeze in here.

Reason for starter motor? It's available.

Ford starter, Pic 16f84, also available.

Actual distance would be 2.5 miles one way.

Battery to be recharged by windmill when parked at home.

Will be used everyday. Hoping it recharges at night.(will have plug in socket in case of no wind).

During the day(at work). small solar panel to maintain battery.

MY brother built one, but motors not lasting because of full on mode.( just a switch).
I'm trying to eliminate the cost of fuel and vehicle registration ect... And no, not interested in a pedal bike.( I tried that)(wildlife could outrun me)(bears ,coyotes ect...)

Also the choice of motor is because of tremendous amount of power available.

Nigel, if I use this chip(16f84), A look up table for pwm, and one for variable position switch, would that work? Or should I just go with chip you use on your tutorials, with variable resistor/potentiometer for speed control?

Thanks in advance.
 
hjl4 said:
Thanks to all who responded. I'm at work, and just trying to squeeze in here.

Reason for starter motor? It's available.

Yes, they generally are easily available, but it doesn't mean it's much good for anything else.

Ford starter, Pic 16f84, also available.

Do you mean you already have a pile of them?, because the 16F628 is just as available (if not more so), and costs less money.

Actual distance would be 2.5 miles one way.

Battery to be recharged by windmill when parked at home.

Will be used everyday. Hoping it recharges at night.(will have plug in socket in case of no wind).

During the day(at work). small solar panel to maintain battery.

MY brother built one, but motors not lasting because of full on mode.( just a switch).

No, it's because it's not designed to run for more than a few seconds a few times a day. unning it slower with PWM won't extend it's life, it may even shorten it due to over heating?.

I'm trying to eliminate the cost of fuel and vehicle registration ect... And no, not interested in a pedal bike.( I tried that)(wildlife could outrun me)(bears ,coyotes ect...)

What is the legal postion where you are?, in the UK you would probably be subject to some kind of legal restrictions (everything is!).

Why not buy a moped?, 100 miles per gallon, cheap registration and insurance, and it will leave a starter motor standing!.

Also the choice of motor is because of tremendous amount of power available.

But it's only designed for very short term use, and is VERY inefficient for anything other than a starter motor!.

Nigel, if I use this chip(16f84), A look up table for pwm, and one for variable position switch, would that work? Or should I just go with chip you use on your tutorials, with variable resistor/potentiometer for speed control?

You could use a simple 555 timer or two?, the PWM isn't really your problem, how are you going to control the motor?.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top