How to use Spark max client?

I am trying to test the NEO brushless motor with the Spark Max client software. It’s supposed to allow me to spin the motor but I can’t get it to spin. In the “Run” tab, I dragged the motor output slider to about +0.2 and then clicked “Run”. The motor spindle twitched and then stopped as if it was running position close-loop mode and has reached target. So I want to select the “Percent” mode button but all the mode buttons are grayed out.

Are you sure your PID values are set?

I just want to do percent mode not any of the close-loop modes. So in theory, it shouldn’t need PID constants. But I did try to put a value in P. Not knowing what a good P value is, I put in 1.0 but I think it is way too high. Now that I think about it, I should try a lower value.

1 Like

Just tried putting 0.1 and 0.01 in P and still not moving. I don’t think I need to put in any PID values if I could only ungrayed the “Mode” buttons so I can select “Percent Mode”.

I managed to turn the motor by disabling the limit switches (they were ON by default) and put 0.01 as the P value but the rotation was very jerky. Also, the motor runs really hot even though my power output is only about 0.25. The motor starts to smell funny too so I had to stop playing with it.

Okay, that’s some data.

We are in the same boat as the thread authors. We just got our Spark Max controller last night. It’s sitting like a brick.

A couple of questions to the community: The web page refers to something called the “Spark Max PC Utility”. Is this something that actually exists? (The link associated with the phrase takes me nowhere useful)

Has anyone successfully used the client software to operate the motor? (The documentation doesn’t actually say what the client does, so we’re just kind of guessing that we ought to be able to use the client to operate the motor. )

We’ve been able to spin up our NEO just fine using the Spark MAX Client. What version are you using? Did you upgrade the Spark MAX firmware before running?

1 Like

Thanks. We have 0.13.4 client (which we downloaded last night) and updated the firmware at the same time.

One of the things mikets referred to is that the “mode” radio buttons on the “run” screen are all disabled. Mine are as well. Is that normal? I’m kind of guessing what I ought to be doing in order to spin the thing.

And…armed with the knowledge that we had the right software, we tried everything again, and then called in the electrical team to fix the wiring error. It seems like it’s working now.

Our buttons weren’t greyed out. What was your wiring error? We only ran percent output, so I haven’t explored the other control modes yet.

1 Like

The wiring error was pretty simple. We had wired it into the PD board, and the electrical member had put the breaker into the wrong circuit. We weren’t supplying power. The USB gave it enough power to flash the status LED, which was alternating between blue and orange. Not a combination that I saw in the LED status table.

After that, we could run the client and spin the motor, but the buttons remained greyed out. At first, it was jerking, but after a while it seemed to respond as in percent mode. We could speed it up and slow it down by moving the sliders.

We set a can ID in the client, but we haven’t yet gotten it to work under program control. We fired up a solenoid just to make sure our CAN bus was connected, but we haven’t yet figured out why we can’t run it. That will have to wait until tomorrow, it seems. We have a solid magenta light, corresponding to coast mode, brushless, and valid signal, but it doesn’t move.

We have made a lot of progress since my last post. Several words of caution: we fried one of the Spark Max because the controller was set to brushed instead of brushless. I knew about the importance of setting it to brushless but apparently the setting didn’t stick even after I “updated configuration” and it reverted back to brushed before I realized it and it was too late. Also, you must plug in the encoder wire even though I was trying to do “percent output” mode. Apparently, the controller needs the position info from the encoder to run the motor even in open-loop mode. We can now spin the motor with the client software. We have finished wiring the electronics board with 6 Spark Max controller. We are using 4 of them to run the drive base. We do have one issue that we are still investigating. Our right front wheel does not spin. All the other three wheels are spinning fine. We did the swapping controller technique to check if the problem is with the motor or with the controller. The right front wheel motor seems to work with right rear wheel controller. So we concluded the culprit is the controller. We replaced it with another brand new controller and it’s still not working. To make it even more confusing, we tried the allegedly bad controller standalone (i.e. supply power to it and hook it up to the client software and another motor and it spins fine). So the “bad” controller was fine after all. We then put it back to the drive base and it started working. So we thought everything is good. After a while, we turn off the robot, then turn it back on later on and the same motor controller failed again. We couldn’t figure out why. Doing all the swapping gave us the same result pointing to a bad controller. Then our lead programmer said there is a newer version of the Spark Max firmware. We had 1.0.381 and the newest is 1.0.384. So he decided to flash the new firmware to see if it fixes the problem. It’s still not working but this time the Driver Station console gave an error saying that particular motor controller’s firmware is too old. And I thought “Give me a break, it is the latest firmware”. We then flashed it back to 1.0.381 and it magically started to work. So we though it’s all good again. Then another mentor said, let’s power cycle the robot and see if it’s still working. We power cycled the robot and sure enough it failed again. Bear in mind that all the other three wheels are working always every time, just not the right front wheel. We even swapped the right front wheel controller with the right rear wheel controller and the new right front wheel (i.e. formerly right rear wheel controller) will fail. So it is as if the right front motor is bad. Then we hooked a spare NEO motor to the right front controller and it still not working. So, what’s going on. We stretched our head really hard and still couldn’t figure out who’s the culprit. Since our CAN devices are daisy chained (we have always been doing home-run on CAN devices and this is the first time we do daisy chain) so we thought it might have issues with bus termination and got wave reflection on the CAN bus. So we swapped the chaining position of the trouble controller and the trouble controller is still not working. We believe our chain was properly terminated with the RoboRIO as the head of the chain and the PDP as the tail of the chain with the “termination resistor” jumper ON. Just in case there is a conflict CAN ID on the bus, we changed the CAN ID of the trouble controller to something high (e.g. 15) and still not working. So we tried also everything we can think of and still can make it work. Any idea what could be the culprit?

BTW, one more piece of info. While the “bad controller” wasn’t working, it’s status light showed a solid cyan color indicating it has a valid signal. So it seems to say somehow RoboRIO did not send the command to the bad controller. But again, it worked a couple times before with the same code.