Delays and thermal management

Discussion and questions about programming with Ultibo.
Gavinmc42
Posts: 1460
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: Delays and thermal management

Postby Gavinmc42 » Sat Feb 02, 2019 10:46 am

100uS is a 10KHz interrupt rate :o
That is pretty good for a real time operating system running on it's own core.

For lots of RT systems 100Hz is good enough, drones are at 400Hz, what could 10,000Hz be good for?
How do cores communicate to each other?
Another two cores could run at 100uS?

That's a fixed rate, variable rate on three cores, good enough for circular interpolation on 3 axis CNC machine?
Not a R core ARM so wonder what latency/jitter there is on the A cores?
pik33
Posts: 829
Joined: Fri Sep 30, 2016 6:30 pm
Location: Poland
Contact:

Re: Delays and thermal management

Postby pik33 » Sat Feb 02, 2019 11:58 am

what could 10,000Hz be good for?


Software based pwm :) to control something without switching off the sound
Brutus
Posts: 22
Joined: Sun Jan 20, 2019 1:24 pm

Re: Delays and thermal management

Postby Brutus » Sun Feb 03, 2019 5:59 am

I use this datalogging to monitor my old japanese car.

The injectors opening time for example require that kind of datalogging frequency because they open like 2.1 to 2.3 milliseconds at idle.

The limitation will come from USB writing speed and memory regarding the number of signals I can monitor at the same time, not CPU power.
Ultibo is fantastic!
Gavinmc42
Posts: 1460
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: Delays and thermal management

Postby Gavinmc42 » Sun Feb 03, 2019 7:15 am

I use this datalogging to monitor my old japanese car.
Wow, did not think it would be fast enough.

My new Honda has HDMI and USB on the media unit.
Will the USB power the Zero W with BT connection to ODB BT dongle?
Does ODB give enough info to do a 3D ignition MAP?
Hack ECU's with a Pi?

Because Ultibo does not take much ram I usually make a big ram drive and log to that.
Once the sample time is over then I save to flash/uSD or USBstick.
A few years back they made USB dram drives.

Not sure if my only SSD will write faster.
The GPIO does have SMI mode which is basically IDE.
What else is around?
https://www.transcend-info.com/Embedded/Products/No-823
Brutus
Posts: 22
Joined: Sun Jan 20, 2019 1:24 pm

Re: Delays and thermal management

Postby Brutus » Sun Feb 03, 2019 11:16 am

Hi Gavin,

I forgot to answer your other questions BTW:

Gavinmc42 wrote:100uS is a 10KHz interrupt rate :o
That is pretty good for a real time operating system running on it's own core.

For lots of RT systems 100Hz is good enough, drones are at 400Hz, what could 10,000Hz be good for?


I actually did some trials at 100kHz and it worked, but the safety margin was not sufficient for my purpose.
I do a rough compression of the data upon each insertion so it's not like it's only changing a single value, there's a bit of code in there (I optimized this code by checking the amount of assembly code that was generated by each FPC line code).

Gavinmc42 wrote:How do cores communicate to each other?


Cannot be more straightforward: Memory is shared, so you just use global variables and access them like there was no multi-core system.

Gavinmc42 wrote:Another two cores could run at 100uS?


Garry might correct me on this, but from what I saw, only CPU 2 and CPU 3 will be happy to run at 100µs for my application.
CPU 1 deals with the USB and a few other threads and CPU 0 is my workhorse.
But if you migrate threads correctly, having 3 CPUs running at 100µs is perhaps doable.

Gavinmc42 wrote:That's a fixed rate, variable rate on three cores, good enough for circular interpolation on 3 axis CNC machine?
Not a R core ARM so wonder what latency/jitter there is on the A cores?

[/quote]

I would use one cheap Arduino hardware as SPI slaves with Ultibo as a master for this kind of task.
I think it would be much easier, but that's just me! :D

Gavinmc42 wrote:My new Honda has HDMI and USB on the media unit.
Will the USB power the Zero W with BT connection to ODB BT dongle?
Does ODB give enough info to do a 3D ignition MAP?


My car is too old to have OBD :lol:
From my little knowledge about OBD, it should be too slow to collect a 3D ignition map (but I might be wrong).

Gavinmc42 wrote:Hack ECU's with a Pi?


I just datalog the data from the ECU.
I will again use an ATMega328P to hack the signals in the ECU, especially since my ECU deals with 5V TTL signals.
Ultibo will send presets to the ATMega.

Gavinmc42 wrote:Because Ultibo does not take much ram I usually make a big ram drive and log to that.
Once the sample time is over then I save to flash/uSD or USBstick.
A few years back they made USB dram drives.


When it comes to logging, it's all about balancing the load between the data insertion routine (running every X µs) and the file write routine (running every X seconds).

If your data insertion routine does too many things, you obviously cannot log data at a quick rate.
If your file write routine (data formatting and USB drive write) isn't fast enough, you will run out of RAM between file writes.

Gavinmc42 wrote:Not sure if my only SSD will write faster.
The GPIO does have SMI mode which is basically IDE.
What else is around?
https://www.transcend-info.com/Embedded/Products/No-823


I use a cheap chinese USB2.0 stick and it works. :)

Regards,
Henri
Gavinmc42
Posts: 1460
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: Delays and thermal management

Postby Gavinmc42 » Sat Feb 09, 2019 7:47 am

My new Honda has HDMI and USB on the media unit.
Will the USB power the Zero W with BT connection to ODB BT dongle?


Yes, my car console's USB port will power a normal Zero running my LCARS OpenVG demo.
What can I use a Zero in the car for? The console already plays music and videos when stationary.
Get a GPS module and roll my own nav system?
Attachments
car_lcars.jpg
car_lcars.jpg (339.01 KiB) Viewed 92 times
Brutus
Posts: 22
Joined: Sun Jan 20, 2019 1:24 pm

Re: Delays and thermal management

Postby Brutus » Sat Feb 09, 2019 8:29 am

Gavinmc42 wrote:What can I use a Zero in the car for?


Usually, you do not want to modify the wiring loom of a new car you paid big money for, so you will not do much.

On a cheap older car, you can play a lot:
-Auto wakeup engine start in the winter.
-Remote control engine start.
-Fuel consumption datalogging (with flowmeter on injection).
-Overtemp/oil pressure warning.
-Bumper radars display.
-Full speedometer update to TFT (below for my Lexus LS400).
Image
-Automatic Go Pro switching in case of spirited driving (using accelerometer).
-OpenCV cops detection. ;)

And if you start using arduino slaves, the possibilities are virtually endless...

Return to “General”

Who is online

Users browsing this forum: No registered users and 1 guest