CPU Resets

Discussion about the ZBasic language including the System Library. If you're not sure where to post your message, do it here. However, do not make test posts here; that's the purpose of the Sandbox.
Post Reply
FFMan
Posts: 502
Joined: 09 January 2010, 12:52 PM

CPU Resets

Post by FFMan »

I have a small problem related to my cruise control project. The pedal actuator has a solenoid for engage/disengage, which is nice as you can disengage the motor from the pedal in an instant.

On my test bench the actuator motor and solenoid are powered from a sealed lead acid battery operated by zx controlled opto isolated relays, and the zx is powered from a bench psu. I see the issue with or without the grounds joined, though of course once in the vehicle the grounds will be joined.

The problem I see is that 1 in 5 times, when I disengage the solenoid the ZX resets. I have put a 2200mfd electrolytic from solenoid +ve feed to ground and a large 1n4001 type clamp diode inverse parallel across the solenoid connections, and this reduced the occurrence but has not eliminated it.

Given I see the issue with or without a common ground is it possible air borne inductance is playing a part. I do see an led on an unrelated PSU occasionally flash at the same time the field drops.

Should I tie up/down the reset pin with a resistor. its currently connected to a USB/ftdi interface, I have not tried to see if I get the reset without the usb interface connected but I can later.

I will try physically separating the components y a few feet, as at the moment on the bench the pedal is close to the zx but when installed it won't be.

Suggestions welcome
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: CPU Resets

Post by dkinzer »

FFMan wrote:[...] when I disengage the solenoid the ZX resets.
It may provide some insight to know why the ZX resets. Very early in Main() you can display Register.ResetFlags, then you'll know the cause(s) of the reset.

Are you driving the solenoid directly from a ZX pin or using a transistor/driver?
- Don Kinzer
FFMan
Posts: 502
Joined: 09 January 2010, 12:52 PM

Post by FFMan »

thanks don - flags report brown out reset. what is the brown-out on a zx40n

interestingly when cold, the problem does not appear until after a few minutes. is it likely or possible that the regulator is getting warm and its capacity is dropping off ? it would explain why I can influence (but not resolve) the issue by inserting a sleep between relay switching. what it does not explain is the fact the zx circuit and relays work without fault if I disconnect the motor, which is powered by a sealed lead acid battery.

there is an interaction here I do not understand.

Anyhow I have decided to change the relays for PWM with mosfets to give me greater control over the pedal movement.
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

FFMan wrote:what is the brown-out on a zx40n
It is set to 2.7V.
- Don Kinzer
kurakaira
Posts: 77
Joined: 21 March 2007, 1:21 AM
Location: Finland

Post by kurakaira »

Did You also have a parallel diode on the relay ?
But i would think the reset line acts as an aerial when connected to the usb cable .
When i mount the programming port away ( meters ) from the ZX i use a null D9 with reset and gnd connected when not programming .
sturgessb
Posts: 287
Joined: 25 April 2008, 6:34 AM
Location: Norwich, UK

Post by sturgessb »

have you thought about using something like this instead of the solenoid?

http://www.servocity.com/html/12v_linear_actuators.html

Will give you greater control, and should be easier to drive without these issues.
FFMan
Posts: 502
Joined: 09 January 2010, 12:52 PM

Post by FFMan »

those are nice and pretty good value but being a safety related project, I rated the ability to disconnect in a hurry pretty high.

so I am using a cruise actuator from a bmw which I hope has some sort of safety approval or testing, and I trust the cable won't snag etc. the solenoid disengages with a reassuring clonk and the pedal springs back. I intend to wire a separate switch into the feed so regardless of what the zx is doing, I can disengage it.
sturgessb
Posts: 287
Joined: 25 April 2008, 6:34 AM
Location: Norwich, UK

Post by sturgessb »

True.

is it an auto or manual (Stick i think you call them)

B
FFMan
Posts: 502
Joined: 09 January 2010, 12:52 PM

Post by FFMan »

i'm in the uk, so its manual to me too ;-)

diesel transit camper-van.. Cruising was never a problem with the old van as I always had my foot on the floor. however the new van will top 100mph and given that when towing the limit is 60 it gets tiring to hold a pedal halfway.

found a nice article on PID control which I shall implement, but fine tuning will be required on the road to ensure it doesn't oscillate or fail to get back to the set speed.
Post Reply