18V15 SMC -- serial problem?

I have an 18V15 SMC that I am talking to via an arduino softserial port. It is running a linear actuator (drawing, I think, 500 mA without load). The SMC to serial communication works initially. When the USB connection is plugged in, it works fine and I see no serial errors or anything else on the pololu software. When I unplug the usb connection, it continues to work fine for a while then it hangs up (stops responding to the Arduino serial instruction). The error light does not light. Initially I thought it was a case of low Vin but if that were the case the error light should go on … it does when I cut power (an older HP lab type power supply that should be able to deliver 12V and 10 A at least). When I re-connect the USB connection there are no errors listed.

Any help/insight would be appreciated!

David

Hello, foe.

I’m sorry you are having trouble.

Is the large blue capacitor soldered into your SMC 18V15?

Could you please try using our “simple example” sketch from the Arduino Examples section of the Simple Motor Controller User’s Guide? Try putting that sketch on your Arduino and see if you still have the same problems.

If you make any changes to the sketch, please let us know exactly what changes you made. (We wrote that sketch before Arduino 1.0 came out.)

–David

Ok, I updated the sample code so it works with Arduino 1.0. Please try it out and let us know. --David

Thanks David. I will try the new code but I now see that it is a serial error problem (the error LED lights) and the pololu control center shows a serial error. I have the big blue capacitor soldiered into the board. The linear actuator motor is sealed but I suppose my next step is to put capacitors (what value?) from + and - to the motor case. Would it help if I slowed the baud rate down from autoselect (38000) to a more sedate 4800?

Any suggestions would be appreciated.

David

Hello foe.

When I was updating that example code I found out that using Auto Baud Detect in conjunction with software serial doesn’t work well. The SoftwareSerial library in Arduino 1.0 has sloppy timing when it transmits, which means the SMC will detect the wrong baud rate, and this can cause trouble later. I recommend setting the Simple Motor Controller to have a fixed baud rate. Trying a lower baud rate is also a good idea. Let me know if you continue to have trouble because there is more we can do.

–David

David

Thanks for that … hmmm, it’s still not reliable. I set the baud rate to 9600 via the controller software and it runs but sooner or later (usually sooner) the serial errors stop the motor. It seems like a dumb way to fix this but maybe I should monitor the error pin and reset when it goes high? How long does the reset take? The actuator is doing something important so reliability matters in my application.

Thanks for your help!

David

Hello, foe.

Could you look at the “Count” column in the Simple Motor Control center and try to figure out what kind of serial error is occurring? It would be good to know.

How long are the wires between the Arduino and the SMC? Is there anything that could be causing noisy signals on the line? Do you have a direct ground connection between the SMC’s GND and the Arduino’s GND?

Maybe you have a noisy serial line and it’s just inevitable that errors will happen once in a while. If that’s the case, then I would recommend using CRC to avoid accidentally sending the wrong command and also having a way to recover from errors.

The easiest way to recover from the errors is just to send the Exit Safe Start command (0x83) regularly. For example, you could send it right before the setting the speed. I think that will solve your problem, but if you want extra reliability you could also reset the controller as you were suggesting. Resetting the motor controller should only take about a millisecond, but give it 5 ms just to be safe. The reset line only need to be held low for a few microseconds but then it takes a millisecond for the controller to reinitialize.

–David

David,

The serial wires are 8" long, the SMC, Arduino, and Power supply grounds are all connected at the same place.

In 1 hour of running (with USB plugged in so the error clears eventually) the serial error count was about 15300. In the table below, the entry adjacent to the noise row is 15 and format shows 11. No other numbers. these seem small compared to 15300 total.

David

oh, and if it helps, when a stop occurs the serial error count runs wild for a while (a second or so) then the error light resets and all is well for a while.

Okay. My advice still stands:

–David

Thanks, David, I appreciate your patience. I have put in two statements resetting the controller (one in each of two PID loops) and it works reliably now. I will work on the serial noise issue since the reset seems like it would cancel things like overtemp protection which is nice to have.

Thanks again,

David

Okay I’m glad things are working better for you now.

You’re not resetting the controller during every PID cycle, right?

–David

Uhhh, yes, I am. I also have had a safestart statement in both PID loops which didn’t solve the problem. So I am doing a controller restart in both PID loops and in every cycle of those loops. Yeah, I know, that can’t be good! This weekend I will try a different (much higher quality) linear actuator and I am hoping that the noise issue will go away and if so I’ll get rid of the reset commands.

Just to close the circle on this … my serial problems were apparently due to the motor I was using and prossibly a loose ground as well. The 18V15 now works beautifully with my arduino and my better quality linear actuator.

Cheers, David

I’m glad that you figured out the problem! --David