EFeru / hoverboard-firmware-hack-FOC

With Field Oriented Control (FOC)
GNU General Public License v3.0
1.05k stars 876 forks source link

USART seperate wheel control #468

Open miso521 opened 4 months ago

miso521 commented 4 months ago

Variant

USART

Control type

FOC

Control mode

Voltage

Description

Hello,

im having difficulty controling 2 motors,im trying to send commands via usart to control each wheel separately im using code from arduino serial and its working perfectly,but when im trying to use Send(Value0, Value1) for example both Value0 and Value1 have different valuse wich im getting from analogread. nothing is working as it should. also tried with #define TANK_STEERING same thing.

thank you.

sorry for bad english.

Derkades commented 4 months ago

readInputRaw in util.c sets input1 and input2 to the values of steer and speed. Later in main.c if TANK_STEERING is defined, cmdL is set to steer and cmdR is set to speed. So it should work fine if I understand the code correctly.