Golfcart one person

I tried another Odrive and I have the same problem.
I use nano arduino and PWM Output 9 and 10 to control Odrive input 3 and 4
The two hubmotors 800watt are running both nicely when controlled from the software.
When I connect output 9 to 3 or 4 the motors can be speedcontroled
When I connect 10 to 3 or 4 the same.
BUT WHEN I CONNECT BOTH 9 and 10 to 3 or 4
The motors stops spinning.
What can be the reason?
Ferriet rings on the motor wires , motors are spinning from the software.

I assume you’re connecting Arduino pin 9 to ODrive pin 3, and Arduino pin 10 to ODrive pin 4? And if you disconnect one or the other everything works, but if they’re both connected it fails? That’s quite odd.

Indeed the moment I connect both power drops of.
And both motors can run when controlled from the software!
What I have tried till now:
Power the arduino seperate and from the Odrive
Put opto couplers between nano and Odrive
Tried an Uno instead of nano
Tried another Odrive
Checked with oscilloscoop and both PWM ARE nice signals

Now I am at the end of the ideas so please advice.
Could I use 1 and 2 input?
But I did not find how to disable UART?
What is the command?
Or control through the UART but I don’t know how to do.

Hi Paul,

Please can you connect both USB and Arduino at the same time.
Use the Arduino to try to drive both motors.
After you see the problem, type dump_errors(odrv0) in the odrivetool shell, and let us know what you see.

Hi Tom

I did the dump error

Result

Axis errors

AXIS_ERROR.MOTOR_DISARMED

Fetthermisto no error

Motorthermistor no error

Encoder no error

Controller no error

But

MOTOR_ERROR_CONTROL_ DEADLINE_MISSED

See picture

What does it mean?

Regards

![image|375x500](upload://t7QmwEIleUkRsL5Se7vAdUGoAKU Hi Tom

I did the dump error

Result

Axis errors

AXIS_ERROR.MOTOR_DISARMED

Fetthermisto no error

Motorthermistor no error

Encoder no error

Controller no error

But

MOTOR_ERROR_CONTROL_ DEADLINE_MISSED

See picture

What does it mean?

Regards.jpeg)

Sounds like we don’t have the processor time to run both interrupts? Hmm… What PWM frequency are you using?

I use pin 9 and 10 this is 490 Hz
Should I try pin 5 and 6 this is 980Hz

Could it be that it worked with the earlier firmware as it seems to work with my test set up a few months ago. (Was whit small hoverboard motors)

Ah. ODrive only supports 50Hz servo-style PWM. That it was working at all with the higher frequency PWM is surprising. Try the “Servo.h” library for Arduino.

I did but also the servo.h did not work.
But I try again you never know.
Today I did some tests with PWM.h and took the frequency down to 200Hz. But not to 50Hz.
I will test 50 Hz

I tested 50 Hz NO success but I can see on the behaviour of motors that something has changed. Both where running for 2 sec and that was it
There must be something with the firmware
I checked again with osiliscoop and the PWM signal was very nice and at 50Hz.
I will try with UART but difficult to understand (for me)
What is the command for velocity?
That is the only command I want to transfer
Regards

Did you check the errors after you tried 50Hz and it failed? It’s always possible that it’s a firmware issue, but we have many other people successfully using 1000-2000us control on two axes with no issue…

Keep in mind, a high time of 1000 microseconds gives you the min command. 1500 microseconds is neutral. 2000 microseconds is max command.

The command for velocity is v <axis> <value>, for example v 0 1.234 will command axis 0 to go 1.234 turns/sec.

Great news
IT WORKS!!
I tried again with Servo.h and it works now. I did something wrong the first time?
Thanks a lot.
I will start with road test soon. This is with a proto proto than start with final model.

2 Likes