You are here

Questions regarding adc1/2 whilst using one thumb joystick.

4 posts / 0 new
Last post
Ben26
Offline
Last seen: 1 month 1 week ago
VESC Free
Joined: 2024-10-02 17:22
Posts: 7
Questions regarding adc1/2 whilst using one thumb joystick.

Hi all, 

 

Whilst lying in bed it occurred to me that it might be possible to use both adc channels connected to the one analogue joystick but wanted to ask if anyone can confirm if my idea would work. 

 

From what I've seen adc2 overrides adc1 and it's commonly used for variable brake amount or reverse switch but it occurred to me instead of using adc1 set to current no reverse brake center I could set it to current no reverse and then set the voltage range so that only the central to forward on joystick covers the 0-100% power range (1.7v to3v) instead of the motor spinning when joystick is in neutral position which is normally 50% aka 1.7v.

I was then thinking I could wire up adc2 to the same joystick potentiometer pin as adc1 but set it's range to cover the 0v-1.7v range and set it to be the gradual braking but invert the single so instead of it being 100% brake at 0v it's 100% at the 1.7v.

 

Effectively when joystick is at neutral position in the 0v-3v range

giving 1.7v it is triggering adc2 to apply full brake, moving it backwards towards the 0v reduces the braking till there is none at 0v and moving it forward towards the 3v instead starts to spin the motor.

 

Would this work having both adc1 and adc2 on the same pin but set to read different voltage ranges? 

Ganzey
Offline
Last seen: 2 weeks 6 days ago
VESC Free
Joined: 2021-06-14 00:42
Posts: 7

Is this not what the control type setting "current no reverse brake center" does?

Ben26
Offline
Last seen: 1 month 1 week ago
VESC Free
Joined: 2024-10-02 17:22
Posts: 7

Yes the current no reverse brake center does that however I'm looking for brake to be 100% at center point and going down to 0% at what would be 100% on a normal setup hence why I was thinking if I wired adc2 into the joystick I can set it to brake and invert the range it expects tricking it to apply full brake at joystick neutral position. 

Ben26
Offline
Last seen: 1 month 1 week ago
VESC Free
Joined: 2024-10-02 17:22
Posts: 7

Having had more of a play in the settings now I've got my lipo wired and not running it on a power supply I've realised that my only option is using duty cycle and if I want to do all the stuff I'm wanting I'd be better getting an odrive for position control etc as vesc is the wrong solution to the problem.