You are here

How does controlling two different motors over CAN bus really work?

1 post / 0 new
oangelo
Offline
Last seen: 1 year 3 months ago
Joined: 2022-12-08 22:47
Posts: 12
How does controlling two different motors over CAN bus really work?

I have been attempting to understand how VESC operates, specifically how to control two different motors using two connected VESCs via the CAN bus. The documentation is quite brief, and I have not found any useful information. Consequently, I have been trying to figure it out through experimentation on my own.

My setup consists of a trike with two motors and two VESCs. I am not aware of the motor specifications, so I had to use a device to measure the actual RPM to calculate the number of motor poles. The rear motor has "40 poles" (determined by dividing the actual ERPM by the RPM) and features a reduction and differential to connect it to the two rear wheels. The front motor is a hub motor with 26 poles. These motors exhibit distinct characteristics. I have configured the master VESC app to utilize ADC, and the "Control type" is set to current. This VESC is connected to the front hub motor.

The issue arises when I am going uphill; the front wheel seems to slip, which could result in excessive wear, particularly given the prevalence of hills in this area.

Initially, I believed that the problem stemmed from an incorrect configuration of the "Motor Poles" and/or "Gear Ratio." I suspected that the front wheel might be running much faster than the rear wheel, causing it to slip, especially when going uphill. To test my hypothesis, I lifted all the trike wheels off the ground. To my surprise, when I accelerated, all the wheels began moving at first. However, after a few seconds, the rear motor stopped, and only the front wheel continued spinning. This is quite peculiar.

I suspect this issue might be related to the "Current Control" mode, also known as torque control. Since there is almost no torque, FOC does not function as expected, or at least not in the way I anticipated.

I tried changing the "Control Type" to "Duty Cycle." Both wheels spun as expected; however, since the motors have a different number of poles, the rear wheel spins at a significantly lower RPM for the same duty cycle. Thus, "Duty Cycle" control proves to be ineffective when using different motors. Nevertheless, it demonstrates that my setup does not have any inherent issues. To further complicate matters, I discovered on the VESC forum that people argue that VESC is not suited to control two different motors.

All this raises the question: how can I control two different motors with VESC? If "Current Control" is the appropriate method for controlling two different motors, as it governs torque rather than speed, how exactly does it work, and what causes the peculiar behavior when the wheels are off the ground?

I have come across a workaround that involves disconnecting the CAN bus and connecting the ADC to both VESCs, but I am unsure if this will enable both wheels to rotate at the same speed and/or torque.

Thank you in advance to any kind soul who take the time to read through all this and offer assistance with the issue.