Simple closed loop speed script

6 years 7 months ago #29532516 by revz
Ah ok thank you!

Please Log in or Create an account to join the conversation.

6 years 6 months ago - 6 years 6 months ago #29532528 by revz
Thank you for that information.

Another question(s): How do I get Closed Loop Speed to work? When I switch from Open Loop to Closed Loop Speed in the configuration panel, I lose all functionality from the Run panel as well as from running the script.

FWIW, I followed these steps found in Ch. 9, and got through each one till the last one, #10:

1. Configure the controller in Open Loop Mode using the PC utility. This will cause the motor to run in Open Loop for now.
2. Configure the sensor you plan to use as speed feedback. If an analog tachometer
is used, map the analog channel on which it is connected as “Feedback” for the se- lected motor channel. If an encoder is used, configure the encoder channel with the encoder’s Pulses Per Revolution value. On brushless motor, if the rotor sensor (Hall, Sin/Cos, ..) sensors are used, configure the correct number of motor pole pairs.
3. Click on the Run tab of the PC utility. Configure the Chart recorder to display the speed information if an encoder is used. Display Feedback if an analog sensor is used.
4. Verify that the motor sliders are in the “0” (Stop) position.
5. If a tachometer is used, verify that the reported feedback value read is 0 when the
motors are stopped. If not, adjust the Analog Center parameter.
6. Move the cursor of the desired motor to the right so that the motor starts rotating, and verify that a positive speed is reported. Move the cursor to the left and verify that a negative speed is reported.
7. If the reported speed polarity is the same as the applied command, the wiring is cor- rect.
8. If the tachometer polarity is opposite of the command. If an encoder is used, swap its ChA and ChB outputs. Alternatively, swap the motor leads if using a brushed DC motor only. The speed polarity can also be inverted by entering a negative number of encoder PPR. On brushless motors, entering a negative number of poles will also invert the speed measured by the Hall, SinCos, or SPI sensor.
9. Set the controller operating mode to Closed Loop Speed mode using the Roborun utility.
10. Move the cursor and verify that speed stabilizes at the desired value. If speed is un- stable, tune the PID values.

Please Log in or Create an account to join the conversation.

6 years 6 months ago #29532529 by blake
Please send me your configuration file (Configuration > Safe Profile to Disk) at This email address is being protected from spambots. You need JavaScript enabled to view it.

Please Log in or Create an account to join the conversation.

6 years 6 months ago #29532530 by revz
Ok, I sent it. I think I figured it out now though. I don't know what the problem was--- Previously I had a value of 120 RPM Max in the config page, and was running the script at a full 1000 value. I changed that to a 1200 RPM Max, and ran the script at 10% to achieve the desired 120 RPM. Could that be it?

I do have another question however, which does loosely pertain to scripting, but general electrical engineering as well. I'll post it here but maybe another thread is more appropriate.

As I mentioned earlier in the thread, I have two circuits, one for light strobe, and one for power control. Right now, my power control circuit turns on a relay > power supply > motor control. after a timer elapses, the relay is closed, and the motor powers down. My question is about regenerated power flowing back to the power supply - is this a concern? i.e. should I build in a brake or decel into the script? Or will powering the system down and letting it drift be OK?


Please Log in or Create an account to join the conversation.

Time to create page: 0.069 seconds