Strange program behavior with programming cable plugged in and when out

Andrei IRL

Senior Member
I have completed putting together a program for my strain gauge and all looks to be working perfect.

However, as soon as i unplug the programming cable the "FIRE" routine is behaving differently.

So when ADC reading is above or below preset value the program goes to FIRE routine.

In the fire routine, two relays are triggered and one LED is turned off.

There is a waitqs routinize within fire routine that loops on itself unless strain gauge reading is back to resting position.

I have a little calculation going before and after waitqs which makes sure there is no double triggering is happening unless the adc gets closer to strain gauge resting value.

I have the whole thing built on PICAXE08 Proto board with programming 3.5mm headphone socket and resistors for programming circuit.

So if i leave the USB programing cable pluged into the board then the program runs perfectly asexpected.

However, if i run the program with the programing cable disconnected then my relays flicker on and off as the ADC reading gets near the pre-set values.
 
Last edited:

techElder

Well-known member
The problem that you are experiencing is not necessarily in your program. The ground connection through your computer is the reason it goes away while connected.

You need to be able to look at the analog input and grounding issues on your prototyping board.

I have had similar issues in the analog part with florescent overhead lamps. All would go away when the lights were off or by going outside.
 

Andrei IRL

Senior Member
Thanks for the advice.
I Have checked the wiring and everything looks good.
At a loss here. Completely stumped.
 

Circuit

Senior Member
Thanks for the advice.
I Have checked the wiring and everything looks good.
At a loss here. Completely stumped.
Step back, take a breath and have another look at your circuit...
Tex is right on the mark with his analysis; if you think about it, the serial send and receive lines are unlikely to contribute to the change in behaviour; the only thing you are changing is the earthing connection. The computer link will provide proper grounding through the programming lead; you need to provide the same grounding to your board via another route and see if you get the same result.

Edit:

I have now downloaded and looked at your video; you have some very fine aerials sticking up there. Electromagnetic interference, ground loops and so forth may be affecting your circuit and it is the solid ground connection through the programming lead that is supressing these when connected. Make sure that your ground connection is solid and star-wired across your various boards. You may also need to shorten some of the interconnecting leads and look towards a metal enclosure depending upon the environment you are working in.
 
Last edited:

Andrei IRL

Senior Member
Circuit:313616 said:
Thanks for the advice.
I Have checked the wiring and everything looks good.
At a loss here. Completely stumped.
Step back, take a breath and have another look at your circuit...
Tex is right on the mark with his analysis; if you think about it, the serial send and receive lines are unlikely to contribute to the change in behaviour; the only thing you are changing is the earthing connection. The computer link will provide proper grounding through the programming lead; you need to provide the same grounding to your board via another route and see if you get the same result.

Edit:

I have now downloaded and looked at your video; you have some very fine aerials sticking up there. Electromagnetic interference, ground loops and so forth may be affecting your circuit and it is the solid ground connection through the programming lead that is supressing these when connected. Make sure that your ground connection is solid and star-wired across your various boards. You may also need to shorten some of the interconnecting leads and look towards a metal enclosure depending upon the environment you are working in.

Thanks very much for taking the time to give me the advice.
I will modify my proto board going by your recommendations
 

Andrei IRL

Senior Member
Just an update.

As soon as i changed the power supply to a proper desktop regulated the issue has gone away.

Thank you very very very much for all the help.
 
Last edited:

Circuit

Senior Member
Very pleased to hear that your problem is sorted...for now. I recall that this circuit is for a gear shift control on a racing bike; when you come to transplant your circuit into such an electrically noisy environment you may well have problems like these again. Not insurmountable, but possibly frustrating. I would consider replacing your relay with a Smart Low-side Power Switch such as the HITFET BTS3134 by Infineon - this is a 42 volt device with a nominal current rating of 3.5 Amps - I don't know your actual requirements. These devices have logic level input and loads of overvoltage/short circuit/thermal protection built-in. More importantly, they are electrically quieter than relays. You may find this Infineon guide to automotive components to be of help:
https://www.infineon.com/dgdl/Infineon-Automotive_Power_SelectionGuide_2016-SG-v01_03-EN.pdf?fileId=5546d4625d5945ed015dc81ede42316b
 

Andrei IRL

Senior Member
Circuit:313623 said:
Very pleased to hear that your problem is sorted...for now. I recall that this circuit is for a gear shift control on a racing bike; when you come to transplant your circuit into such an electrically noisy environment you may well have problems like these again. Not insurmountable, but possibly frustrating. I would consider replacing your relay with a Smart Low-side Power Switch such as the HITFET BTS3134 by Infineon - this is a 42 volt device with a nominal current rating of 3.5 Amps - I don't know your actual requirements. These devices have logic level input and loads of overvoltage/short circuit/thermal protection built-in. More importantly, they are electrically quieter than relays. You may find this Infineon guide to automotive components to be of help:
https://www.infineon.com/dgdl/Infineon-Automotive_Power_SelectionGuide_2016-SG-v01_03-EN.pdf?fileId=5546d4625d5945ed015dc81ede42316b
That's great.
I know that the challenge is not yet over so thanks very much for the advice.
 
Top