Strange problem with macro….

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

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

Strange problem with macro….

Post by jjw »

Since so far I’ve already done 101 cross tests with different combination with different stepper motors and different drive boards in order to exclude the hardware problem. Also I've tested the Second damp macro alone but always with the same result the Second damp loose its holding power when the program has finished. I’m assuming that it’s a code problem....
Primary damp which works well I’ve measured from stepper motor pins 0=0V, 1=5V, 2=0V, 3=5V (this is a holding situation). Second damp’s all pins are 0 Volt. My basic question is how to make and leave the second damp’s pins high.

Hopefully there is somebody in a forum who can solve this problem.
Thanks in advanced for your help,

jjw
Attachments
Lambda_Cont_pic16f877.fcf
(46.96 KiB) Downloaded 305 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Strange problem with macro….

Post by Benj »

Hello,

Can you tell me what version of v5 you are using and could you also post up your C code generated by the Flowcode project so we can see what's going on behind the scenes.

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

Re: Strange problem with macro….

Post by jjw »

I'm using Flowcode v.5.4.0.0 (03.08.2012). C code in appendix.

jjw
Attachments
Lambda_Cont_pic16f877.c
(48.89 KiB) Downloaded 288 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Strange problem with macro….

Post by Benj »

Hello,

Is the chip continuing to run correctly or does it go dead when it tries to move motor 2?

Might be worth switching off the brown out configuration setting and seeing if this makes any difference.

Other then that the program seems to be ok. Might be worth updating to v5.5 and seeing if that makes and difference.

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

Re: Strange problem with macro….

Post by jjw »

The chip is running correctly for hours no prob. I've already tried out brown out configuration nothing new...
The strange thing is that the Primary damp is working nicely and having strong holding power but the Second damp is not.....
I will update my Flowcode v.5.5.

jjw

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Strange problem with macro….

Post by Benj »

Hello,

Could it be an issue with PortD on the device your using? Have you tried more then one microcontroller just to see if it a hardware issue?

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

Re: Strange problem with macro….

Post by jjw »

I’ve been running the Second damp alone with three different chips in PortA nothing change. I’ve a brand new main board where I been running the program with pic16876 and pic18f252 with the same result. I think I’ve have excluded the hardware problem.

Just even updated to Flowcode v5.5 the question is how to proceed with it. The first tried out where I made I new hex file didn’t help…….

jjw

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Strange problem with macro….

Post by Benj »

Hello,

As a simple test what about swapping component connections for motor 0 and motor 1. Des the problem still occur with the motor connected to the second damp macro.

If the problem is still the same then the problem is probably not hardware related.

However the two motor components should be using identical code unless either motor's code has been customized (which I have checked and they are not) so the problem must be lurking somewhere in the flowchart code.

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

Re: Strange problem with macro….

Post by jjw »

I’ve also cross tested component connections for motor 0 and motor 1 with the same result.
I was asking help for customizing flowchart code I’m totally confused how to do it.

jjw

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

Re: Strange problem with macro….

Post by jjw »

I just made a brand new code with Flowcode 5.5 and tested how only the Second damp will conserve its holding force. Same result so I presume still that there is something wrong in Second damp’s macro.

jjw

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

Re: Strange problem with macro….

Post by medelec35 »

Hi jjw,
I have spotted whats happening by using Real Pic Simulator.
Will see what I can do for you.

Martin
Martin

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

Re: Strange problem with macro….

Post by medelec35 »

This odd, as the secondary damper's drive waveform is not correct.
Also port D that's connected to stepper finish low which is also not correct.
That is the reason for the lack of holding power.
All the electromagnets are off.
Martin

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

Re: Strange problem with macro….

Post by medelec35 »

Not saying this is it, but can you try this please.
Attachments
Lambda_Cont_pic16f877 test.fcf
(46.97 KiB) Downloaded 322 times
Martin

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

Re: Strange problem with macro….

Post by jjw »

Problem solved! Hardware works as designed. Huge thanks again to Martin.

jjw

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

Re: Strange problem with macro….

Post by medelec35 »

Your welcome jjw,
Just glad your up and running :)

Thanks for the update.


Martin
Martin

Post Reply