Arduino DUE timers and PWM frquency

6 vues (au cours des 30 derniers jours)
Hocine YAKOUBI
Hocine YAKOUBI le 28 Sep 2023
Hi,
I am attempting to control three DC motors using a PWM frequency of 15 kHz for three omniheel robot. Unfortunately, I am encountering some difficulties as the system is not operating as intended.
Specifically, while two of the motors are functioning correctly, the third one is producing noise and is not working properly.
Here are the configurations for the three DC motors:
PWM Pins Used: 9, 5, 6
Direction Control Pins: 2, 4, 7
PWM Frequency: 15 kHz
And here are the pins for the quadrature encoders:
Encoder 1 Pins: 44, 45
Encoder 2 Pins: 22, 23
Encoder 3 Pins: 42, 43
The noise is emanating from motor 2, connected to PIN 5, and associated with encoder 2.
ANy idea to have to resolve this ? problem with timers ?
Thanks by advance

Réponses (1)

Hocine YAKOUBI
Hocine YAKOUBI le 28 Sep 2023
I found this solution, but i didnt undurstund why it works ? for the motor on the PIN 5 (M2 in the picture) before i send the setpoint value to PID. I added constant with value -0.00002 to the setpoint. With this solution there is no noise !!!
But I have another issue :
Like a told you it's 3 omniwheel robot, so for the setpoint i sent 3 value, Vx, Vy and W from serial POrt (Raspi 4 and ROS).
If i send Vx= +-0.1 m/s and Vy=0 m/s. it works well.same for Vx=0 and Vy=+-0.1.
but if i send Vx=0.1 m/s and Vy=0.1 m/s. the M2 on PIN5 loose the control and run very fast withouth stop even I send 0 to Vx and Vy.
Could anyone explain what's happening and help to resolve this issue ? THanks again

Catégories

En savoir plus sur Simulink Supported Hardware dans Help Center et File Exchange

Produits


Version

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by