I just looked up and read the manual and it seems pretty straight forward.
Current output: Each channel has a current sensing circuit. The output of this circuit is approximately 1V for each amp the motor draws (5V maximum). This output can be connected directly to the analog input of any 5V micro controller.
Control logic: The built in control logic allows each motor to be controlled by 2 pins. Driving the direction pin high or low will cause the motor to run forward or reverse. The PWM pin is used to control the motor speed. When this pin is low, the motor is off. When this pin is high the motor is at full power. To vary the speed of the motor this pin must be Pulse Width Modulated.
Is there any of the above that is not clear to you?
Forget about the current pin for now --For testing, KISS is better. Less wires and fewer connections are good things. Connect then if you would like, they will neither help nor harm and will do nothing until the Arduino is coded to read them.
From there, you basically got 2 pins (connections) per motor. In the most simple set-up, if one is high and the other low, the motor will rotate (full speed) one direction. Reverse the high/low and the motor will reverse direction. This same system exists when one of those pins is connected to a PWM output on the Arduino. [do some searches for PWM] The idea is that the PWM output on the arduino is flicked on-and-off, wicked fast (thousands of times a second) and the percentage of time that the “pulses” are either on or off, controls the speed. Lets say it is at a %50 duty cycle --The PWM pin will be high 1/2 the time and low 1/2 the time thus, 1/2 speed. This would also be around 1/2 brightness if one were dimming a LED via the same method.
In the end, you will have one pin per motor going to a PWM output and one pin per motor going to a digital pin. The PWM controls the speed and the digital pin will toggle your FWD/REV.
In your main loop, you have dirpin HIGH and the PWM pin maxed out to 255. This is HIGH/HIGH and will not allow your motor to run. I would try a PWM speed of 127 to test.
More about PWM --This one might be a bit funny in your head. Lets assume you have a 75% duty cycle --High for 3/4 of the time and low for 1/4 of the time. Lets also assume your direction pin is low. This will result in 75% speed in that you will have a high/low (on) situation 75% of the time and low/low (off) 25% of the time. Now, lets change that direction pin to high instead to change direction. With this same 75% duty cycle, you will now have a high/high (off) 75% of the time and a low/high situation 25% of the time --this will result in 25% power the other direction. It seems counter-intuitive but to get your 75% power the “other direction” you actually need a 25% duty cycle.
This is my first post, so forgive me if I break protocol. I bought a rover 5 and then bought a dagu 4 channel controller from a british outfit (robosavvy) and was able to create my first robot. Super cool!
Alas, a couple of weeks later I fired up the robot but a screw had come loose, fallen onto the controller and I created an acrid puff of smoke and uncreated my first robot. Not so cool. Bummed by the long wait for a controller sent over the pond, I sought and found a new supplier of the dagu board I’d destroyed: robotshop. They sent me a board tout de suit, but I was surprised to see that it didn’t behave like the first board I had (before I fried it, of course). Specifically, while I could run each wheel independently, in either direction, I could no longer run arbitrary combinations of wheels. Worst of all, I couldn’t run all wheels forward!
Assuming that I just got a bum board, I bought another. It behaves exactly the same.
Here’s a picture of both boards, with the first one on the left. They look similar, but clearly there’s some additional circuitry by the four motor connectors (the white connectors) on the ‘newer’ board.
Any suggestions or ideas? Thanks in advance for any help,
I realise this post was some time ago but I’m new to this forum and everything robotics.
I’ve got the same boards as these with the Rover 5.
A few things… is the GND (black cable) from Motor Controller connected to A0 on the Spider? Also, does it matter which pins on Spider (D1 - D13) I connect to? Lastly, can I connect 9V to the Motor Controller (6 x 1.5 Alkaline batteries)?