element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Embedded and Microcontrollers
  • Technologies
  • More
Embedded and Microcontrollers
Embedded Forum How can I make an embedded system robust?
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Embedded and Microcontrollers to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 11 replies
  • Subscribers 475 subscribers
  • Views 1449 views
  • Users 0 members are here
Related

How can I make an embedded system robust?

neuromodulator
neuromodulator over 7 years ago

Hello,

 

I'm working on a fleet control project on a very tight schedule (which I didn't set). I'm the primary (probably the only) developer, and the project should be completed in around 3 months. The system is based on an arduino due, a simcom 5360 (3G + GPS), accelerometers, odb2 interface and bluetooth low energy, all of which would be integrated into a single PCB by the hardware guy. I don't think I will have any problem at using these peripherals, but what I'm really wondering is what would be the best practices to make the system as robust as possible so that when its delivered it doesn't fail. A crash and reset, wouldn't be a disaster, but having the hardware to fail and not do what is supposed to do (process and send telemetry) would be a major disaster. So my question is, what are some good practices/recommendations to make the system as robust as possible so that once its delivered it will keep working for months?

As of now what I've been doing is to code as much as possible in the PC, because its faster to compile and easier to debug. My plan is to create wrappers for some Arduino functions to be able to test as much as possible code on my PC. I'm doing exhaustive unit tests to all functions and considering corrupt serial data (I wouldn't like garbage to cause a hang or crash). I also would like to do some code coverage, but I need to find the right tools to do it, as visual studio community 2017 doesn't support it. I plan to program a server that will simulate different situations, including different network conditions to test if the client performs as it should. I also plan to use an ODB2 simulator to test at home different conditions. A watch dog is going to be used to make sure the loop is properly looping. And that is pretty much my current approach to make the system robust.

One thing I'm not completely sure, is what are the best ways to perform field tests. Ideally I would like to minimise them, as they are expensive and time consuming. What are some good practices to make the most out of them? If something fails in the field I would like to be able to track it to the source of the issue, as opposed to end up wondering what caused it and repeating field test over and over on different conditions.

An alternative solution to trying to make the system bug-free, could be to implement OTA updates, which on the espressif mcus is pretty straightforward, but here I'm not sure how I could do it. Any ideas?

 

Also any suggestions and comments would be gladly welcomed...

 

Thanks

  • Sign in to reply
  • Cancel

Top Replies

  • michaelkellett
    michaelkellett over 7 years ago in reply to mcb1 +5
    I'll second that last paragraph - on this project 3 months might be just enough to get a working prototype together that was good enough for some initial trials. (But it is nothing like enough time to…
  • dougw
    dougw over 7 years ago +4
    It sounds like you are not doing the hardware yourself, but a vehicle environment can be very hard on hardware, so it needs to be considered when reliability is important. There are a lot of things to…
  • Fred27
    Fred27 over 7 years ago +3
    Well for a start, an Arduino is probably not really suitable. There are microcontrollers and peripherals that are appropriate for automotive and industrial environments - such as TI's Hercules series.
  • dougw
    dougw over 7 years ago

    It sounds like you are not doing the hardware yourself, but a vehicle environment can be very hard on hardware, so it needs to be considered when reliability is important. There are a lot of things to consider when making hardware robust for vehicle applications, including power supply, shock, vibration, temperature, humidity, operator mistreatment, etc. Let us know if advice is needed for that.

    I'm not really a software guy, but here are some pointers anyway...

    On the software side, try to build in self diagnostics for each subsystem and a graceful way to handle errors.

    Add at least a temperature sensor and create a periodic non-volatile time-stamped log of temperature, system status, errors and system activity (and firmware rev number) - so when it fails you know when it failed, what the conditions were and what part of the program was running.

    Ensure there are no possible conditions that could result in an endless loop - for example do not wait forever for a (possibly broken) sensor to respond.

    Do not depend on data such as GPS data being properly formatted - garbled data needs to be taken in stride.

    One aspect of fleet monitoring systems that should not be overlooked is acceptance by the operators. They need to pretty enthusiastic about what is being recorded and reported, otherwise equipment will just "mysteriously" cease to function. Protecting against reluctant operators is a whole other level of robustness.

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • Cancel
  • Fred27
    Fred27 over 7 years ago

    Well for a start, an Arduino is probably not really suitable. There are microcontrollers and peripherals that are appropriate for automotive and industrial environments - such as TI's Hercules series.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Cancel
  • neuromodulator
    neuromodulator over 7 years ago in reply to dougw

    That's some good advice, and yes, I'm not doing the hardware part, hopefully its done the right way and there are no issues with power or signal integrity. I like your suggestion about logging temperature, as high temperature could cause instability. I thought about logging, but I'm afraid the internal non-volatile memory could wear out very fast if I do so, as an alternative an SD card could be used, at least for the prototypes. On relying on the correct working of each subsystem is a very good idea also. For the endless loop condition I'll use a watchdog to make sure it doesn't get into such state. When you talk about GPS data being garbled, would that be because of signal integrity issues, or do you think GPS modules are not mature enough to work properly and generate properly formatted data?

    How operators accept the system is completely out of my control, I suspect that if they think they are being controlled they may not like it at all and try to break it, I'll comment that to the part of the team concerned with those issues...

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Cancel
  • neuromodulator
    neuromodulator over 7 years ago in reply to Fred27

    Was reading about the Hercules, I would think It's a bit of an overkill, being a CortexR with lots of safety mechanism, it also wouldn't make the system more robust unless other components are also equally robust, which I would think could increase the price quite a bit. Here, nobody would die if the system fails, and I would think a lower than 5% of failures per month of usage would be in the limit of whats acceptable. The Due is a CortexM3, why do you think such MCU isn't really suitable for the that task?

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
  • dougw
    dougw over 7 years ago in reply to neuromodulator

    I'm not sure what all the reasons for GPS data to get messed up are, but I suspect they each manufacturer has their own algorithms to deal with satellite signal drop-out and RF interference. I know some of my GPS modules send out partial data sentences unexpectedly.

    I use FRAM when I need to constantly write to a non-volatile memory. You can get an SPI FRAM module from Newark or Adafruit.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
  • mcb1
    mcb1 over 7 years ago

    but what I'm really wondering is what would be the best practices to make the system as robust as possible so that when its delivered it doesn't fail

    You need to include an external watchdog timer.

    There are IC's out there that monitor the supply voltage and receive a regular 'pulse' from the processor.

    Failure of either will cuase it to reset the micro.

     

    Otherwise you need every aspect of the software to have a proper error routine as dougw mentioned.

     

    You also need to allow for a wide voltage range (7-18v DC) along with a high supply noise in some periods.

    Temperature is also going to be a factor with some internal temperatures exceeding 50 degC, or if you're in Australia even more.

    Most silicon is only rated to 55 degC when it's running.

     

     

    IMO three months to design, verify the hardware and then test is a bit short.

    A working prototype might be possible to allow testing.

     

    5% faliure/month is quite high. I would hope you were under 1%.

    To give you a idea, my skifield trip systems have been operating for 8 years (approx 3 months/yr at 7 hrs/day) and there has been zero failure in either one.

    The climate is less than ideal, and they get unplugged during the off season due to lightning.

     

    I wasn't able to use a watchdog, but I did use dual processors and pulsed the output so a hang in either processor would trip the tow.

    Version 3 which is the drawing board now, will have the watchdog timer and most likely use an Arduino with an external regulator.

     

    Mark

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Cancel
  • Jan Cumps
    Jan Cumps over 7 years ago in reply to neuromodulator

    neuromodulator  wrote:

     

    Was reading about the Hercules, I would think It's a bit of an overkill, being a CortexR with lots of safety mechanism, it also wouldn't make the system more robust unless other components are also equally robust, which I would think could increase the price quite a bit. Here, nobody would die if the system fails, and I would think a lower than 5% of failures per month of usage would be in the limit of whats acceptable. The Due is a CortexM3, why do you think such MCU isn't really suitable for the that task?

    If a failure causes major disaster and overheating causes instability, you may want to read about functional safety and safety controllers one more time. You will not get what you need with firmware. You need hardware support and a thourough risk analysis.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
  • neuromodulator
    neuromodulator over 7 years ago in reply to mcb1

    I was going to use the internal watchdog, (page 260, http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-11057-32-bit-Cortex-M3-Microcontroller-SAM3X-SAM3A_Datasheet.pdf). Which watchdog would you recommend?

    Yeah , 5% is not that great, of course I want to reduce it as much as possible, in software I'll do all I can in that short time frame. But in terms of hardware I don't think it will be easy to justify duplicating the production costs to reduce the failure to half.

    Thanks sharing your thoughts!









    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Cancel
  • mcb1
    mcb1 over 7 years ago in reply to neuromodulator

    I was going to use the internal watchdog

    I'm aware of the internal watchdogs, but I question whether they would operate if the micro gets screwed by either a brownout or something else.

    It seems my thoughts aren't alone https://www.digikey.co.nz/en/articles/techzone/2012/may/a-designers-guide-to-watchdog-timers

     

    TI have a great range of them plus others have them as well.

    http://www.ti.com/lit/ds/symlink/tps3813.pdf

    This is just one and gives you an idea.

     

    Maxim https://www.maximintegrated.com/en/products/power/supervisors-voltage-monitors-sequencers/watchdog-timers.html

    ST https://www.st.com/en/reset-and-supervisor-ics/watchdog-timers.html?querycriteria=productId=SC1854

     

     

     

    Your hardware guy might have some ideas about what suits his hardware.

     

    But in terms of hardware I don't think it will be easy to justify duplicating the production costs to reduce the failure to half.

    I'm sure you mean doubling, but regardless the hardware design should not be a source of that high a failure rate.

    I would be expecting a much less than 0.5% failure rate at production, and I'd be dissapointed if it was higher than 0.1%.

    You can have a higher rate during prototype testing, but after that it should be closer to zero.

     

     

    Good design means the product is suitable for the purpose, and in this day and age of consumer power and protection, they might have every right to demand their money back plus costs.

     

    Imagine if the product overheats, and causes either a localised fire, or worse a major fire inside the vehicle that affected other vehicles.

    Would your indemnity cover you for the owners costs.

    Adding "Use at your own risk" is not sufficient in this day and age.

     

    They could sue you not only for the physical aspects, but the emotional harm as well.

    The insurance company is likely to chase you for costs, and that might also include any testing they did to show it was that product that caused it.

     

     

    I was involved in a product our company built and it went through an independant lab for electical safety testing.

    Part of that testing was subjecting it to high and low temperatures to ensure it didn't present a risk, and we were using another manufactured power supply, so it was things exploding they were looking for.

     

     

    The point here is to show that rather than just make something and throw it out there, you really need to have documented proof that you've tested it for every scenario possible.

    This also includes EMF/EMR testing to ensure it doesn't radiate .... just look at the Raspberry Pi debarkle before it was finally tested.

    In the short timeframe given, I don't think any of this is possible.

     

     

    We have a garage door manufacturer here in NZ that used to use asian sourced door controllers. While they accepted that some would fail during testing, it was the higher return rate after install that started costing them money.

    In the end it became cheaper to make their own, and at the same time they improved their products reputation.

     

    In advertising, bad products are 'shared' 10 times more than good products, so it makes sense to try not to be in the 'bad review' category.

     

     

    IMO if I was asked to be involved in somethign like this and under these terms, I'd be walking away no matter how much I wanted to be involved.

    The personal risk is just not worth it, and even if your lawyer can write a really good indemnity agreement, your name will still be associated with it.

     

     

    Mark

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
  • michaelkellett
    michaelkellett over 7 years ago in reply to mcb1

    I'll second that last paragraph - on this project 3 months might be just enough to get a working prototype together that was good enough for some initial trials. (But it is nothing like enough time to develop software to anything above what I would call cheap commercial standard.)

     

    But there is a whole load of stuff in this project which suggests that it needs to be done to a much higher standard.

     

    MK

    • Cancel
    • Vote Up +5 Vote Down
    • Sign in to reply
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube