You are here

Get Current over CAN bus

5 posts / 0 new
Last post
chriswei
Offline
Last seen: 5 years 6 months ago
Joined: 2019-02-25 12:24
Posts: 2
Get Current over CAN bus

I'm using the comm_can_get_status_msg_index(int index) function to read the slave vesc's can status messages. The rpm and duty cycle are reported as expected (same values as in the vesc-tool), but the reported current is not the same as in the vesc-tool.

I saw that the current measure in the status message is generated with the mc_interface_get_tot_current_filtered(void) function so I played around with different current getter functions, but for no function I see the same output as in the realtime data page of the vesc-tool...

I also double checked with the can_devs command in the VESC terminal, which shows the status 1 message and also there the current that is reported does not correspond with the current shown in the realtime data page.

Have I missed something? How should I read the current of the vesc over CAN bus?

I'm using a vesc 4.12 with FW: 3.55

Any advice would help me out a lot!

 

chriswei
Offline
Last seen: 5 years 6 months ago
Joined: 2019-02-25 12:24
Posts: 2

I just realized that the current sample I receive is not averaged over time, which is why I see big jumps and the value is not the same as in the vesc tool...

lubas
Offline
Last seen: 3 weeks 2 days ago
VESC Free
Joined: 2020-10-17 16:02
Posts: 1

the comm_can_get_status_msg_index is a function over uart? or are you messing with the firmwar

e?

Imane HILIA
Imane HILIA's picture
Offline
Last seen: 2 years 10 months ago
Joined: 2022-01-31 17:09
Posts: 2

Hello 

How did you read the RPM value from can bus data because I work with the same vesc but I don't know how to calculate RPM and duty cycle from data of 8 bites 

Imane 

imane

spacewalker
Offline
Last seen: 1 year 7 months ago
Joined: 2020-06-10 12:30
Posts: 29

you need to look on eRPM, only with sensored motor

Martin