| ??? 01/16/04 09:13 Read: times |
#62667 - RE: Differential lock controller Responding to: ???'s previous message |
With no debouncing code the input just has to be valid for say 1microsecond for the cpu to say it's active - this time is in the realm of glitches and spikes so this may cause your motor to stop prematurely on random occasions thus making it hard to debug in the field. I will never do it without debouncing, what happened was I had no data on the differential dc motor and gear part, I had to open it and see how it works. It had a 3 slip rings contacts giving some sort of code when it is completely in the right hand position and a different code in the middle, another code in the full right hand position, done C code with state machines to control the motor taking into account all possibilities even power interruption. I noticed it did work well without debouncing, guess slip rings are good as steve indicated in his post. Also do you have current limiting on the motor drive circuit? Sure thing, I put current sensing resistor and a comparator for sensing the motor current and included software in the microcontroller. What happens when you stall the motor? Does the cpu just keep trying to turn it in the direction waiting for the sensor to activate? Or does it have a timeout so that the cpu doesn't keep trying to power a seized motor and burn it out. To be honest in development phase I tried to stop the motor with no success because it had a gearbox built in and gives huge torque which i couldn't beat. Also the japanese are good, they made the motor move completely in the engage or disengage position with no problem, the diff lock engages only when the gears get alligned, must be spring loaded somehow so there is realy no preassure on the geared DC motor. So I guess I have to implement time out which sounds good idea and it costs nothing on hardware although it is unlikely to happen. When it does detect a timeout you can store an error code and alert the user. I implemented a timeout at first, but removed it after I figured out that there is no pressure on the geared DC motor, what happens is I have another sensor for diff lock, when the differential is locked I get a signal, so what happens is when you engage the diff lock switch, I start blinking dif lock led on the dashboard untill the diff lock sensor indicates diff lock so I make the LED go on perminantly. Maybe I should re implement the time-out thing in case of problems, better to be safe than sorry although I made my controller fused also. Does the unit 'fail safe'? When it does detect an error it should alert the user and do nothing more.
What would happen to the vehicle if the dc motor kept on turning? The DC motor gets stuck if it reaches beyound the RH or LH positions, so it can't keep rotating, what happens if my realys fail and stay on all the time is the motor will heat up causing current sensing circuit to trigger indicating a fault at the diff lock indicator with some blink code. Hopefully the fuse will blow and no further damage will occur, if the fuse refuse to blow I guess the coil of the motor would overheat and blow up eventually. What if the motor seizes? see above. What if the battery voltage is too low? I implemented state machines so as long as the microcontroller is alive most conditions have been taken care of. What if the battery is removed and the alternator gives us 40v momentarily? I'm using 78S05 voltage regulator to power microcontroller board, it should have some sort of overvoltage protection, the car battery is going directly to the DC motor through a fuse and relays, the micro is controlling the relays, Geez Russel it is very good job you are not my boss! What if a sensor fails? As I said above if a sensor fails the dc motor will be pushed to the limit causing an over current condition, the state machines stops the operation giving blink code alarm and keeps in this state till the diff lock switch is toggled again in case it was a glitch fault. What if the ambient temperature rises above 60c? Well I never thought of that, do I need to implement temp sensing you think? Do I sense the temp of dc motor? quite difficult because it has a thick shell around it. Do I need to sense temp of my control circuit? Although i like to make my design solid but remember this is not a life saving equipment, if the worst happened the diff lock gears would break down and the vehicle works with normal differential. It must be fixed at garage by professionals. There are a lot of conditions that can occur that you can't easily design around - in these instances your system must fail gracefully. True i guess all my testing is beeing done in the field using brand new DC motor and diff lock mechanisms, Thats why everything is working perfectly, but this is straight forward and easy stuff, all I have to do is control the motor one way or another till I get sensors readings then I implement dynamic breaking connecting an 18 ohm 30 what power resistor across the dc motor to make it stop fast. Sounds like a lot of work - better done now than when you find a problem in the field with 100's of pissed off customers! Also now would be a good time to review your liability if your design does fail. There is a difference between making a 'one off' for a friend and making a commercially viable product. You are absolutely right, thank you very much for your great comments. Mahmood |



