Announcement

REXYGEN forum has been moved. This one is closed.
Head over to the new REXYGEN Community Forum at https://forum.rexygen.com.

Looking forward to meeting you there!
 

#1 2018-09-25 07:28:01

mikeyh
Member
From: New Zealand
Registered: 2016-04-28
Posts: 44

PWM Controller

Hi All,

I looking at controlling a TEC (peltier) with a H-Bridge, not ideal I know but it's quick and dirty! It will also change the polarity easily.

I was wondering if using the SMHCC and PWM blocks would work well as I require both cooling and heating, controlled to within a couple of °C of set point. The set point however could range from -10 to 10°C.

A standard PID using PWM would work, just wondering what other people think? The nice thing would be to have it auto change from cooling to heating. Which is why I was considering the SMHCC.

Regards

Mike

Offline

#2 2018-09-25 11:01:55

mikeyh
Member
From: New Zealand
Registered: 2016-04-28
Posts: 44

Re: PWM Controller

PS - I will also be using the Monarco HAT as the hardware platform.

Offline

#3 2018-09-25 17:12:31

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: PWM Controller

Hi Mike,
is the dynamics of heating significantly different from the cooling? Do you have data to compare the response to step change in cooling vs. response to step change in heating?

Based on this you'll choose SMHCC or PIDU to control the temperature.

Let me know.

Kind regards,
Jaroslav

Offline

#4 2018-09-27 10:54:31

mikeyh
Member
From: New Zealand
Registered: 2016-04-28
Posts: 44

Re: PWM Controller

No data yet, I’m still modeling the system. Is using the “de” out put from the PID controller an efficient way of changing the polarity of the TEC to transition from cooling to heating and back again?

Cheers

Mike

Offline

#5 2018-09-29 17:43:14

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: PWM Controller

Hi Mike,
not exactly. You should use the sign of the mv output to distinguish between heating and cooling. The "de" output is deviation error "sp-pv". The signs of "de" and "mv" are not necessarily the same. See the PIDU block description for details.

Use e.g. "mv in range -1..0" for cooling and "mv in range 0..1" for heating. ABS, CMP and REL function blocks will help here.

Kind regards,
Jaroslav

Offline

#6 2018-10-02 20:04:08

mikeyh
Member
From: New Zealand
Registered: 2016-04-28
Posts: 44

Re: PWM Controller

Thanks Jaroslav,

That's makes more sense now. I will let you know how it goes!

I'm just getting a bit confused on how to handle the PWM to the H-Bridge for set point control, and also the signal to the H-bridge to change polarity of the TEC from heating to cooling and so on.

Cheers

Mike

Last edited by mikeyh (2018-10-02 20:05:08)

Offline

#7 2018-10-03 08:52:01

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: PWM Controller

Hi Mike,
do you have a schematics of your H-bridge and TEC? Are you just using 4 switches or is there some breakout board with H-bridge in an integrated circuit? Without knowing this it's impossible to give any advice...

Kind regards,
Jaroslav

Offline

#8 2018-10-03 09:31:35

mikeyh
Member
From: New Zealand
Registered: 2016-04-28
Posts: 44

Re: PWM Controller

Hi Jaroslav,

See diagram below, long term the motor controller will not be sultable but for quick testing  it will work fine.

B9464C67-1C45-4C40-B371-4DC267463107.jpeg

Offline

#9 2018-10-03 12:01:40

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: PWM Controller

Hi Mike,
connect directly DOUT1 to In3, DOUT2 to In4 and DOUT3 in PWM mode to EnB (remove the jumper). Keep in mind that the DOUTs of the Monarco HAT have inverted logic in 5V logic.

Hope this helps, let me know.

Kind regards,
Jaroslav

Offline

#10 2018-10-08 07:52:36

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: PWM Controller

Hi Mike,
after a bit more thinking, I'd probably go this way:
heating_cooling_control.png

Here is the source file: heating_cooling_control.mdl

Kind regards,
Jaroslav

Offline

#11 2018-10-08 08:26:14

mikeyh
Member
From: New Zealand
Registered: 2016-04-28
Posts: 44

Re: PWM Controller

Hi Jaroslav,

That’s a huge help, I can see how that works.

Thanks as always

Regards

Mike

Offline

Board footer

Powered by FluxBB