kramer65
Posts: 45
Joined: Mon Mar 18, 2013 2:59 pm
Location: Amsterdam

How to drive Brushless DC motor with built in driver and no documentation?

Wed Aug 05, 2020 8:28 pm

ImageImage

I'm building an autonomous boat of which the heart is a Raspi zero. So far I've used a standard BLDC with a simple drone ESC (pictured above).

I now want to start using a more efficient motor, so I bought the 12V 4000RPM version of this motor (pictured below this message). I removed the old motor and connected up the new one. It gave the same beeping sounds when I calibrate it with the software, but after that, it didn't move at all. I used the exact same code and ESC setup with the new and the old motor.

I then found out that my new motor has a "Built-in driver". I think what that means is that the motor has an ESC built in (I'm more of a software guy than a hardware guy, so please excuse me my noobnes). So I then wired up my pi directly to the new motor. I've got the following wire diagram from the new motor:

Image

So I connected it as follows:

* the + from my 12V battery => red wire of the motor
* the - from my 12V battery => black wire of the motor
* the PWM signal from the pi => yellow wire of the motor
* a ground from the pi => blue wire of the motor

I then gave the motor the same PWM signals as I previously gave to the ESC. Unfortunately, now the new BLDC doesn't make any sounds like it's being calibrated. And more importantly, it still doesn't work.

I then contacted the seller on AliExpress and asked them for more documentation and specifically what PWM values the motor expects. Their reply was that they bought these motors from a company who went bankrupt and they have no idea about them.. :o

So yeah, now I'm kinda stuck in what to do with this motor. I of course can just throw this motor away and buy another one with better documentation, but since I already have this motor I would really like to get it going. Does anybody know how I would handle such a case? Where would I start? Do I just start throwing random PWM values at it? Do I open it and remove the built-in driver from it? I'm really lost here, so any guidance on how to handle this would be very welcome!

And for good measure here's a picture of my new motor:

Image

lurk101
Posts: 289
Joined: Mon Jan 27, 2020 2:35 pm

Re: How to drive Brushless DC motor with built in driver and no documentation?

Wed Aug 05, 2020 10:35 pm

Well the photos definitely show circuitry at the bottom of the can. The circuit diagram has one wire labeled PWM, but I suspect it doesn't take a PWM signal at all! It is wired to what appears to be the center of 810K trim pot between 5V (green wire) and ground (blue wire), indicating that the required signal (yellow wire) is analog in the range of 0 and 5V.

Based on the scant info provided that'd be my guess. Not ideal for controlling with a Pi.

User avatar
Imperf3kt
Posts: 4018
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: How to drive Brushless DC motor with built in driver and no documentation?

Thu Aug 06, 2020 2:24 am

Any numbers or labels printed or stamped on the motor?
55:55:44:44:4C
52:4C:52:42:41

Rose coloured glasses are difficult to see through.

User avatar
PeterO
Posts: 5967
Joined: Sun Jul 22, 2012 4:14 pm

Re: How to drive Brushless DC motor with built in driver and no documentation?

Thu Aug 06, 2020 5:56 am

If you somehow wired it up to a standard Brushless ESC I would expect the internal ESC has been damaged.

You might be able to remove the internal ESC and wire up the six coils like a normal BLDC motor and use an external ESC.

Otherwise put it down as a "learning experience".

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
clicky
Posts: 501
Joined: Thu Oct 25, 2012 7:34 am

Re: How to drive Brushless DC motor with built in driver and no documentation?

Thu Aug 06, 2020 7:34 am

kramer65 wrote:
Wed Aug 05, 2020 8:28 pm
So I connected it as follows:

* the + from my 12V battery => red wire of the motor
* the - from my 12V battery => black wire of the motor
* the PWM signal from the pi => yellow wire of the motor
* a ground from the pi => blue wire of the motor

I then gave the motor the same PWM signals as I previously gave to the ESC. Unfortunately, now the new BLDC doesn't make any sounds like it's being calibrated. And more importantly, it still doesn't work.
It is quite intriguing problem you have so I had to read your post (and answers) again and again...

This might be long shot but - just in case you were right and you wired motor the way it was 'supposed' to be wired - as per your and now mine interpretation of wiring diagram - you might have made tiny mistake with PWM:

If you have passed in same PWM as you would for ESC, then motor won't be doing much. PWM for ESCs is servo alike signal - a pulse 1.5ms wide where repeating every 20ms. If that's to produce some voltage on PWM pin - it would be something really low - probably not enough for motor to start moving. But, if you pass in slightly higher frequency, proper PWM (let's say 1KHz or more) with fills from 25%-75% (not 1.5/20 = 7.5%) there's chance it'll start moving. It is worth giving it a go, right?

PS I might have one of those... At least they have 6 wires sticking out of them and I have no idea what are they for! LOL

cleverca22
Posts: 1866
Joined: Sat Aug 18, 2012 2:33 pm

Re: How to drive Brushless DC motor with built in driver and no documentation?

Thu Aug 06, 2020 7:43 am

clicky wrote:
Thu Aug 06, 2020 7:34 am
If you have passed in same PWM as you would for ESC, then motor won't be doing much. PWM for ESCs is servo alike signal - a pulse 1.5ms wide where repeating every 20ms. If that's to produce some voltage on PWM pin - it would be something really low - probably not enough for motor to start moving. But, if you pass in slightly higher frequency, proper PWM (let's say 1KHz or more) with fills from 25%-75% (not 1.5/20 = 7.5%) there's chance it'll start moving. It is worth giving it a go, right?

PS I might have one of those... At least they have 6 wires sticking out of them and I have no idea what are they for! LOL
lurk101 wrote:
Wed Aug 05, 2020 10:35 pm
Well the photos definitely show circuitry at the bottom of the can. The circuit diagram has one wire labeled PWM, but I suspect it doesn't take a PWM signal at all! It is wired to what appears to be the center of 810K trim pot between 5V (green wire) and ground (blue wire), indicating that the required signal (yellow wire) is analog in the range of 0 and 5V.
i'm thinking it might be a bit of both, the PWM signal is ran thru a low-pass filter to make it into an analog level, which then sets the speed
so you can then use either a dumb pot, or a PWM from something digital, but you need higher duty cycles, like clicky said
it may also need a level shifter, to change the 3.3v pwm into 5v pwm, since it may care more about the voltage after low-pass, rather then the duty cycle

achrn
Posts: 437
Joined: Wed Feb 13, 2013 1:22 pm

Re: How to drive Brushless DC motor with built in driver and no documentation?

Thu Aug 06, 2020 8:47 am

cleverca22 wrote:
Thu Aug 06, 2020 7:43 am

i'm thinking it might be a bit of both, the PWM signal is ran thru a low-pass filter to make it into an analog level, which then sets the speed
so you can then use either a dumb pot, or a PWM from something digital, but you need higher duty cycles, like clicky said
it may also need a level shifter, to change the 3.3v pwm into 5v pwm, since it may care more about the voltage after low-pass, rather then the duty cycle
That would be my next test. I'd try 5V, 25 kHz, something that can source and sink 5mA, since that's the PWM for a standard IT equipment fan (e.g. 4-wire PC case fan) and it may well be that they've used the same controller circuitry. Note that teh standard says below 20% duty cycle is allowed to be undefined behaviour, so start it at 50%.

lurk101
Posts: 289
Joined: Mon Jan 27, 2020 2:35 pm

Re: How to drive Brushless DC motor with built in driver and no documentation?

Thu Aug 06, 2020 1:38 pm

First I'd wire it up as in the manufacturer diagram to see if the motor still works. The 800K variable pot will allow you to set the input on the yellow wire anywhere from 0 to 5V. This should allow you to adjust the motor's speed.

If that works, you've determined the yellow wire is a high impedance analog input signal. You can then start worrying about how you would produce that control signal with a Pi.

kramer65
Posts: 45
Joined: Mon Mar 18, 2013 2:59 pm
Location: Amsterdam

Re: How to drive Brushless DC motor with built in driver and no documentation?

Fri Aug 07, 2020 3:41 pm

lurk101 wrote:
Thu Aug 06, 2020 1:38 pm
First I'd wire it up as in the manufacturer diagram to see if the motor still works. The 800K variable pot will allow you to set the input on the yellow wire anywhere from 0 to 5V. This should allow you to adjust the motor's speed.

If that works, you've determined the yellow wire is a high impedance analog input signal. You can then start worrying about how you would produce that control signal with a Pi.
You seem to be right. I just wired it up with just the plus and minus to my 12V source. I then switched on the 12V. To my surprise that made the motor start turning. I was stunned, because all of a sudden it seemed so simple. I then wired 3.3V from my pi to the yellow/blue wire combination and the motor suddenly slowed down. I then wired 5V to the yellow/blue wire combination and that made it turn faster again. If I either proved 5V or don't connect wires at all to yellow/blue, it seems to go at full speed, and when I wire 3.3V it slows down. I suppose that means that if I give it 2V it slows down even further and with 1V it slows down even further. I haven't tested this yet though.

One more question. Do you think I can supply the voltage to the yellow wire with a PWM signal? Or does it really need to be an analog DC?

User avatar
clicky
Posts: 501
Joined: Thu Oct 25, 2012 7:34 am

Re: How to drive Brushless DC motor with built in driver and no documentation?

Fri Aug 07, 2020 4:04 pm

I think PWM should be fine, but as @cleverca22 said - you might 'level shifter' from 3.3V to 5V. I suspect simple transistor (and resistor) of some kind would do. Also, I bet someone here could suggest (and calculate!) appropriate capacitor as well (although not sure if really needed).

The worse case scenario - just stick small resistor on GPIO directly to your middle wire there (yellow?) and you should be able to drive motor from 0% to around 60-65%.

I have no idea why I am so excited for you :D but this topic is this week's favorite for me! LOL

lurk101
Posts: 289
Joined: Mon Jan 27, 2020 2:35 pm

Re: How to drive Brushless DC motor with built in driver and no documentation?

Fri Aug 07, 2020 5:50 pm

kramer65 wrote:
Fri Aug 07, 2020 3:41 pm
lurk101 wrote:
Thu Aug 06, 2020 1:38 pm
First I'd wire it up as in the manufacturer diagram to see if the motor still works. The 800K variable pot will allow you to set the input on the yellow wire anywhere from 0 to 5V. This should allow you to adjust the motor's speed.

If that works, you've determined the yellow wire is a high impedance analog input signal. You can then start worrying about how you would produce that control signal with a Pi.
You seem to be right. I just wired it up with just the plus and minus to my 12V source. I then switched on the 12V. To my surprise that made the motor start turning. I was stunned, because all of a sudden it seemed so simple. I then wired 3.3V from my pi to the yellow/blue wire combination and the motor suddenly slowed down. I then wired 5V to the yellow/blue wire combination and that made it turn faster again. If I either proved 5V or don't connect wires at all to yellow/blue, it seems to go at full speed, and when I wire 3.3V it slows down. I suppose that means that if I give it 2V it slows down even further and with 1V it slows down even further. I haven't tested this yet though.

One more question. Do you think I can supply the voltage to the yellow wire with a PWM signal? Or does it really need to be an analog DC?
Ok, good to know you haven't destroyed the motor! We now know that the motor can be controlled by a voltage range between 0V (blue) and 5V (green) on the control wire (yellow). Contrary to the labeling on the manufacturer's diagram, this does not take a PWM signal at all, and I doubt you'll have much luck controlling it that way. What you need is a digital to analog converter, which the Pi does not incorporate. There must be Pi hats that can provide D/A conversion?

kramer65
Posts: 45
Joined: Mon Mar 18, 2013 2:59 pm
Location: Amsterdam

Re: How to drive Brushless DC motor with built in driver and no documentation?

Fri Aug 07, 2020 6:36 pm

lurk101 wrote:
Fri Aug 07, 2020 5:50 pm
Ok, good to know you haven't destroyed the motor! We now know that the motor can be controlled by a voltage range between 0V (blue) and 5V (green) on the control wire (yellow). Contrary to the labeling on the manufacturer's diagram, this does not take a PWM signal at all, and I doubt you'll have much luck controlling it that way. What you need is a digital to analog converter, which the Pi does not incorporate. There must be Pi hats that can provide D/A conversion?
Thanks! I'll look around for a DAC. Again something new to learn. I love it.. :-)

clicky wrote:
Fri Aug 07, 2020 4:04 pm
I have no idea why I am so excited for you :D but this topic is this week's favorite for me! LOL
That is so cool to hear! I'm also really excited. Maybe you find it interesting to know what it is actually for. I'm a software dude living in Amsterdam and this is called "Project Whisky" because the aim of the project is to build an autonomous solar powered boat which gets me a bottle of Whisky from Scotland. In the past year I've built 3 prototypes. The Whisky 3 is now able to autonomously drive around for 5 hours. The motor I'm asking about in this topic will power the Whisky 4, which has a goal of driving autonomously for 12 hours with one 100W solar panel. Once the Whisky 4 has been successful I want to build the Whisky 5, which will get two 100W solar panels and will attempt to sail across the North Sea to Scotland sometime next summer.

I started this project mainly because I wanted to learn new things; working with electronics, renewable energy, 3D-printing and programming in Golang. But also because the ships sailing the seas are extremely polluting and I'm convinced that it should be possible to build commercial shipping solutions based on the abundance of renewable energy available at sea: sun, wind and waves. So yeah, this is just me keeping myself busy with what I think is awesome stuff.. :D

Below is a picture of the Whisky 3 just before I attached the motor to it (in the background you also see the Whisky 2 btw). The Whisky 4 will look similar to the Whisky 3 (also built out of a PVC tube with all electronics inside) but with a large keel and a solar panel on top.

Image

User avatar
clicky
Posts: 501
Joined: Thu Oct 25, 2012 7:34 am

Re: How to drive Brushless DC motor with built in driver and no documentation?

Fri Aug 07, 2020 10:03 pm

Definitively worthy cause! :D

Also, really nice engineering project (aside ecology and such such). I am now even more intrigued:
  • 12 hours on 100W panel? What does that mean? 100W @ 12V is about 8A which is really good current... But, only with 100% efficiency. So, your project needs really good power management - almost like space age stuff: ability to turn on/off separate components, you excess power to charge batteries and/or use batteries efficiently...
  • you never mentioned batteries. What is the battery capacity you're hoping to run with? What's the best weight/capacity ratio (for given solar panels)
  • and then navigation - GPS? Object collision detection? What other sensors you planned for it?
  • main system is, I suspect Raspberry Pi. Which? Will you have it on all the time or you'll have power management being smart and boot it up and shut it down when required?
  • and then telemetry - what about sending current position/telemetry details back to the 'base'? Black box and recording data?
Those are only some questions I can think of right now. :D
You definitively need to set up a blog and start recording your journey! I've been involved in PiWars competition and over there one of the 'extras' was highly encouraged blogging - recording of the journey teams (and individuals) had leading to competition. In your case - I'm sure many would be interested to see what you've learned while making your Whiskies.

BTW back to the topic - I bet if you connect yellow wire directly to GPIO you'll make it turn faster or slower given good, high PWM frequency and optional capacitor... With transistor between 0V and 5V (and resistor at right side) you might be able to drive motor from stand still to full speed, too... Worse case I can see is that motor will stutter (not drive smoothly) in case PWM is not fast enough. One option for 'good and stable' PWM on GPIOs is pigpio library. If you had picked Rust over golang I would be able to point you to even better one - derivative of servoblaster...

pidd
Posts: 1269
Joined: Fri May 29, 2020 8:29 pm
Location: Birkenhead, Wirral, UK
Contact: Website

Re: How to drive Brushless DC motor with built in driver and no documentation?

Sat Aug 08, 2020 12:15 am

Not a good idea putting a capacitor straight on the output pins, it can cause high peak currents.

However with a resistor and a capacitor you can make an rc low pass filter which will convert PWM into a relatively steady DC voltage.

lurk101
Posts: 289
Joined: Mon Jan 27, 2020 2:35 pm

Re: How to drive Brushless DC motor with built in driver and no documentation?

Sat Aug 08, 2020 1:38 am

pidd wrote:
Sat Aug 08, 2020 12:15 am
However with a resistor and a capacitor you can make an rc low pass filter which will convert PWM into a relatively steady DC voltage.
Or, one of these, and one of these to level shift the 3.3V I2C to 5V.

achrn
Posts: 437
Joined: Wed Feb 13, 2013 1:22 pm

Re: How to drive Brushless DC motor with built in driver and no documentation?

Sat Aug 08, 2020 8:03 am

But before buying extra components, why not just stick a highish frequency PWM on the input and see if it works with no extra circuitry? Depending what's inside the controller (ie it may already have a low pass filter), extra gubbins outside the motor possibly achieves nothing. Since the manufacturers data labels it as PWM, that's surely got to be worth a try?

User avatar
clicky
Posts: 501
Joined: Thu Oct 25, 2012 7:34 am

Re: How to drive Brushless DC motor with built in driver and no documentation?

Sat Aug 08, 2020 10:17 am

For instance - single transistor level shifter: https://jeelabs.org/book/1504d/index.html
pidd wrote: Not a good idea putting a capacitor straight on the output pins, it can cause high peak currents.

However with a resistor and a capacitor you can make an rc low pass filter which will convert PWM into a relatively steady DC voltage.
I am sure that's what I meant! :) Thanks.

pidd
Posts: 1269
Joined: Fri May 29, 2020 8:29 pm
Location: Birkenhead, Wirral, UK
Contact: Website

Re: How to drive Brushless DC motor with built in driver and no documentation?

Sat Aug 08, 2020 10:31 am

achrn wrote:
Sat Aug 08, 2020 8:03 am
But before buying extra components, why not just stick a highish frequency PWM on the input and see if it works with no extra circuitry? Depending what's inside the controller (ie it may already have a low pass filter), extra gubbins outside the motor possibly achieves nothing. Since the manufacturers data labels it as PWM, that's surely got to be worth a try?
The "extra gubbins" outside the motor may also help protect the Pi, it might not fail immediately but that doesn't mean it isn't stressing the output circuitry of the Pi, even if it is just one resistor to prevent high currents (spikes or otherwise) it can make a difference in the long term.

kramer65
Posts: 45
Joined: Mon Mar 18, 2013 2:59 pm
Location: Amsterdam

Re: How to drive Brushless DC motor with built in driver and no documentation?

Sat Aug 08, 2020 11:22 am

clicky wrote:
Fri Aug 07, 2020 10:03 pm
  • 12 hours on 100W panel? What does that mean? 100W @ 12V is about 8A which is really good current... But, only with 100% efficiency. So, your project needs really good power management - almost like space age stuff: ability to turn on/off separate components, you excess power to charge batteries and/or use batteries efficiently...
  • you never mentioned batteries. What is the battery capacity you're hoping to run with? What's the best weight/capacity ratio (for given solar panels)
Since it needs to continue by night I obviously need batteries. I'm estimating to have 20W at my disposal day and night for everything (pi/motor/servo/etc). The pi and its periferals (gps/imu/internet connection) cost about 3W, so I have about 17W left for the motor and the servo. I currently have a main loop of 0.5 sec at which it takes the current position from the GPS, the current direction from the imu and then uses a PID-controller to adjust the rudder. I plan on implementing some calculations to decelerate the motor when I'm running low on juice.
I currently have a stock 12V li-ion battert pack, but since I want to put it in the keel I need to adjust it's shape and therefore I need to build it myself. I'm currently waiting for nine 18650 li-ion cells to build a first 3S3P battery pack. With that I'm going to run the Whisky 4. So that's a total of (3.7V x 2800mAh x 9) 93Wh. If that works out for the Whisky 4 I plan on increasing it to a minimum of 30 cells (either 3S10P or 7S5P), which will come to somwhere between 310Wh and 360Wh depending on the configuration. I currently have an el cheapo (Aliexpress) MPPT charge controller between the solar panel and the battery, but since I need to buy a bigger charge controller when the bigger solar panels arrive anyway, I'll probably buy a more advanced/efficient/expensive charge controller by then.
clicky wrote:
Fri Aug 07, 2020 10:03 pm
and then navigation - GPS? Object collision detection? What other sensors you planned for it?
GPS indeed. No collision detection yet, simply because that is out of my league for now. For now I plan to watch boat location info online (AIS) and kind of plan it's way around other ships. I now want to put a water sensor in it so that I know when it's making water. But that's just for testing because if that happens on the North sea I don't have any way of returning it quickly to shore. I currently have a 3G dongle in it for internet, but that obviously won't work on the North Sea. So there I'll probably have an Iridium satellite modem in it from Rock7. That's very expensive though so if you have other suggestions I'm all ears. I'm following things like Hiber and SpaceX's Starlink closely but I don't know whether that's a good fit and whether it will be ready in simmer 2021.
clicky wrote:
Fri Aug 07, 2020 10:03 pm
main system is, I suspect Raspberry Pi. Which? Will you have it on all the time or you'll have power management being smart and boot it up and shut it down when required?
It's a pi zero and it is continuously on because it does everything. If it crashes, the boat stops. In the beginning my code had some crashes and freezes, but for the past half year it hasn't crashed on me anymore. So I feel more or less confident on that one. Many people say an Arduino would be a better fit because it's simpler and more efficient, but Linux is what I know and I wanted to learn Go.
clicky wrote:
Fri Aug 07, 2020 10:03 pm
and then telemetry - what about sending current position/telemetry details back to the 'base'? Black box and recording data?
I've built an interface in the browser using Django and VueJS. It shows some telemetry and its position and course. I can plan waypoints and take over manually with my laptop keyboard. Here's a screenshot of it:

Image
clicky wrote:
Fri Aug 07, 2020 10:03 pm
You definitively need to set up a blog and start recording your journey! [...] In your case - I'm sure many would be interested to see what you've learned while making your Whiskies.
I actually started a blog. It has only two posts in it though from when I started. I'm more of a tech guy than a marketing guy so I enjoy building the boat a lot more than writing about it. You can see how simple it started. I had no idea what I was doing. The things you see there is what I did last year when I started with the idea and building the Whisky 1. Since then it got way out of hand.. :-) Anyway, here's the url: https://medium.com/@project_whisky And yeah, since you're interested I'll publish my next blog post in the coming weeks. It'll probably be about the Whisky 1 again first. I've got a lot of things to catch up.. :-) If you subscribe on Medium I guess you get an update when I post another story (not sure though, I have little experience with Medium).

Btw, cool that you're working with Rust. I did some intro tutorial about it and it seems quite nice. For now I jumped ship ( ;) ) to Golang first, so I'll probably stick with that for now.

Then back to business. You guys are talking about capacitators, resistors etc and although I read about those before, that stuff is still kinda magic to me. I'll probably first try to use a raw PWM signal to influence speed control. And if that doesn't work I'll try one of those DAC's on the Pi. I've gotten the motor to run, so knowing that I can do that is enough for now. I've got a strict priority list in this project; getting it to run is first. Then improve. So I'll first run it only on one speed. In the meantime I've got other stuff to do and learn. I need to learn how to use epoxy, build my first battery pack and build the motor and the battery pack water proof in the keel.

Thanks a million to all you guys!

User avatar
clicky
Posts: 501
Joined: Thu Oct 25, 2012 7:34 am

Re: How to drive Brushless DC motor with built in driver and no documentation?

Sat Aug 08, 2020 1:31 pm

:D It is definitively worth following!

Also, your project has plenty of scope for gentle over-enginnering and generally trying to do thing 'right' way just for the sake of it.
For instance - just imagine you can spend time (money and even more time!) on big power controller (it almost seems like right place to start with) and create to completely independent power systems - each set of batteries and charger away from each other. If anything happens to one you can still run all on the other.

And then little Atmel (or similar) µController(s) to control usage of one and another power system. When one is charging you use other and other way round. But if one is for any reason down (voltage is not acceptable) you just don't use it. If anything happens to one side - you can still continue operating all (half capacity) with another. Months of fun... LOL

Then you go to PiZero. You could add watch dog (again another µContoller - I would go full bang rather than use internal) and maybe even second PiZero that can 'take over' if first is misbehaving...

And then - I'm sure with some effort you can power down many things on Pi in between your loop checks and save on powering it some more.

Then, sensors on motor and servos for overheating, feedback on position of rudder (maybe something like AS5600), tiny weather control, and maybe even something like airbags in case it starts taking in water... :)

I hope you'll forgive me on my daydreaming - your project is such that it deserves some of brain cycles to be dedicated to it for imagining! :)
It is similar to when I was daydreaming on little robot/rover with 4 independently 360º steerable wheels until I made it!

https://piwars.abstracthorizon.org/post ... gcc-rover/

(my apologies for HTTPS certificate - I'll sort it later on this weekend)

lurk101
Posts: 289
Joined: Mon Jan 27, 2020 2:35 pm

Re: How to drive Brushless DC motor with built in driver and no documentation?

Sat Aug 08, 2020 9:17 pm

kramer65 wrote:
Fri Aug 07, 2020 3:41 pm
You seem to be right. I just wired it up with just the plus and minus to my 12V source. I then switched on the 12V. To my surprise that made the motor start turning. I was stunned, because all of a sudden it seemed so simple. I then wired 3.3V from my pi to the yellow/blue wire combination and the motor suddenly slowed down. I then wired 5V to the yellow/blue wire combination and that made it turn faster again. If I either proved 5V or don't connect wires at all to yellow/blue, it seems to go at full speed, and when I wire 3.3V it slows down.
Thinking a little more about this puzzle, the fact that when the yellow control wire is not connected sets full speed indicates there is an internal pull up resistor to 5V on the input. The PWM pin would need to be in active drive or pull down mode.

Supporting both analog and PWM control by including an RC filter on the control input would be ingenious design. I'd go back to your earlier PWM experiment. At the very least you should be able to get the motor to stop by using a 0% PWM duty cycle, and at more than half speed with a 100% PWM duty cycle (3.3V). Then see what happens with a 50% duty cycle. With the PWM clock divider set to 16, and a range of 1024 in mark-space mode will give you about a 1KHz PWM pulse freq.

achrn
Posts: 437
Joined: Wed Feb 13, 2013 1:22 pm

Re: How to drive Brushless DC motor with built in driver and no documentation?

Mon Aug 10, 2020 7:17 am

pidd wrote:
Sat Aug 08, 2020 10:31 am
achrn wrote:
Sat Aug 08, 2020 8:03 am
But before buying extra components, why not just stick a highish frequency PWM on the input and see if it works with no extra circuitry? Depending what's inside the controller (ie it may already have a low pass filter), extra gubbins outside the motor possibly achieves nothing. Since the manufacturers data labels it as PWM, that's surely got to be worth a try?
The "extra gubbins" outside the motor may also help protect the Pi, it might not fail immediately but that doesn't mean it isn't stressing the output circuitry of the Pi, even if it is just one resistor to prevent high currents (spikes or otherwise) it can make a difference in the long term.
The 'extra gubbins' in question was DAC chips and level shifters.

Return to “General discussion”