2

I am working in the lane detection using Simulink. (As short)

  1. A pi camera detecting the lane using Raspberry pi 3 microcontroller in simulink and send the control command to Arduino using RPI UDP send. (am running the model EXTERNAL and Play button in simulink ).

As result : The lane recoginition works good detecting the left and right lane (but my udp sending to arduino servo with Little microsecond delay)

I donot knew, why the udp sending Little delay to arduino ?

  1. Once if we can deploy the model to Hardware (Standalone), whether it can works without delay ?
  • well you have to keep in mind that UDP doesnt resend dropped packets so first check if that is the problem , then you have to take Simulink's calculation delay , my advice would be to use the C coder for simulink and translate your model into a C code and run it directly on your raspberry pi , it would probably resolve your problem – Novice_Developer Mar 08 '17 at 13:53
  • @Umar : Sorry i can not get your answer. Can you please explainw what you mean here Simulink calculation delay ? For example: simple constant block in simulink to turn motor ON/off using RPI Udp send packet as Quick using arduinio. But If i am running same time as RPI image capturing and RPI UDp send. The udp block sending 2 second delay to Arduino to control motor/servo. Can you say how to do c coder for simulink and translate the model to c code.... u meant the model deploy to hardware (target hardware).In my case the RPI – Math_implement Mar 08 '17 at 14:27
  • [here](https://de.mathworks.com/help/dsp/ug/generate-code-from-simulink.html) is a guide for code generation of Simulink models , but for this you need a code genration toolbox , plus check for raspberry pi if hardware support package is available for your microcontroller you can check it by Configuration parameters > Hardware Implementation of your simulink model , I did it for MicroZed Board for which I had this available which made it alot easier to implement , otherwise you can also simply copy the C code and edit it according to your controller – Novice_Developer Mar 08 '17 at 14:52
  • @Umar : Thanks for your reply. You right, Already i have rpi preinstalled and configed in simulink. Once if the code is deployed to target hardware. whether it run with out any delay. Have you tried with any projects ? But at same time, we cannot see the live results like scope in simulink ? – Math_implement Mar 08 '17 at 14:57
  • @Umar: As i said before as example (A simple constant block in simulink to turn motor ON/off using RPI Udp send packet as Quickly via ethernet (rpi and arduino (to control motor)). But If i am running same time as RPI image capturing and plus RPI UDp send. The udp block sending 2 second delay to respont to Arduino to control motor/servo) I dont why this delay ? – Math_implement Mar 08 '17 at 15:01
  • Yes actually I have , principally it should remove the delay which I highly suspect is due to your 'recieve' part of the code in your Rpi, for the result you can simply implement the same algorithm through which you communicate with matlab but just send the results from RPi , even if there is a delay in the scope results they are manageable – Novice_Developer Mar 08 '17 at 15:01

0 Answers0