i am trying to make an inverted pendulum using 2 rotary encoders, a DC motor and a pololu motor controller. the code seems to be working properly, and i can get angle velocity outputs from the encoders but when i hook the motor controller up to the Rx output i am getting nothing from the controller. no voltage output to the motor from the controller.
i'm attaching the code. does something look off in here?
this is cannibalized code and that was from someone else's project. my motor is much bigger and running off a 19.5V 7A power supply, i guess i missed that in the notes but the math in the code definitely shows 19.5V or else my output would be very wrong.
all of this is on a mega2560 using the 2,3,20 and 21 interrupt pins. 19.5v is coming from an old laptop dc power pack plugged directly into the motor controller, arduino is running off usb port on laptop, rotary encoder 5V is running off arduino 5V pin. pin 18 outputs rx from the arduino to tx on the motor controller. i have test code that works to display counts, angle, and velocity in the serial monitor just fine so i know the sensors are reading properly on the arduino. it's orchestrating the motor to move based on these sensors that is now the problem.
i have been doing this all in ubuntu, but i just found pololu has a program in windows for the motor controller so i switched laptops and it seems to be the motor controller that is throwing errors and not giving the motor juice.
i am using the 24v12 simple motor controller with 19.5V into the Vin and ground, OutA and OutB go to motor inputs, and the Rx and Tx are linked via Arduino Mega 2560 pin 18 and the motor controller and the ground next to Rx is grounded to the Arduino. the error light on the arduino has not gone off since i plugged it in, but the Rx/Tx light is flashing like they're talking...