Page 1 of 1

Strange problem with macro….

Posted: Mon Feb 11, 2013 10:15 am
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

Re: Strange problem with macro….

Posted: Mon Feb 11, 2013 10:48 am
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.

Re: Strange problem with macro….

Posted: Mon Feb 11, 2013 11:05 am
by jjw
I'm using Flowcode v.5.4.0.0 (03.08.2012). C code in appendix.

jjw

Re: Strange problem with macro….

Posted: Mon Feb 11, 2013 11:26 am
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.

Re: Strange problem with macro….

Posted: Mon Feb 11, 2013 11:50 am
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

Re: Strange problem with macro….

Posted: Mon Feb 11, 2013 12:00 pm
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?

Re: Strange problem with macro….

Posted: Mon Feb 11, 2013 12:22 pm
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

Re: Strange problem with macro….

Posted: Mon Feb 11, 2013 12:27 pm
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.

Re: Strange problem with macro….

Posted: Mon Feb 11, 2013 12:41 pm
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

Re: Strange problem with macro….

Posted: Mon Feb 11, 2013 3:27 pm
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

Re: Strange problem with macro….

Posted: Mon Feb 11, 2013 8:48 pm
by medelec35
Hi jjw,
I have spotted whats happening by using Real Pic Simulator.
Will see what I can do for you.

Martin

Re: Strange problem with macro….

Posted: Mon Feb 11, 2013 11:49 pm
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.

Re: Strange problem with macro….

Posted: Tue Feb 12, 2013 12:12 am
by medelec35
Not saying this is it, but can you try this please.

Re: Strange problem with macro….

Posted: Tue Feb 12, 2013 11:13 am
by jjw
Problem solved! Hardware works as designed. Huge thanks again to Martin.

jjw

Re: Strange problem with macro….

Posted: Tue Feb 12, 2013 2:28 pm
by medelec35
Your welcome jjw,
Just glad your up and running :)

Thanks for the update.


Martin