Hi there.. I am about to order a board for use in a greenpower car.. I notice that in the echook documentation, the PWM output frequency is 500Hz.. I would like that frequency to be around 10kHz.. Am I right in thinking that this can be set in the programming..? You will see from the question that I know nothing about programming..😩?.I'm just the guy with the soldering iron... Thank you for any reply..a one word answer will suffice😊
You can change the pwm speed, but not with compete freedom.
To quote from Stack Exchange: ------- The base frequency for pins 5 and 6 is 62500 Hz.
The divisors available on pins 5, 6, 9 and 10 are: 1, 8, 64, 256, and 1024. -------
So you can set it to 5 different speeds: 62500/1 = 62.5khz 62500/8 = 7.8khz - probably that you want? 62500/64 = 976 Hz Etc.
I seem to remember you can also change how the waveform is generated to double or halve those frequencies... But it's been a while since I played with it! Same goes for the code to do it. I seem to remember it's one line, but looks imposing. If you go ahead I'll work it out for you though.
Wow...Exactly what I wanted to know! Thank you for your help..and for your offer of help..We have an enthusiastic team with lots of different skills(although I use this term loosely😊) but no-one knows anything about programming☹️.. Thank you again, and Merry Christmas to you..John Rees..Bristol..The Pod Movement, Chipping Sodbury School..
Lack of programming at secondary school level seems very common unfortunately, it's an incredibly rewarding skill! (Not that I'm biased or anything) Hopefully the eChook can get some people inspired to learn.
Thanks for giving your team name too, it's always interesting to know which teams are using the kits
....till now we have been using the Rotary Racer speed control, together with a very successful live radio telemetry link which we developed ourselves..but we are building a second car now which will need a controller.. I am thinking that the echook board, together with a motor driver stage, will give us more flexibility..and I guess, from the kids point of view, 'Arduino' is now more in fashion than 'Picaxe'...but as they say 'What do I know'!! I'd better quit now, before I get told off for 'waffling' inappropriately on the forum.. So again, many thanks..and I hope you don't mind if I need to ask for a little help later, after I've done my soldering...Kind Regards.. John
...Thanks...There are plenty of driver circuits out there, including the one in our present controller..but if you have any recommendations, then I'm all ears.. We are desperately short of time to get our new car 'track-worthy', and I don't want the guys to be waiting on the 'guy with the soldering iron'!! J
Hi Guys.. Re: PWM frequency for Greenpower motor.. I've fired up the motor on the bench with various PWM frequencies between around 500Hz and around 15kHz, and to my inexperienced eyes and ears, I can tell little difference, if any...so my question is..is there a 'best practice' frequency that is normally used for this type of driver? As always, your advice would be appreciated. John...The Pod Movement...Chipping Sodbury School
If you can clearly hear the PWM whine and can't hear a frequency difference, are you sure that you're successfully changing it? It should be very noticeable. Do you have an oscilloscope or a multimeter with frequency setting that you can test it with?
Best Practice... difficult one. Very often motor PWMs will be ran above the human hearing range, simply to make them inaudible. The flip side of this is that the MOSFET only uses power during switching, so the higher the switching frequency, the higher your losses. We ended up running at 1KHz. It's not as if an audible motor is a disaster on a GP car, and we spent most of our time at 100% throttle anyway!
Edit - If you're passing the PWM signal through a long wire, you'll start seeing transmission line effects. The higher the frequency, the harder it is to work around. 1KHz isn't problematic. 25kHz gave all sorts of weird behavior!
Thanks Rowan.. I think my ears could be the problem here☹️.. I had the scope running and the frequency was definitely changing...but I'm not going to ponder too much over this..As you point out, the cars are usually running flat out anyway!..so if 1k is good enough for you, then it'll work for us..
Re: transmission line effects....Do you mean a long wire between the PWM generator and the output stage, or from the output to the motor? John
My last reply was very brief, sorry - transition line wise, once you have the echook connected to the motor driver circuit it's worth just scoping the PWM signal and seeing what it looks like. On our cars we tried running at 20+ kHz and the scoped signal went from a nice square wave at lower frequencies to a complete mess that you couldn't make any sort of sense of - and the motor behaved accordingly!
Back to the soldering iron? Nah, you've got the resident programmer badge now
...it's also worth mentioning that you should try to minimize the distance between the gate driver circuit and the MOSFET switching element(s) on your motor controller. Additional capacitance here (often due to connection quality/length) is just additional energy that your gate driver circuit has to charge before the MOSFET can fully 'switch'. This leaves the MOSFET in what we call the 'linear' switching region where it's losses are significantly higher than when it's in the 'saturation' (ON) region. Good gate drivers are able to quickly switch the MOSFET gate to minimize this so it's a shame if poor layouts add in additional gate capacitance.
Not sure what motor controller you guys are using so this may not be something within your control, either way, worth keeping in mind and may be useful for future forum'ers
Sorry for the delay getting back, gents..I didn't realise that there were follow ups! As always, thank you for the additional information..By the way, I went back to the bench with my hearing aids turned on (yes...seriously😊) and the various audio PWM frequencies 'screamed' at me from the motor this time😄,!! One more question for you, please.....I feel I should attempt a 'crash course' on Arduino programming....Is there a particular book or a video that comes to mind that you think might help? Thank you.. John..The Pods