Check if a motor is running  - Page 1
Forum section: electronics / general

author: backd00r
author_rank: Contributor
timestamp: April 01, 2015, 04:19:50 pm
content: I am building a BLDC motor controller and I need an easy way to check with a pic if a the motor is running or not. I was thinking about measuring the frequency of the hall sensors but I am not sure how to program that. Please advise

author: Wilksey
author_rank: Super Contributor
timestamp: April 01, 2015, 05:06:33 pm
content: It may or may not be of any use but I did a demo board once where I measured the current to determine if a motor was running.

author: Ian.M
author_rank: Super Contributor
timestamp: April 01, 2015, 05:30:07 pm
content: You don't need to measure the speed to make an Is it running? (yes/no) decision. You just need a missing pulse detector. Whether that's done in external hardware or inside the PIC in a peripheral module or pure software is highly dependent on what resources your PIC has available. If you want the PIC to handle it for you, you would do better to post your question in one of Microchip's own forums if you want specific solutions.

author: nuno
author_rank: Frequent Contributor
timestamp: April 01, 2015, 09:37:45 pm
content: To be sure the rotor is spinning, and since it's a BLDC, you should check the Hall's sequence, not only if they are "toggling".

author: max_torque
author_rank: Super Contributor
timestamp: April 01, 2015, 10:06:35 pm
content: Quote from: backd00r on April 01, 2015, 04:19:50 pmSo you are planning to build your own BLDC motor controller. Cool.But you're not sure how to program a very basic bit of code to see if the motor is spinning, even though knowing the motors rotor position at all times (and hence it's velocity) is the absolute backbone of any BLDC motor control code.Hmm, i don't see this ending well...................

author: Ian.M
author_rank: Super Contributor
timestamp: April 01, 2015, 10:14:10 pm
content: It might be an open-hardware design for which prebuilt 'canned' firmware is available, and the PIC may be a separate MCU that is not directly in control of the motor. If so, he's in with a chance, otherwise I agree that the most likely outcome is that it repeatedly elects a pope till he runs out of replacement silicon/motors/cash/unburnt fingertips.

author: backd00r
author_rank: Contributor
timestamp: April 03, 2015, 04:28:14 am
content: Quote from: max_torque on April 01, 2015, 10:06:35 pmDude I have a brushless Dc motor controller MC33035 my motor actually runs pretty smoothly, the PIC is programmed to interface between both motors(electronic differential) and also to do Cruse control, and ebrake, economy mode, read throttle values... I know what I am doing !! my question was more like if there is a better idea out there of how to detect if the motor is running with a pic . I can always measure the period with CCP port and thats is it. I was just wondering you went way too far...

author: backd00r
author_rank: Contributor
timestamp: April 03, 2015, 04:31:04 am
content: Quote from: Ian.M on April 01, 2015, 10:14:10 pmLOL you guys are very helpful none of you actually answered my question .... I have separate hardware driving the motor...

author: backd00r
author_rank: Contributor
timestamp: April 03, 2015, 04:33:16 am
content: I will post the schematics and the code once I am done with the project if anybody is interested. I should be done by the end of this month. Thank you anyways

author: Ian.M
author_rank: Super Contributor
timestamp: April 03, 2015, 05:26:17 am
content: There are a fair number of PICs with QEI modules. If your PIC has one it could be connected to two of the sensors (which will produce a somewhat skewed signal but near enough to quadrature to work), and that would not only tell you if it is running with minimal software intervention, but how far it has turned since you last polled it, eliminating the possibility of a motor with a jammed drivetrain or controller fault that is vibrating through a small angle being misdirected as running.However as I said earlier, the real expertise for solutions that are internal to the PIC is over at Microchip's forums, and to give you better advice, we need to know which PIC and any peripherals you've already tied up for other purposes.