Help needed!

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

jjw
Posts: 78
Joined: Sat Aug 25, 2012 5:35 am
Has thanked: 71 times
Been thanked: 9 times
Contact:

Re: Help needed!

Post by jjw »

Hi Martin,

I did this and did desk test maybe a bit better field tests will show more.

Code: Select all

Timeout = 0
Speed = 0
It maybe a good idea to add a time out LED or display indication so you know when triggering was an issue.
Can you give that a go as it should be straight forward.
Can you help me with this addition.

jjw

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Help needed!

Post by medelec35 »

You need to decide what time-out indication is required e.g LED or LCD.
Then use a decision branch with the

Code: Select all

Timeout
variable.
If Yes branch then indicate time-out LED

Code: Select all

Port D1 = 1
(pin which you have LED conneted to): Delay 2 secs (so you can see LED lit):

Code: Select all

Timeout = 0
if No branch then

Code: Select all

Port D1 = 0
Or
If yes branch:

Code: Select all

LCDDisplay Cursor 
(suitable x y parameters)

Code: Select all

LCDDisplay PrintString "TOut!"
Give that a try and send updated Flowchart.

Martin
Martin

jjw
Posts: 78
Joined: Sat Aug 25, 2012 5:35 am
Has thanked: 71 times
Been thanked: 9 times
Contact:

Re: Help needed!

Post by jjw »

Hi Martin,
Did yesterday 10 tests in the field with flowchart version 4 and with new MCU (Pic 18F4550) and with this addition into a flowchart:

Code: Select all

Speed = 0
Hard to say if better laps were recognized well and average speed was calculated right. The only problem was that you never know whether the program goes into a measuring mode or not. Sometimes it takes couple of pushes until it goes into the measuring mode. Any ideas what to do next?

Have you checked my flowchart version yet?

jjw

jjw
Posts: 78
Joined: Sat Aug 25, 2012 5:35 am
Has thanked: 71 times
Been thanked: 9 times
Contact:

Re: Help needed!

Post by jjw »

Hi Martin,
Have been done lot of field tests during last 10 days. I’ve noticed one strange thing when powering on the user interface just before when starting the time taking process everything works just fine. After time taking powering off is necessary. I wonder why the program acts like this not a big deal I can live with it but anyway strange….

In my original scheme had in MCLR pin1 10k resistor then I added parallel resistor 1N4148 and 10uF capacitor from pin 1 into minus in order to get total reset when powering off. Hard to say if better not worse anyway. So the program works just fine maybe a little complicated to use.
Any idea why it acts like this?

Wbr,
Jukka

jjw
Posts: 78
Joined: Sat Aug 25, 2012 5:35 am
Has thanked: 71 times
Been thanked: 9 times
Contact:

Re: Help needed!

Post by jjw »

Hi Martin,
Great thanks to you who patiently helped me so much with my long lasting project. Everything is working now properly.

Wbr,
jjw

jjw
Posts: 78
Joined: Sat Aug 25, 2012 5:35 am
Has thanked: 71 times
Been thanked: 9 times
Contact:

Re: Help needed!

Post by jjw »

Hi Martin,
I automatized my time taking system it works mainly good but sometimes not….
I’ve been testing it for a while (manual part works fine) but have some problems with the automatic mode. I indicated problems when limit switch’s contacts opens and closes (same effect when pushing start button during the measuring). It can be seen also in a flowchart simulation when pushing the button during the test.

I have partly solved the problem with hardware by adding a this Arduino Nano Board in user interface but want to do it also in Flowchart.

I would like the flowchart work so that when pushing the start button (or in serial connected limit switch) it will count independently even more contacts will come during the measuring session.
Hopefully you could help me with the flowchart .....

Wbr,
jjw

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Help needed!

Post by medelec35 »

Hi Jukka,
I will require more detailed information.
The switch does have contact debounce so after detection if switch is detected within 1.5 seconds again it's just ignored.
Are you wanting a small delay between laps so if pot is above the trigger value, the laps won't be counted too fast?

Martin
Martin

jjw
Posts: 78
Joined: Sat Aug 25, 2012 5:35 am
Has thanked: 71 times
Been thanked: 9 times
Contact:

Re: Help needed!

Post by jjw »

Hi Martin,
You wrote:
The switch does have contact debounce so after detection if switch is detected within 1.5 seconds again it's just ignored.
We have found that during the time taking process round 16 seconds when contacts opens and closing several times it causes problems. As far as I understand there are at least two ways to prevent this problem. One is to force to keep the state during time taking process at least 20 seconds constant. The other way is to keep situation constant during 11 laps this might be better.
Are you wanting a small delay between laps so if pot is above the trigger value, the laps won't be counted too fast?
No I don’t want any delays between the laps.

Wbr,
jjw

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Help needed!

Post by medelec35 »

Oh I believe I understand the problem.
Since changing to auto the switch will constantly be triggered by the plane so you don't want the lap number to be affected.
Try this simple solution:
In the port macro
Change

Code: Select all

allow_tmr && ((SwitchInhibit < 1500)
to

Code: Select all

(allow_tmr )&& (Temp < 10)
Also change:

Code: Select all

allow_tmr = !allow_tmr
to

Code: Select all

allow_tmr = 1
Do you also want a long press of the switch to restart?
Of course you will need switch connected in parallel with the relay.
Martin
Martin

jjw
Posts: 78
Joined: Sat Aug 25, 2012 5:35 am
Has thanked: 71 times
Been thanked: 9 times
Contact:

Re: Help needed!

Post by jjw »

Hi,
Great thanks to you Martin again. Anyway those changes works well in a simulation mode. Will test more in a field next week I let you know.

Wbr,
jjw

jjw
Posts: 78
Joined: Sat Aug 25, 2012 5:35 am
Has thanked: 71 times
Been thanked: 9 times
Contact:

Re: Help needed!

Post by jjw »

Hi Martin,
The field tests went very well the software changes solved the problem. Thanks again for helping me :D .

Wbr,
jjw

Post Reply