VESC Servo Control

General topics and discussions about the VESC and its development.
DubCar
Posts: 9
Joined: 18 Feb 2017, 21:28

VESC Servo Control

Postby DubCar » 02 May 2017, 02:05

Hello!

I'm trying to write a custom serial driver for the VESC but am having some trouble in using the VESC to control a servo motor for steering control. I've re-implemented the UART interface that the BLDC tool is based on, but the device does not respond to any values that I set with COMM_SET_SERVO_POS (from datatypes.h in Vedder's serial code). Is there any special in the firmware that needs to be enabled in order to use the PWM out on the VESC for controlling a servo? Thanks!

benjamin
Site Admin
Posts: 280
Joined: 15 Dec 2015, 08:38
Location: Sweden
Contact:

Re: VESC Servo Control

Postby benjamin » 02 May 2017, 07:56

In conf_general.h in the firmware you need to set SERVO_OUT_ENABLE to 1 and recompile. You may also have to replace the series resistor on the PCB for the servo input/output with a lower value in case the input impedance of the servo is too low.

When VESC Tool and the new firmware is released, there will be a pre-compiled firmware in VESC Tool with servo output enabled, and the VESC6 has a lower value resistor, so it should work out of the box then (hopefully).

DubCar
Posts: 9
Joined: 18 Feb 2017, 21:28

Re: VESC Servo Control

Postby DubCar » 02 May 2017, 20:43

Benjamin! The man himself!

Thank you for the quick response. We have a demo for our primary sponsor coming up so we are hoping to have the robot operational by then. Getting the servo control down is one of the last steps.

1) When do you expect the VESC tool to be released? It sounds like this is a replacement for the BLDC_Tool?

2) To program the VESC, it seems that I need to get a hold of both a STM32 discovery board and stlinkv2 programmer? Or can I do it over USB with BLDC_Tool?

3) Is 100 Ohm the recommended resistance to replace R5 with (according to your diagram?).

Thank you!

benjamin
Site Admin
Posts: 280
Joined: 15 Dec 2015, 08:38
Location: Sweden
Contact:

Re: VESC Servo Control

Postby benjamin » 02 May 2017, 21:50

DubCar wrote:1) When do you expect the VESC tool to be released? It sounds like this is a replacement for the BLDC_Tool?


Yes, VESC Tool is a replacement for BLDC Tool which I have spent a lot of work on. I will release it with the launch of the VESC Project website, which I will focus on after shipping the beta VESC6, which hopefully will be in around one week from now. After that it will probably take me a few weeks to finish everything with the website and release while getting feedback from the beta, so I think it will take a month from now.

DubCar wrote:2) To program the VESC, it seems that I need to get a hold of both a STM32 discovery board and stlinkv2 programmer? Or can I do it over USB with BLDC_Tool?


If the VESC you bought comes with a bootloader (I hope most of them do) you can use bldc tool to upload the compiled firmware. You can set up the toolchain to compile everything quite easily on linux, but since I already have it set up I have attached a compiled version of the firmware from github (2.18) for hw 4.10-4-12 with servo output enabled.

DubCar wrote:3) Is 100 Ohm the recommended resistance to replace R5 with (according to your diagram?).


100 ohm or lower should be fine.
Attachments
VESC_servo_out.zip
(90.63 KiB) Downloaded 160 times

DubCar
Posts: 9
Joined: 18 Feb 2017, 21:28

Re: VESC Servo Control

Postby DubCar » 04 May 2017, 18:37

Vedder,

Thank you so much! This saves as a lot of trouble.

One last question before we attempt this: what size SMD resistors do you use? 0805? 0603? I'm not familiar enough to be able to eyeball it.

Thanks!

EDIT: I found your BOM, SMD-0603 it is!

Best,
Colin

8ball
Posts: 1
Joined: 11 May 2017, 06:37
Location: Ger

Re: VESC Servo Control

Postby 8ball » 11 May 2017, 06:46

Hi,

what is the max. current the 5V-servo-output can provide?
I would like to power two servos, but each of them needs about 0,8A at full torque.

regards
8ball

arvidb
Posts: 230
Joined: 26 Dec 2015, 14:38
Location: Sweden, Stockholm

Re: VESC Servo Control

Postby arvidb » 11 May 2017, 09:24

According to Benjamin's blog post about the VESC, the 5 V can supply a maximum of 1 A. (The 5 V also supplies the microcontroller of the VESC, so if you overload it you will get brownouts/resets/maybe kill your VESC if you're unlucky.)

rew
Posts: 939
Joined: 25 Mar 2016, 12:29
Location: Delft, Netherlands.

Re: VESC Servo Control

Postby rew » 12 May 2017, 08:02

The DRV chip that does the actual stepdown is specified to 1A. The microcontroller will use something like 50mA from that. So in theory it's 950mA. (but that "50mA" is not very accurate, it might be 40 or 70.) On the other hand, there is probably some margin on that "1A" too.

But small servos can use significant current. IIRC, I measured the blue 9 gram servos at 1A....

hexakopter
Posts: 86
Joined: 24 Dec 2015, 15:24
Location: Germany

Re: VESC Servo Control

Postby hexakopter » 12 May 2017, 10:49

For me the data sheet of the DRV8302 says, that the integrated step-down is specified to 1,5A. So the consumption of the 3.3V LDO (for the micro controller / SN65HVD232 CAN IC) and a safety margin is already build into this 1A.

So I would definitely use an external step-down module when you need that much current for the two servos.

rew
Posts: 939
Joined: 25 Mar 2016, 12:29
Location: Delft, Netherlands.

Re: VESC Servo Control

Postby rew » 13 May 2017, 09:23

Oh, sorry. Bad memory. IIRC, there was a 1A limit in the DRV circuit. Even with the chip being able to do 1.5A, I seem to remember that Benjamin configured the components around it to satisfy the "1A max" spec.

But yes, even if you'd get pretty close wtih 1.5A if the 800mA is correct, I wouldn't risk losing power to the fast-spinning motor....


Return to “General”

Who is online

Users browsing this forum: Google [Bot] and 1 guest