cancel
Showing results for 
Search instead for 
Did you mean: 

Drone CAN Setup (STM32H753 -STM32F103 Flight Controller)

MShow
Associate

Hello everyone

I'm new here, but i have worked on a flight controller unit FCU with those:

FMU Processor: STM32H753
IO Processor: STM32F103

This FCU then connected to a Raspberry Pi4, auxiliary, where  run his drone python software, using MAVlink approach for telemetry data and CAN communication and parameters setup;

Right now

We have a (good) software ready, with some wizard working well

BUT

we have an issue with CAN-motors and our STM chips...

Is it possibile that those H753 is NOT able to read a CAN motor ,brand new, out of fabric?

or better

Is the chip (H753) ABLE to write a NODE ID on a CAN motor, wich is ut of fabric (nodeID=1) to an actual working NODE ID(10,11,12 etc..)?

We had this issue....

based on your knowledge..
The correct way is to use a CAN-USB to "wake up" motors one by one and then connect to FCU?


Thank you


6 REPLIES 6
mƎALLEm
ST Employee

Hello,

Your question is very generic.

What kind of issues you faced with CAN on STM32H753?

You need to be more specific especially with CAN questions:

Exact issue you have faced?

What kind of investigation you did at this stage: usage of oscilloscope / logic analyzer etc ..?

Provide more details on CAN config:

- Mode used: Classic, FD CAN?

- Bit rate(s)? 

- Provide schematics

- Clock configs: better to share your project.

PS: we cannot support you on Raspberry Pi4 questions. It's your responsibility to configure the CAN interface from that side.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Ozone
Principal III

> we have an issue with CAN-motors and our STM chips...
> Is it possibile that those H753 is NOT able to read a CAN motor ,brand new, out of fabric?

> or better
> Is the chip (H753) ABLE to write a NODE ID on a CAN motor, wich is ut of fabric (nodeID=1) to an actual working NODE ID(10,11,12 etc..)?

As already stated, there is almost no workable information in your post.
I would recommend to check the schematics that your STM32 boards actually have a suitable CAN interface (including transceivers), and that it is properly connected to the CAN device (motor ?).

If you don't build the STM32 board firmware yourself, check at least the release notes that CAN is actually supported.

And then try to monitor the CAN bus connection, to see if there is any traffic at all.
The best option for that would be a CAN dongle (USB-CAN adapter), either on a PC or the Raspberry Pi board.
Alternatively a scope or logic analyser, the latter would have to be connected somehow to CAN Rx /Tx pin at MCU voltage level (not the CAN transceiver).

DigitalMonk12
Associate

STM32H753 is fully capable of CAN communication, so it’s likely not a chip issue. The problem is usually CAN configuration (baud rate, termination, filters) or motor state/init protocol. Node ID change is possible only if the motor firmware supports it. CAN-USB is mainly useful for debugging.

> The problem is usually CAN configuration (baud rate, termination, filters) or motor state/init protocol.

A CAN trace would reveal that, although the error messages depend on the tool used.

Node ID change is possible only if the motor firmware supports it. CAN-USB is mainly useful for debugging.

Problems due to incorrect setup (non-matching IDs) would be visible via a CAN trace as well.

Although "node ID" is not a feature of CAN, which knows only message IDs.
Higher protocols such as CANopen do have node IDs, though.

MShow
Associate

Hi everyone and thank you for reply;

Quick reply so we dont miss the point:

My Flight Controller Unit with STM32H753....look like that is not "able" to recognize a brand-new motor(with NodeID=0 or 1) and SET this NodeID=10-11-12-13 etc...so the Node for actual working on the drone...

