Electronics > Projects, Designs, and Technical Stuff
CAN bus timing
(1/3) > >>
Momchilo:
Hi,
I never used CAN bus before, I probably need it now to solve my problem.
My goal is to measure ~50 different voltages and send ~50 different PWM signals to gate drivers. The used DSC (TI TMS320F28335) is neither able to generate those many PWM signals nor to handle so many analog inputs. A solution could be the CAN bus as seen in the picture.
So every of those 50 cells would get one microcontroller which handles the signals. Maybe you could build something to use only the DSC without the microcontrollers, but the number of cells should be easily scalable without any limitations like not enough pinouts. I would guess a bus is the only solution.
With the CAN bus the microcontrollers can't get the different PWM values simultaneously, respectively the DSC can't output all at once. But the PWM outputs must be timed synchronously to drive the gate drivers for the transistors.
After every microcontroller received the individual value for the duty cycle for the PWM signal, there must be a generated signal by the DSC on the bus, which is addressed to every single microcontroller simultaneously to output the new duty cycle.

Every PWM value is 16Bit and the voltage measurements are at least 12Bit values. So no large amounts of data, but many. The DSC is chosen, but for the microcontroller everything would be possible.
I don't expect a complete calculation or something similar, but hints where to start would be really nice or ballpark numbers. Is it more like 1ms for the complete data transfers or is it possible in 1µs? Like how long does it take to receive 16Bit and then send 16Bit to a microcontroller? Is it possible to talk to every microcontroller at the same time via CAN bus?
The DSC with a 150MHz system clock uses the CAN protocol 2.0B. The reference guide for the CAN module is here: http://www.ti.com/lit/ug/sprueu1/sprueu1.pdf
I appreciate every more or less helpful answer, thanks in advance :)

Best regards
Momchilo
langwadt:
CAN bus is only  500kbit, you can go faster but not much
Momchilo:

--- Quote from: langwadt on January 18, 2019, 01:04:33 am ---CAN bus is only  500kbit, you can go faster but not much

--- End quote ---
So I have 50*16Bit+50*12Bit=1.4kbit data to transfer.
With 500kbit/s, the 1.4kbit would need 2.8ms. That would take way too long. The PWM frequency will be 12kHz. That means there are 83µs time to do everything. The calculations need the most time for the control. Hence, the data transfer must be done in like 5µs. To achieve this, the transfer rate must be at least 280Mbit/s. I think this is impossible between a microcontroller and the DSC. This thread is unnecessary, sorry about this. I knew the rate, but didn't do the simple math.
I have to research for alternatives. Maybe just one big FPGA instead of the microcontrollers. In this way every time cells are added, the program on the FPGA must be updated |O
Niklas:
The CAN bus frame contains quite a lot of overhead bits for the identifier, checksum etc. Even with standard identifiers and just 16 bits of data you will end up with approx 60 bits on the bus. You can save some time by putting 4x16 bits in each CAN frame, do HW filter on identifier and the select the appropriate data bytes. With 8 bytes of data, standard identifier and 1 Mbit/s it will take 100 us/frame.
It is also possible to send the PWM data frames with different identifiers and then use another identifier as a global update.
fchk:

--- Quote from: Momchilo on January 18, 2019, 12:42:16 am ---Hi,
I never used CAN bus before, I probably need it now to solve my problem.
My goal is to measure ~50 different voltages and send ~50 different PWM signals to gate drivers. The used DSC (TI TMS320F28335) is neither able to generate those many PWM signals nor to handle so many analog inputs. A solution could be the CAN bus as seen in the picture.

--- End quote ---

I think CAN is the wrong answer.

I'd use an FPGA for this. FPGAs are able to generate 100s of PWMs, and if you worry about scaling - there are FPGAs with over 1000 pins and millions of logic blocks. Everything would be fed from a single clock and be synchronous on the spot.

The FPGA would also control all the ADCs, which is also no problem at all.

Since the FPGA is programmable hardware everything automatically runs in parallel, and the timing is always fixed.
Navigation
Message Index
Next page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod