Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 09, 2016, 06:26:00 18:26


Login with username, password and session length


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

Posts: 81

Thank You
-Given: 30
-Receive: 15


« on: July 15, 2013, 07:42:49 07: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
Active Member
***
 Warned
Offline Offline

Posts: 117

Thank You
-Given: 89
-Receive: 258



WWW
« Reply #1 on: July 15, 2013, 08:32:02 08: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: 81

Thank You
-Given: 30
-Receive: 15


« Reply #2 on: July 15, 2013, 09:05:06 09: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, 12:00:22 12:00 by leaveme » Logged
solutions
Hero Member
*****
Offline Offline

Posts: 1446

Thank You
-Given: 591
-Receive: 851



« Reply #3 on: July 15, 2013, 02:40:18 14: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: 81

Thank You
-Given: 30
-Receive: 15


« Reply #4 on: July 15, 2013, 03:10:41 15: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, 03:34:00 15:34 by leaveme » Logged
Ichan
Hero Member
*****
Offline Offline

Posts: 840

Thank You
-Given: 312
-Receive: 387



WWW
« Reply #5 on: July 15, 2013, 05:40:28 17: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
*
 Muted
Offline Offline

Posts: 7

Thank You
-Given: 2
-Receive: 2


« Reply #6 on: July 17, 2013, 05:07:15 17: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: 81

Thank You
-Given: 30
-Receive: 15


« Reply #7 on: July 17, 2013, 07:45:39 19: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: 840

Thank You
-Given: 312
-Receive: 387



WWW
« Reply #8 on: July 18, 2013, 05:11:06 17: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