topbanner.gif
Login
Username

Password




Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Shoutbox
You must login to post a message.

allenb
03/27/2023 6:44 AM
ivitamin welcome cup

renatoa
03/23/2023 10:31 AM
Welcome, bob22

allenb
03/22/2023 8:52 AM
Thanks skpacman! all help with our site is much appreciated! ThumbsUp

skpacman
03/20/2023 8:57 PM
Added some code to combat against bots. If anyone has issues with it, let me know. ❤

renatoa
03/19/2023 4:55 AM
frankvanhaarlem, fenix and Andyleighmyers welcome to forum

In Memory Of Ginny
Donations

Latest Donations
dmccallum - 10.00
JackH - 25.00
snwcmpr - 10.00
Anonymous - 2.00
Anonymous - 5.00
Users Online
Guests Online: 8

Members Online: 2
Yasu, ivitamin

Total Members: 7,831
Newest Member: ivitamin

View Thread

Who is here? 1 guest(s)
 Print Thread
Artisan Fan Slider Calibration
sahstim001
I'm trying to calibrate a slider in Artisan to only allow useful fan speeds. My DC fan isn't too happy below 50% PWM. What I'd like to do is have a "deadzone", where 0%=off, 1%=50%, and 100%=100%. Essentially, jump from completely off to 50%.

I can see how using offset=50 and factor=0.5 I can get 0%=50% and 100%=100%, but then it's not possible to turn off the fan.

Is there a way to do what I'm looking for?
 
renatoa
What about adding a button for 0% ?
 
sahstim001

Quote

renatoa wrote:

What about adding a button for 0% ?


That might work as an alternative. I'd prefer if there was a solution on the slider just to keep the controls all in one place, but if not the button would be an acceptable solution.

Is what I'm looking for just not possible?
 
renatoa
How should look a hypothetical user interface element, to suit your needs ?
So you want a slider with the first half hidden/compressed, having active the second half, from 50 to 100, but also the zero choice... how do you want to access the zero value via the slider, if a button is not so ok ? pull the cursor out of slider boundaries ? Tick a checkbox? Or via a keyboard shortcut ?
Asking because I want to figure how you see the modus operandi of such scenario.

As a programmer, in a custom application I know how to design such control as you want, in multiple ways, but Artisan is not a design environment, just an application you use as is.
 
sahstim001
To control it all from the slider, this is how it would function from a programming perspective:

if slider = 0
then fan = 0
else fan = ( slider x 0.5 ) + 50

I understand artisan may not be capable of this, but I'm still learning what it can do so I wasn't sure.
 
renatoa
I didn't meant programming as code, but as user interface.
Not only Artisan but in any other known application, how do you see this interaction done?
 
sahstim001

Quote

renatoa wrote:

I didn't meant programming as code, but as user interface.
Not only Artisan but in any other known application, how do you see this interaction done?


The interface would be just the slider. No buttons. The fan would suddenly drop all the way to zero when the slider is at the bottom.

It would be analogous to a light dimmer where the slider clicks when it reaches the bottom.
Edited by sahstim001 on 03/12/2023 1:30 PM
 
renatoa
Excellent analogy with the dimmer... but... the catch is in the "clicks" part.
In real world a slider is a potentiometer, which usually don't do clicks at one of the ends. As no slider clicks, in any programming environment known by me.
However, in real world there are special pots who do clicks, by adding a switch on top of the pot... the black part in the foreground of the pot, see attached image.
The rotation range of such pot is reduced by some 45 degrees angle, to save that range for switch actuation. Click !
So the switch is an addition... not integral part of the pot/slider.
So should be in Artisan too, a button for fan off.
The hard part is that you want them both handled by same knob, as the real world dimmer Shock
We can't have all... Grin
renatoa attached the following image:
image_2023-03-13_112039774.png
 
randytsuch
You may want to ask on the artisan github discussion page
https://github.co...iscussions
 
sahstim001

Quote

renatoa wrote:

Excellent analogy with the dimmer... but... the catch is in the "clicks" part.
So the switch is an addition... not integral part of the pot/slider.
So should be in Artisan too, a button for fan off.
The hard part is that you want them both handled by same knob, as the real world dimmer Shock
We. can't have all... Grin


Yes, that's why I sent the program logic. The "if" statement would be the "click". But if artisan cannot have a program like this embedded in the slider then it is what it is.
 
sahstim001

Quote

randytsuch wrote:

You may want to ask on the artisan github discussion page
https://github.co...iscussions


I'll have a look over there. Thanks!
 
sahstim001
Here's another idea... Could this be done on the Arduino side? I'm using a TC4+ with aArtisanQ_PID. Could this be coded into the Arduino sketch? I'm sure it could, right?

EDIT:
Is that what this section of code would do? If I edit the MIN to 50? It seems that 0 will still be available, based on the comment text.
sahstim001 attached the following image:
screenshot_2.jpg

Edited by sahstim001 on 03/13/2023 8:30 PM
 
renatoa
Actually this is a brilliant idea, if you perform a small change in the code section handling IO3 command, that will make TC4 behave exactly how you want.
In this moment, if you send to TC4 a IO3 command with any parameter the MIN/MAX limits from user.h are ignored, which actually this IS a bug, I hope @greencardican is reading here Grin
The MIN/MAX limits are used only for IO3;UP and IO3;DOWN commands, should be added also for IO3;xxx.
This is what you can do to make the slider behave as you want.

On TC4 side: change MIN_IO3 to 50, then copy this line: https://github.co...r.cpp#L366
... from IO3;DOWN command, to IO3;ddd command, in this place:
https://github.co...r.cpp#L378
... just above the outIO3(); statement, to add same protection for the IO3;value command, as for IO3;DOWN.
Protection that in actual code is lacking, warning again: someone can send any value as parameter of IO3 command, and will be executed without limits!
Then reload TC4 code with the changes above.

Artisan side: program a slider with the 49-100 limits.
When you hit the slider bottom, i.e. 49 value, the actual command sent to fan will be zero, i.e. cut-off. Job done !
Edited by renatoa on 03/15/2023 3:17 AM
 
sahstim001
Nice! I'll check it out and post the results here.

Secondary question while I'm at it... I see another piece of code a bit further down on user.h to define HTR_CUTOFF_FAN_VAL. It appears this is a safety against having the heater on without the fan running. Is this piece of code working?
 
renatoa
Yes, it's working, and is mandatory for machines of fluid bed type, or any other where leaving the heater without a minimal airflow led to overheating and burning.
 
sahstim001

Quote

renatoa wrote:

This is what you can do to make the slider behave as you want.

On TC4 side: change MIN_IO3 to 50, then copy this line: https://github.co...r.cpp#L366
... from IO3;DOWN command, to IO3;ddd command, in this place:
https://github.co...r.cpp#L378
... just above the outIO3(); statement, to add same protection for the IO3;value command, as for IO3;DOWN.


Hmmm, I must be using a different version of aArtisanQ_PID than you reference... I'm using version 6.3. It looks like that code you reference is 1.10.

I can't find that piece of code on the new version. Any idea where it is? Thanks so much for your help!
 
renatoa
Search cmndreader.cpp, io3Cmnd section, 25 lines from section start is DOWN command statement that performs the MIN_IO3 check.


      if( levelIO3 < MIN_IO3 & levelIO3 != 0 ) levelIO3 = 0; // turn IO3 off if trying to go below minimum.


Copy that line 10 lines below, between these two:

        levelIO3 = atoi( pars->paramStr(1) );
          outIO3();
 
sahstim001
Done! It works exactly as intended. Thank you so much for your patient help!
 
greencardigan

Quote

renatoa wrote:

In this moment, if you send to TC4 a IO3 command with any parameter the MIN/MAX limits from user.h are ignored, which actually this IS a bug, I hope @greencardican is reading here Grin
The MIN/MAX limits are used only for IO3;UP and IO3;DOWN commands, should be added also for IO3;xxx.


greenman

I can't think of any reason why the min max check would have been excluded from the io3;xxx command, so a bug it is.
 
Jump to Forum:

Similar Threads

Thread Forum Replies Last Post
Artisan Buttons Set Sliders and Graph Markers to "0" ROASTING SOFTWARE APPS 7 03/20/2023 8:12 AM
Raspberry+artisan Bread Machine Roasters 8 03/08/2023 1:06 PM
Artisan Arduino PWM 4-20mA for Power Settings ROASTING SOFTWARE APPS 28 02/01/2023 9:21 AM
What has changed in artisan 2.8.2 ROASTING SOFTWARE APPS 13 01/23/2023 8:20 PM
Artisan newbie with SR800 ROASTING SOFTWARE APPS 5 12/20/2022 11:02 PM
Homeroasters Association Logo, and all Content, Images, and Icons © 2005-2016 Homeroasters Association - Logos are the property of their respective owners.
Powered by PHP-Fusion Copyright © 2023 PHP-Fusion Inc
Released as free software without warranties under GNU Affero GPL v3
Designed with by NetriX
Hosted by skpacman