Running Dc Motor with Advanced PWM Module

A forum where Flowcode v6 user created components can be shared, discussed and reviewed.

Moderator: Benj

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1068
Joined: Sun Oct 05, 2014 3:20 pm
Has thanked: 330 times
Been thanked: 537 times
Contact:

Running Dc Motor with Advanced PWM Module

Postby QMESAR » Sun Jan 04, 2015 1:07 pm

Hi All
Attached an simple code that runs a DC motor with the Power Control PWM module on a PIC Micro Controller speed control mode with Forward and reverse direction (2 quadrant mode).

Note this code is not production ready code it is a simple code that demonstrate how to us the Power control module in FC with a few lines of C code.
The code check two buttons for selecting Forward or reverse Drive this button routine is also not optimized for 100% stable operation. AN4 is used to control the speed of the motor.

The attached schematic shows only the pin connections ,circuit component values does not represent the real live values see the Matrix EB022 datasheet for circuit values

The hardware used are a PIC18F4431 and the EB022 Motor Driver board from Matrix ,The Power Control module can generate complex PWM signals to drive various motors DC Brushed/DC Brush less(PMSM Motors)/Ac induction motors and Universal power supplies .
:D
Attachments
6.jpg
6.jpg (101.65 KiB) Viewed 2459 times
DCMotor_P184431.zip
(246.61 KiB) Downloaded 158 times
2.jpg
(186.48 KiB) Downloaded 1178 times
These users thanked the author QMESAR for the post (total 2):
medelec35 (Sun Jan 04, 2015 2:33 pm) • Benj (Mon Jan 05, 2015 1:18 pm)
Rating: 11.76%
 

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1068
Joined: Sun Oct 05, 2014 3:20 pm
Has thanked: 330 times
Been thanked: 537 times
Contact:

Re: Running Dc Motor with Advanced PWM Module

Postby QMESAR » Sun Jan 04, 2015 5:54 pm

If there is some one like me which love SPICE and Mixed Mode simulation you can PM me and I will supply you the model
The model runs the FC code and the L298 hardware as you will see in the below pictures the DC motor running positive and Negative speeds
Attachments
5.jpg
(184.99 KiB) Downloaded 1168 times
4.jpg
4.jpg (108.16 KiB) Viewed 2459 times
These users thanked the author QMESAR for the post (total 2):
medelec35 (Sun Jan 04, 2015 6:00 pm) • Benj (Mon Jan 05, 2015 1:17 pm)
Rating: 11.76%