DIY SegWay - Arduino + Sabertooth 2x32

Hello,
i’m facing a big issue with my “GasWay”

On the lab’s desktop everythings is working fine, when i put all the stuff on the GasWay chassis it become unstable…
It start shaking and often motors goes to 100% and there is no way to power off with deadman switch…(i need to find an hard way to avoid injuries
…about this any help will be appreciate as the main power switch is located at the bottom of the GasWay :)…)

I am pretty sure it’s because of elettromagnetic interferences generated by the two huge 24V 500W motors.
Due to the chassis, motors are close to electronics (Gyro,Sabertooth and Arduino), i tried to twist all the signal cables i could twist and something is better but it’s still unstable.

Right now i’m thinking on how i could shield the two motors.

Any help and suggest on this will be appreciate

Attached images, schema and code.

Schema_GASWay V2.pdf (247 KB)

Under1.jpg

Under7.jpg

CodiceSegWayGASPotRev9.ino.ino (31.7 KB)

Try decoupling capacitors to place across your arduino 5V pin and arduino GND. Like a big electrolytic capacitor, as well as a small ceramic one.... like 100 microFarad electrolytic and a 100 nanoFarad ceramic ... in parallel.

Also.... your code.... probably better off with 1 millisecond update time (rather than 10 millisecond). And could be beneficial to use micros() instead of millis() for this kind of thing.

And.... better change 9600 bit per second serial rate to something much faster... like 115200.

And.... if you can avoid it... for testing.... try not to put too many Serial.prints (actually.....for final testing.... don't put any Serial.prints at all) .... as that can slow your control loop and might cause glitchy behaviour.

Thanks Southpark, will try your suggests, about the serial speed that is forced by the sabertooth i suppose.

What do you mean with "And could be beneficial to use micros() instead of millis() for this kind of thing." ?

thanks again replying.
regards
Fabio

fgastald:
Thanks Southpark, will try your suggests, about the serial speed that is forced by the sabertooth i suppose.

What do you mean with "And could be beneficial to use micros() instead of millis() for this kind of thing." ?

thanks again replying.
regards
Fabio

Most welcome Fabio. With the micros() function..... that allows you to work with microseconds units....so for update times in the order of 1 millisecond.... it could be better to use micros() instead of millis()....as the resolution of millis() is 1 millisecond.......... while micros() gives you microsecond resolution.

On a different subject......about the serial speed... with the 9600 bit per second, I once used that speed for my bot (when I first started tinkering with them). And I was wondering why my bot wasn't behaving the way I expected. Eventually 'upped' the serial speed to something much higher...... and everything started to work properly, like magic. Then I set the speed back to 9600 a few times.... just to make sure it was due to this. And sure enough...... it was slowing things down - due to the serial comms activity.