All the other parameters (telemetry, MAVlink, CAN managemnt too)...look like saved and verified on the FlightControlelrUnit board...but if we try to use this X6 to set that NodeID written on the ESC itself...this X6 with STM chip look like is not able to...(TMotors esc..look like need they need this https://en.tmotor.com/uploadfile/2024/0801/20240801044215937.pdf)

Now i have not this cloudlink,i 100% need this? i dont think so...

We have this USB -CANable (open source-look good-not yet tried...)

MShow_0-1779607202339.png

To solve this NODE-ID problem:

The idea now, quicly, is to:

  1. connect both: this USB-Can, and the X6 FC Unit...to our auxiliary Rapberry
  2. Running python software wizard , wich use MAVlink to comunicate with X6 (with STMSTM32H753 chip)
  3. Once verified paramaters loaded and telemetry (this work)...
  4. python start a ESC Node Wizard: the user connect to this USB one-motor at time...the wizard use this USB-CAN to write the correct code to ESC...then wizard pass this new written motor to the X6 (STM32H753)...this X6 now recognize the correct NodeID, and bind definetly to the motor
  5. This wizard setup, x4 motors 

 

>> We need to do this becouse look like that X6 (STM32H753) is not able to SET this correct NODE-ID from 0/1 (out of fabric) to 10-11-12-13(funcional)...

You have same issue? Look quite absurd to me, but we have done diffenret test and setup...using this wizard tools we have done a step-by-step procedure that miss no human error...but with only the X6(STM32H753)...we fail and now tying with usb

@mƎALLEm 

Your question is very generic.

What kind of issues you faced with CAN on STM32H753?

You need to be more specific especially with CAN questions:

What kind of investigation you did at this stage: usage of oscilloscope / logic analyzer etc ..?


hope i replyed
we dont used oscillator (forget it, was an idea)...once the X6 is connected to raspebrry...you monitor a serial port with pythonmavlink...and basically get all raw data feed....we have a sofware (>wizard) analyzing that feed and with a procedure for write-on the X6...


@Ozone 

As already stated, there is almost no workable information in your post.
I would recommend to check the schematics that your STM32 boards actually have a suitable CAN interface (including transceivers), and that it is properly connected to the CAN device (motor ?).

>>YES...X6 is a FCU for can drones

>>we mapped current..so the CAN-H CAN-L GND a 5v pins should be correcty connected like:
battery>ESC1->Motor1
ESC1->(can-H,can-L, gnd 5v)==(can-H,can-L, gnd 5v) X6(fcu) CAN BUS HUB 1

Those for 4 motors, CAN BUS 1-3 (front) 4-6 (back)

they see each other..but without NodeID correcty written in ESC before connection, they not proper recognize

If you don't build the STM32 board firmware yourself, check at least the release notes that CAN is actually supported.

And then try to monitor the CAN bus connection, to see if there is any traffic at all.

>python Mavlink reading on raspberry, it read telemtry, it can SET CAN paramaters, saved on X6, and verify...
but thout this mecanism cannot acces brand new ESC

The best option for that would be a CAN dongle (USB-CAN adapter), either on a PC or the Raspberry Pi board.
>we try this

Alternatively a scope or logic analyser, the latter would have to be connected somehow to CAN Rx /Tx pin at MCU voltage level (not the CAN transceiver).

>OK

 

 

@Ozone
STM32H753 is fully capable of CAN communication, so it’s likely not a chip issue.

>i can angree

The problem is usually CAN configuration (baud rate, termination, filters) or motor state/init protocol.

>i can angree...we have filterred this MAVlink feed..so telemetry data is continus low baoud rate feed...while...setting parameters...is different write data and wait 2-3 second and confirm written (wizard)...the CAN comand should be a new comication line, but right now...not yet design for this problem

Node ID change is possible only if the motor firmware supports it. CAN-USB is mainly useful for debugging.

>Node ID chanhe MUST be possible, i hope...we have bought those brand new motors, out of fabric...so without this option motors otherwise are useless and i dont think so....

 

 

 

@Ozone 

> The problem is usually CAN configuration (baud rate, termination, filters) or motor state/init protocol.

A CAN trace would reveal that, although the error messages depend on the tool used.

Node ID change is possible only if the motor firmware supports it. CAN-USB is mainly useful for debugging.

Problems due to incorrect setup (non-matching IDs) would be visible via a CAN trace as well.

Although "node ID" is not a feature of CAN, which knows only message IDs.
Higher protocols such as CANopen do have node IDs, though.

>is complex.....i think that you CAN-trace, will be our CAN-ESC-wizard, reading inside the ESC of single motors, setting up NodeID and then bind it tho the actual flight system sofware...

>the idea was to map all ginle motors and do 1% speed, 5%...and so on..but right now we are not able to define this becouse of this NON-MATCHING-NODE IDS, i cannot setup up a correct CAN protol manager on the sofware...


for having an idea...This is the drone/params wizard tool we developed.

MShow_1-1779609892147.png

 



Thank you for your help
We will try and update here 






Ozone
Principal III

>is complex.....i think that you CAN-trace, will be our CAN-ESC-wizard, reading inside the ESC of single motors, setting up NodeID and then bind it tho the actual flight system sofware...

You use a lot of terminology that is unrelated to CAN, and obviously specific to your drone / flight controller stuff.

If you are unwilling to get down into the CAN layer and the exchanged CAN messages, you will need to consult FCU/ESC/MAVLink documentations, tutorials and perhaps fora related to your field.
I have no experience with that, and can't help you here.