Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
March 28, 2024, 07:41:25 19:41


Login with username, password and session length


Pages: [1]
Print
Author Topic: How does this controller work?  (Read 3255 times)
0 Members and 1 Guest are viewing this topic.
leaveme
Junior Member
**
Offline Offline

Posts: 93

Thank You
-Given: 38
-Receive: 15


« on: July 15, 2013, 06:42:49 06:42 »

I'm doing some study on PID AC motor controller.
I have a commercial PID motor controller (AC/single phase/220V/50Hz) in hand. It is based on PIC18F2420. I just traced it and drawn the schematic. I noticed an interesting thing that the RPM sensor is not connected to an INT/CCP port. It is just connected to a standard IO/AN0 port. Seems RPM signal is converted to analog signal. My question is, how it is then counting RPM?

I attached the sensor part here. Anybody can explain?

Logged
Catcatcat
Senior Member
****
Offline Offline

Posts: 416

Thank You
-Given: 275
-Receive: 1524



WWW
« Reply #1 on: July 15, 2013, 07:32:02 07:32 »

Here we use the integrating circuit R14, R12, C9, control the voltage on the capacitor C9. The faster the rotation, the lower the voltage.
Logged
leaveme
Junior Member
**
Offline Offline

Posts: 93

Thank You
-Given: 38
-Receive: 15


« Reply #2 on: July 15, 2013, 08:05:06 08:05 »

Thanks Catcatcat.
Seems the analog signal then feeding into the Comparator-1 since pin 4 (Vref-/CVref) & pin 5 (Vref+) is reference voltage input. Is my understanding right?

Pin 6 is comparator 1 out. It looks like tacho signal is reproduced here. I'm asking it because pin 6 is (optional) tacho output and feed into pin 12 which is CCP2.

« Last Edit: July 15, 2013, 11:00:22 11:00 by leaveme » Logged
solutions
Hero Member
*****
Offline Offline

Posts: 1823

Thank You
-Given: 655
-Receive: 900



« Reply #3 on: July 15, 2013, 01:40:18 13:40 »

No. I'd say they are using the A/D to discern RPM by the voltage on the cap. Tacho out usually goes to a meter movement in older stuff
Logged
leaveme
Junior Member
**
Offline Offline

Posts: 93

Thank You
-Given: 38
-Receive: 15


« Reply #4 on: July 15, 2013, 02:10:41 14:10 »

No. I'd say they are using the A/D to discern RPM by the voltage on the cap. Tacho out usually goes to a meter movement in older stuff

Actually Pin-4 makes me interested. Datasheet says it is comparator reference voltage output. Do they use it to calculate the error for PID math -
Error = SetPoint (RPM) - Current (RPM)
« Last Edit: July 15, 2013, 02:34:00 14:34 by leaveme » Logged
Ichan
Hero Member
*****
Offline Offline

Posts: 833

Thank You
-Given: 312
-Receive: 392



WWW
« Reply #5 on: July 15, 2013, 04:40:28 16:40 »

I'd say YES. The comparator used as schmitt trigger with programmable threshold level, an output of programmable reference voltage is feed to the vref input of the comparator (at pin 4 & 5, not sure which one which). The tacho out is the output of the comparator, giving a clean output of the rpm which is also feed to timer1 to count it.

I may be wrong, did not read the datasheet.

-ichan
Logged

There is Gray, not only Black or White.
card_claud
Newbie
*
Offline Offline

Posts: 7

Thank You
-Given: 2
-Receive: 2


« Reply #6 on: July 17, 2013, 04:07:15 16:07 »

How was told, I believe R14, R12, C9 is a integrating circuit, since the function is to control by PID and not know what is the  rotation value.
Logged
leaveme
Junior Member
**
Offline Offline

Posts: 93

Thank You
-Given: 38
-Receive: 15


« Reply #7 on: July 17, 2013, 06:45:39 18:45 »

How was told, I believe R14, R12, C9 is a integrating circuit, since the function is to control by PID and not know what is the  rotation value.
RPM range is 3k - 30k (PID controlled).
My thinking is R14, R12, C9 is converting the tach signal to analog, which is then provided to comparator. A0 is comparator input.

Code:
// Constants used in setup_comparator() are:
#define A0_A3_A1_A3  0xfff04
#define A0_A3_A1_A2_OUT_ON_A4_A5  0xfcf03
#define A0_A3_A1_A3_OUT_ON_A4_A5  0xbcf05
#define NC_NC_NC_NC  0x0ff07
#define A0_A3_A1_A2  0xfff02
#define A0_A3_NC_NC_OUT_ON_A4  0x9ef01
#define A0_VR_A1_VR 0x3ff06
#define A3_VR_A2_VR 0xcff0e

As Ichan said, I think RPM pulse again reproduced at comparator out (A4). At the same time CVref(A3) used (as feedback) to calculate the error for PID. I see that A3 and A2 connected together. Why it is that?
Seems A2 is an ADC input and taking reference voltage from A3 (CVref). If it is right then I'll try it in the same way. Just don't get about how to configure the comparator in this way.
Logged
Ichan
Hero Member
*****
Offline Offline

Posts: 833

Thank You
-Given: 312
-Receive: 392



WWW
« Reply #8 on: July 18, 2013, 04:11:06 16:11 »

I think PID is not yet related to the topic. For that, get the rpm (measured) subtract it from the rpm (target) to get the error for PID calculation.

The role of comparator with programmable vref is to have a software adjustable sensitivity of the photo sensor... no need to adjust a trimpot.

-ichan
Logged

There is Gray, not only Black or White.
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC