In Programming EditorOK that works:
but for some reason the serial terminal opens when i program it.
View
Options
Editor
Serial terminal tickbox
e
In Programming EditorOK that works:
but for some reason the serial terminal opens when i program it.
Thanks a lot i was thinking of reinstalling the program thought that it was a bugIn Programming Editor
View
Options
Editor
Serial terminal tickbox
e
My motor is across town right now. I will be able to do the tests and post some photos if you want in a couple of days.OK, my turn to ask
Are you using your real motor?
If you are, please post
The real schematic
A couple of high quality photographs.
People here want to see what you are talking about.
e
At 17.41 (British time), you said it was working.My motor is across town right now. I will be able to do the tests and post some photos if you want in a couple of days.
no I don't try it on the actual motor i use 2 frequency generators 1 to simulate the hall and 1 to set the frequency (when i don't use the adc command of course ) and i am counting the picaxe's output with a frequency counter.At 17.41 (British time), you said it was working.
At 19.49 , it's "across town"
Are you a Taxi driver?
e
PLEASE, in futureno I don't try it on the actual motor i use 2 frequency generators 1 to simulate the hall and 1 to set the frequency (when i don't use the adc command of course ) and i am counting the picaxe's output with a frequency counter.
It would be nice if a 16 years old could get a driving license (I drive better than my mom but am i going a little off topic? )
But i said that all the tests i am doing are not on the actual motor unless i say that they are done on the motor (post #129)PLEASE, in future
say if you are using
Simulation
or
a REAL MOTOR
It is VERY difficult to know how to help you otherwise.
This is analysis of the last posted circuit diagram that can be found HERE
@arg733
Circuit Analysis:
The use of 10K Resistors on the PMOS Drains means the FET are only getting abot 500 microamps to 1 miliamp of switching current. This means that ALL of the FETS are peforming poorly and inefficiently. The switching signals will not be clean square waves. In fact, this is partly why PWM frequency is changing the speed of motor at the speeds you are seeing. The FETs cannot turn on fast enough because of inadequate drive current. They are staying in the the linear region too long. The PWM control is working to control speed ... not by design, but rather by accident due to poor design. Change R1 - R4 to 220 ohms to give adequate drive current to square up the signals. Better yet, get rid of the P-FETS and keep reading. There are much better ways.
Due to its relatively high drive requirements, the IRF530 FET is a poor choice for driving the coil unless you are using dedicated MOSFET Driver. With your proposed circuit the rise time in the order about 10us on a resistive load. It will be worse on an inductive load. This means that your PWM is not doing what you think it is doing. But since you don't have a scope you can't see the waveforms. A 100V Logic Level FET with lower drive requirement will work much better. Or even better, use a normal level Power MOSFET and a dedicated FET Driver. You should also consider a clamp on the FET to protect it from back EMF.
It is a waste of components and money to use the 16 amp rated P-FETS for small signal logic functions such as inverting and as an AND/NAND gate. Small bipolar transistors will work better and will cost less. That being said, a single $1.00 74HC Logic IC will replace all of the P-FETS, many of the resistors and offer reduced current while providing clean square signals. It will do the exact same thing as all of your P-FETs, except much better.
Correct me if i'm wrong but,:
1.Mosfet's and BJTs are very different as mosfet are voltage switched whereas BJTs are current switched
2.10k resistors are not in series with the gate so even if the gate needs some current to charge the capacitance it does not preventing it to do so. The resistors are only there to pull down the gate and discharge it's capacitance when the 9540 is no longer sending a signal. If i change the resistors to a lower voltage i will in fact have a voltage and current drop.
3.I use 9540 because i have about 40 of them. Thanks
"Mosfet's and BJTs are very different as mosfet are voltage switched whereas BJTs are current switched"
- as a 'one sentence' description that is true.
What geotex stated (that I need to reduce the resistance) is completely false, in fact if I want more current flow I need to increase the resistance so the current going from the 9540 is not drained by the ground. But the loss current by the resistor will be only 1mA (ohm's law) so let's do the math: 19A (9540's datasheet) - 0.001A = 18,999A so the gate of the 540 can draw 18A as there is no series resistance!!! So would you say that 18A is not enough to charge the gate's capacitance...
The datasheet does not mentions gate current it only mentions VOLTAGE Vgs and Vgs(th).
Anyway I am open to suggestions if it would help me to do what I need with less money (AFTER I KNOW THAT EVERYTHING WORKS FINE WITH THE PICAXE, THIS IS NOT MY FINAL CIRCUIT. I intend to add many protections particularly for the picaxe after I know that everything works fine.)
I am open to suggestions after this experimental temporary circuit works out.
Thank you.
Ok don't insist if you both say so, but i don't want to spend 2 days (1 to find the necessary components and 1 to make the pcb) on changing an experimental circuit that may not work anyway. I even thought of testing it on the breadboard but i cant program the picaxe on the breadboard. IF it works i will ask how to make my circuit better and change it to work properly.Back to some basics.
With your unusual circuit , tell me, what voltages are at the gates driving Q3 and Q4?
Now study the Data Sheet for that device.
What current would Q4 allow through at that voltage?
Do you really understand the significance of Vgs and gate charge and capacitance?
OK, let's get into fantasy world and assume your magic Q4 allows 19 Amps through.
What happens when Q4 switches off?
The IRF540 gate discharges via the 10k R4.
What current will that allow?
Your discharge/charge is hugely imbalanced and you will have a crap PWM signal which would greatly restricted in terms of frequency and power handling.
With respect, you really need to start understanding the basic operation before criticising more experience contributors.
Have a read and have a careful think rather than a simple 'knee jerk' response.
I still don't understand where you see a resistor that is not allowing the gate to take more than 500uA? This could only be the case if i had the 10k in series with the gate which would obviously not work.1. True but not the complete story.
2. While MOSFETS are indeed voltage switched, it takes time to overcome the gate resistance & gate capacitance. This time is a function of available current. You PFETS actually have enough current to switch ok, but since the are only operating at 500 microamps source to drain (the 10K resistor) the PWM from the PICAXE is feeding back throughout out the system. The reason for this is the crappy PFET logic gate formed by Q2 and Q3. Reducing Pull down resistors to 200 compensates for this poor design and eliminates most of this noise. The main problem is the way the Motor FET (IRF540) is driven). The Gate can only source or sink about 2 ma of current meaning the rise and fall times of the drain current will be awful.
3. I have some spare boat anchors in my yard. I think i am going to use them to control the speed of my car. I have them attached to a long cable. I keep the accelerator always at half throttle. To slow down I throw anchors out the window and drag them down the road until I get to the speed I want. To speed up I pull some back in.
ll I need now is a Picaxe based speed PID control to operate a winch to drag the anchors in and out of the auto. And don't tell me this won't work. And and don't ask for a mechanical drawing or vehicle weight or anchor weight, or engine horsepower. These don't matter will only confuse you. Just give me the code. OK ?
Why can't you program a Picaxe on a breadboard?snipped
I even thought of testing it on the breadboard but i cant program the picaxe on the breadboard.
Thank you.
I don't believe it will work (for many reasons) so have no fear ... and, you may be "all-out" of asking for help. You have scolded too many VERY talented and knowledgeable folks.Ok don't insist if you both say so, but i don't want to spend 2 days (1 to find the necessary components and 1 to make the pcb) on changing an experimental circuit that may not work anyway. I even thought of testing it on the breadboard but i cant program the picaxe on the breadboard. IF it works i will ask how to make my circuit better and change it to work properly.
Thank you.
But i have the socket soldered on the pcb! So how can i do what you suggest?One tip is to get a few cheap IC sockets of the right size, then pop your PICAXE into a socket and move the whole 'unit'.
Then if you break a leg on the ic socket just pop the PICAXE out and put it in a new socket.
On the MOSFET subject I don't notice any comment from you when others have mentioned MOSFET parameters e.g. Vgs.
You seem to have simply read the 'headlines' on the Data Sheet and skim-read posted replies..
You MUST search and read about MOSFET function as you don't appear to understand the basics e.g. push-pulling the gate.
We'll help if you get stuck - but most of us here (free time volunteers) haven't got the time to do it all for you.
(That's how your posts read, sorry).
You have the socket or the Picaxe soldered to PCB? If socket then just use an extra socket, between Picaxe and socket, as suggested - if the Picaxe is already soldered direct then you are in deep smelly stuff ...But i have the socket soldered on the pcb! So how can i do what you suggest?
Hah! nice trick never thought of that thanks!!! I don't have the picaxe soldered so putting another socket wont be a problemYou have the socket or the Picaxe soldered to PCB? If socket then just use an extra socket, between Picaxe and socket, as suggested - if the Picaxe is already soldered direct then you are in deep smelly stuff ...
It's what Dippy said a few posts ago - I just explained it slightly differently - on another note: Cactusface never said you called anyone anything - but in an old post someone else did.Hah! nice trick never thought of that thanks!!! I don't have the picaxe soldered so putting another socket wont be a problem
Ok sorry then i misunderstood him. See? my English is not that perfect.It's what Dippy said a few posts ago - I just explained it slightly differently - on another note: Cactusface never said you called anyone anything - but in an old post someone else did.
Read the replies carefully - don't just skim them - most of the older Picaxe Forum members can be very precise and even pedantic - but they really do want to help people.
It's an awful lot better than my GreekOk sorry then i misunderstood him. See? my English is not that perfect.
You know greek???It's an awful lot better than my Greek
No - but some French and one of my grandkids shares a flat at university with a greek student.You know greek???
That has to be one of funniest things I've read on this forum. Thanks for making me laugh so much, it made my day...... so i will loose at least 2 days if i want to make a new good circuit and i cant afford that much time......
:interrupt
inc counter
return
offrevs = 0
do
for n=1 to 200 (*see note)
if counter<offrevs then
turn coils off
else
turn coils on
endif
next n
read ADC
compare adjusted ADC with counter
adjust offrevs to increase or decrease power
reset counter
loop