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

When I want to use the Odrive for my cart it is not good that motor is in closed loop. When one of the wheels are more or less blocked it tries to spin to its position. But with a differential steering my cart is going mad.
How can I put it in open loop?
So far I understand I need the Hall sensors in open loop to give the right timing to let motor spin. Like used in an electric bike.

If you are using it in velocity mode, try setting controller.vel_integrator_gain=0
That way the velocity controller will not try to ‘catch up’ after it gets blocked.

Thx
Indeed now it thus not try to catch up.
But I have no power on the wheels. They run but no torque
When I play with config. Vel_gain up to 0,1
The Odrive goes out
On 0,08 some more power but nothing compared with the Amazon bike controller I got with the hub wheels


This are the wheels I ordered from Wheelway.
With this I could not do the differential steering.
The wheels are 36volt 800watt

What error does it show? If you connect USB and use the dump_errors command

Do you need to be in velocity mode? Would torque mode (with a velocity limit) work better for your golf cart?

I tried torque mode but no scces but I know that I still not understand the odrive yet.
So far the problem with spinning back is solved that is ok! THX
Today I tried
1-odrv0.axis0.controller.config.control_mode = CONTROL_MODE_TORQUE_CONTROL
2-odrv0.axis0.requested_state = CONTROL_MODE_TORQUE_CONTROL
3- odrv0.axis0.controller.input_torque = ( here i tried different settings up to 10?)
4- tried to enable_current_mode_vel_limit = false but command was not valid
But the power on the motor stays the same.
I feel that I am very close to the solution if I get the power out of the motors I can start with the final development of my cart. Picture is schowing ruff test model to test the software.
I believe I need a lesson to understand the odrive and his commands.

Set vel_integrator_gain