+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2013
    Posts
    542

    Default DC Motor constant speed controller, is Picbasic fast enough?

    Hello, I want to build a DC motor controller, which will allow speed adjustment and also support for constant speed under changing load. I want to use HPWM to generate PWM signal, and adjust it's duty cycle based on data which I will read from hall sensor, via PULSIN statement. I plan to use PIC16F886 and motor speeds will vary in 5-15K Rpm range. Will picbasic be fast enough to handle it, or I need to use ASM ?

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,909

    Default Re: DC Motor constant speed controller, is Picbasic fast enough?

    I suppose you will use a PID control, right?

    This has been already implemented thanks to incPID include file by Henrik Olsson:

    http://www.picbasic.co.uk/forum/showthread.php?t=5874

    Ioannis

  3. #3
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,233

    Default Re: DC Motor constant speed controller, is Picbasic fast enough?

    if you use pulsein, it will break your main program while executing.
    But, if you use a hardware counter in the background, you can do other things simultaneously in the foreground (in your main loop).
    Or you can just use an INT pin to read the pulses with DT's interrupt routines. That would also give you simultaneous work.

    A better one would be to combine both timer and counter together.
    You can measure the time it takes from one pulse to other, and this would give you very fast and precise reading of the pulses (frequency reading).
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  4. #4
    Join Date
    Feb 2013
    Posts
    542

    Default Re: DC Motor constant speed controller, is Picbasic fast enough?

    This chip will be dedicated solely to this task, except there will be two buttons, which generate interrupt and used to adjust speed say in 1000rpm increments, so I guess, 12F683 or similar, simpler chip should also work?

  5. #5
    Join Date
    Apr 2014
    Location
    Northeast
    Posts
    306

    Default Re: DC Motor constant speed controller, is Picbasic fast enough?

    The HPWM command occasionally has glitches where it hangs high or low. PBP is certainly fast enough to handle your request, but you can actually work the SFRs manually within the PBP environment. The 12F683 splits the Registers for 10-bit PWM, so using the HPWM command would simplify changing PWM DC%. Have you tried anything yet? Do you have a schematic? Do you have a sketch for your code?
    I don't need the world to know my name, but I want to live a life so all my great-grandchildren proudly remember me.

  6. #6
    Join Date
    Feb 2013
    Posts
    542

    Default Re: DC Motor constant speed controller, is Picbasic fast enough?

    Well I have used HPWM command to PID control heater on 16F886 and it works so far fine. Have not tried it with motor yet. Now assembling motor driver. My motor is fairly large - 18V 30A, so needs good driver.

  7. #7
    Join Date
    Jul 2005
    Location
    The Netherlands
    Posts
    47

    Default Re: DC Motor constant speed controller, is Picbasic fast enough?

    Hi,

    I have make some applications with the VNH5019A Motor Driver, and this works very well with a small PIC.

Similar Threads

  1. Another Stepper motor controller
    By aratti in forum Code Examples
    Replies: 3
    Last Post: - 19th December 2009, 09:52
  2. High current motor speed controller
    By George in forum Off Topic
    Replies: 0
    Last Post: - 2nd February 2007, 03:37
  3. PICBASIC fast and simple
    By naidab in forum Code Examples
    Replies: 1
    Last Post: - 28th January 2007, 22:18
  4. Fast Loop in PICBASIC Pro
    By Bonaparte in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 18th December 2006, 05:13
  5. DC Brushless Motor controller?
    By forgie in forum Off Topic
    Replies: 5
    Last Post: - 4th February 2006, 14:02

Members who have read this thread : 18

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts