Century (Regal) VGreen motor automation

ccbill

Gold Supporter
Jul 23, 2021
183
Atascadero, Ca
Pool Size
23000
Surface
Plaster
Chlorine
Liquid Chlorine
The Century (Regal-Beloit) VGreen variable speed motors have an RS-485 interface and the communication protocol has been identified as this pdf attachment which was posted in other threads. @MSchutzer Identified it as being correct at least as far as being able to read status and write configuration.

I just bought an ECM16SQU which I haven't received yet - I really want to make my own controller; being an instrument and control tech it's just too tempting. Post from me may be sporadic.

Please share what you learned and any code you are willing to share - especially any data structures or mappings for the command set.
 
Hi all, I really did hit the jackpot tonight, see photo below:

Aqualink_RS_status.jpg

This is the status display of my Aqualink RS talking directly to my Vgreen 165 motor over the native RS-485 link !!!!
Now that I've cut to the chase I'll fill in the details of how I got this to work.

But first for @ccbill I did spend some time playing around with the native modbus protocol as described by the document referenced above. I can confirm that those API commands work as I was able to set the motor demand (motor's speed) and then execute a go command and the motor ran. I then changed the speed (demand) and the motor's speed changed. Then I issued a stop command and it stopped. One note though, the motor needs to see a RS-485 command at least once per minute otherwise the RS-485 interface times out and the motor shuts off. Unfortunately my terminal program only logged the motor responses but I manually added the commands I sent to the motor along with a text explanation of the log entries. The sequence of ModBus commands to talk to the motor in it's native protocol is shown in the "Regal_demand_go...txt" file attached below. Note that all those values in those log files are hex values 0xnn.

For those folks with an Aqualink RS system that want to do the same thing with their Vgreen 165 motors you need to modify one of the Motor's Configuration variables and then save the change in the motor's flash. Two simple commands is all it takes! And one other thing; to then make the motor talk in the Jandy protocol instead of the native modbus protocol you need to set the motor's DIP switch number 5 to on. I missed the DIP switch when I tried this yesterday and the motor wouldn't talk the Jandy protocol. After making the configuration change DIP switch 5 controls which protocol the motor talks, if the switch is off it talks Modbus per the document, when on it responds to Jandy's protocol only. Power cycle the motor after changing the switch setting as it may only be read at power up (just a guess on my part).

I figured this out by looking at the user manual for the Jandy VSFloPro 165 pump that uses the same motor as the Vgreen 165. In that manual they talk about the DIP switch configuration with switches 3 and 4 controlling the Jandy pump address and they show switch 5 on without saying why. Anyway after reprogramming the configuration variable and power cycling the pump with DIP switch 5 on it woke up talking the Jandy protocol. When talking in the Jandy protocol the Modbus protocol commands don't work. It's one or the other protocol at any one time. See the attached log file called "Regal_Jandy...txt" for the sequence of commands that I sent to the pump.

After I issued the two commands (demand and go) in the Jandy protocol the motor started running!!!!! Like the native protocol the motor stops after 60 seconds if no other RS-485 commands are issued. Each time a "go" command is re-issued the motor runs for another 60 seconds. The real Aqualink RS is constantly polling the RS-485 bus and each active address is polled many times a second so timing out is not an issue with the real system.

In that log file there are a few extra commands as I verified that I was first talking to the motor by checking the status, and then I read the value of the configuration variable on page 10, address 5 before trying to write it. It's all detailed in that log file.

As to the hardware that I used to do the configuration changes I bought a cheap $15 dollar USB to RS-485 converter from amazon shown here:
USB to RS-485 adapter.

I used a terminal program on my windows laptop and just typed the commands into the macros of the program. That particular terminal program requires the macros to be used to send hex values rather than ASCII. I've attached a screen shot of the terminal program with all the different Macro's that I typed in.
Terminal_program.JPG

The macro screen requires the special character $ to indicate that you are sending hex values. After you type in the Macros you just click the macro number to send that command. There are many terminal programs out there but not all support hex. Anyway if you want to use this program it can be downloaded from here: Terminal program at Google site

Then I temporarily connected the motor's RS485 connections to the Jandy RS and went into the Jandy VS pump setup screen and told it that I had a EPUMP connected as the filter pump. As soon as I configured it the pump started running and the status screen showed the pump priming along with the bonus of the power consumption. A success!!

It was getting into the evening at this point, now I just need to disconnect all the digital inputs and wire the pump to the breaker as I had the AC switched with a relay in addition to the digital input controls. But that's for another day now that I know it works.

If anyone wants to know what all those macro commands do I can explain them more. Also see my post of last night referenced in @ccbill 's post linked under other threads as I talk about the online calculator for figuring out the modbus checksums there. There's also more in that post explaining the configuration variable that changes the user protocol.

For those people who have Pentair automation systems I did try and change that same configuration variable to a value of 2, the API says this selects the Pentair protocol, but the motor did not respond to that command. If the variable value is out of range the motor just doesn't reply back. So I can only assume that the Pentair protocol isn't supported by the software in the motor. Just because something is in the API it doesn't necessarily mean that the software supports all options, sorry Pentair folks :-(

I'm sure there's more that I left out but I'm getting tired of typing. Feel free to ask if anything isn't clear.

Mark

Edit: Those log files have better formatting if you open them in WordPad (or equivalent) and then change the page to Landscape formatting. In portrait mode the line wraps make them a bit of a mess to read.
 

Attachments

  • Regal_demand_go_stop_with_tx_log.txt
    889 bytes · Views: 83
  • Regal_Jandy_configuring_log.txt
    1.3 KB · Views: 71
Last edited:
@MSchutzer , after switching the motor over to the Jandy protocol did it still need to get a query every sixty seconds? I was hoping I could just get status on demand while it was running a programmed scehdule - at least at first.

Nice post, thnx. I'm going to use a wifi to rs485 adapter.
 
Yes, with either protocol the motor stopped running after 60 seconds without any RS-485 commands. But in both cases I had issued the motor run command from the RS-485 interface.

The Vgreen motor has a priority to the control inputs with the controller being the lowest priority, the RS-485 interface is the next level of priority, and then the digital inputs being the highest priority.

I'm not sure what would happen if you have the motor running via the control panel and then you issue a RS-485 status command. The interface will go active and the LED on the control panel will start blinking, but it might just execute the status command and then the RS-485 interface mode would time out 60 seconds later.

Since the control panel is driving the motor it may just continue running when the interface times out. It may also stop as soon as the RS-485 interface goes active with the status command.

I can try that out over the weekend and let you know what happens.
 
  • Like
Reactions: brentk
@ccbill,
Here’s your answer. If you start the motor via the control panel and then issue a modbus status command the motor responds back with the status byte being 0x20 (fault mode - motor stopped).

As soon as you issue the status command the motor stops. After a minute the RS-485 interface times out and then the motor starts up again under the control of the control panel. It’s anyone’s guess as to how this shutdown affects the run time programmed on the controller? It may not affect it, or it could restart the run timer at zero after the RS-485 timeout.

Mark
 
Enabling the Jandy Aqualink RS-485 Protocol on the Vgreen 165 motor

In a couple of other posts here and above I have talked about how the Vgreen 165 motor can be enabled to talk Jandy's RS-485 protocol. This allows the motor to be controlled via the RS-485 connection by Jandy Automation systems such as the Aqualink RS or Aqualink PDA.

I want to summarize the steps to reconfigure the motor in one post with all the needed information.

First I want to thank @zafarpatel7 who first posted the Regal (Century) document that describes the motor's native protocol. For reference here is a link to the Gen3 EPC ModBus Comm Protocol PDF document. Without that document this configuration change wouldn't have been possible.

Reading that document I came across an interesting looking Configuration Parameter that is shown in this screen capture
Protocol_configuration_register.JPG
Configuration page 10, address 0x05 is labeled Protocol selected and it's possible values 0-4 seem to indicate that one can select any of the "big three" protocols or select an all in one choice. Seeing this led me to see what it would take to try and change this value. I'll describe the details of the programming below, but it turns out that only choices 0 - default, and 1 - Jandy are the only valid choices that the programming will accept. If you try and enter 2 through 4 the motor just ignores the commands.

Hardware Needed

To talk to the RS-485 bus you need some hardware to convert the RS-485 physical layer to something that can talk to a computer. I bought a $15 dollar USB to RS-485 adapter from Amazon. You also need a computer (laptop preferably) that can run a serial terminal program to send commands to the motor. If you are using a Windows based machine you can download this Terminal BPP program. This is the program that I used and I'll describe how to use the Macro functions to send the needed commands to the motor.

To connect the RS-485 adapter to the motor you need a two wire cable (phone cord is fine) and then you connect the A and B terminals on the motor to the A and B terminals on the adapter. Here are a couple of photos showing those connections. You only need to hook up the A and B connections on the motor. The picture shows other wires connected on my motor as I also have the digital inputs hooked up, those are not necessary for re-configuring the motor. CAUTION: Before starting make sure you press Stop on the control panel to stop the motor. Then make sure the motor is powered off at the AC breaker for at least a minute before opening the wiring compartment!
Vgreen_RS485.jpg

Rs485_adapter.jpg

After hooking up the two wires set the red DIP switches in the motor compartment as follows: Switch 1 through 4 - off, Switch 5 - on. Here's some more info on the switch settings from a Jandy pump manual that uses this same motor.

Motor_Switch_Settings.JPG


After you connect up the RS-485 adapter you need to run the terminal program. When you plug the adapter's USB port into the computer Windows should automatically install the driver for it, this may take a few minutes. After the driver installs the adapter should show up as a USB serial port in the Windows "Device Manager" screen in the Control Panel. Note the COM port number assigned to the USB adapter.

The terminal program is a simple one file executable so you can place it anywhere and click on it to run it. Once it runs you will see a screen that looks like this:
Terminal_window_w_Macro.JPG
The terminal window is on the left and by clicking the "Set Macros" button on the lower left the Macro screen on the right will open up. At this point you will have blank macros. I have attached a file containing the macro's shown named "regal_macro.tmf.txt" to this post. This is just a text file despite the funny file extension. In order to attach this file I had to add the .txt extension to the file. The terminal program will look for macro files with the .tmf extension so you will want to rename this file and remove the .txt from the end when you copy this file to the directory where your terminal program is. If you copy this file to the same location as the terminal program you can click the "Load" button on the Macro listing, select the filename and then your macro screen should look like the one above.

Edit 6/24/22: In the receive box window you will see a few check boxes that select the format that the terminal program displays. By default the Ascii box is checked, you need to check the leftmost hex box as shown on the screen capture above so that the data is displayed in hex format. If the default Ascii format is checked the motor response will be gibberish and may not display at all.

To connect the Terminal program to the RS-485 adapter select the correct COM port number (in the top left) and then click the Connect button.

Now you can turn the AC power back on to the motor. The motor should be stopped, if it isn't press "Stop" on the control panel.

Before going further I should explain what all the funny characters in each Macro mean. These are all the digital commands to control the motor over the RS-485 interface. If you want to delve into the nitty gritty you can read the Modbus Protocol document. All the Macros that start with $15 ... are native Modbus commands. The Macros that start with $10$02 are commands in the Jandy Protocol format.

Here's what each Macro does:
M1 - Read the motor status
M2 - Read the value of the configuration variable on page 10, address 0x05
M3- Write the value of 1 to the configuration variable on page 10, address 0x05
M4 - Save the configuration values to Flash Memory (This makes the change persistent through power cycling)
M5 - Set the motor speed (aka Demand) to run at 2500 RPM in Jandy Protocol.
M6 - Send the "go" command to start the motor in the Jandy Protocol.

If the motor is powered up (doesn't need to be running), and you have selected the right COM port and are connected you should be able to click the M1 macro key and the motor should reply with the response 15 43 10 20 F9 E4 . The fourth value may be different depending on what state the motor is in. The key thing here is that you get some response. If you get a response you are good and you're connected, the COM port is right, and you have the RS-485 wiring between the motor and the adapter correct. If you don't get a response you aren't talking to the motor and you need to recheck the configuration of the terminal port and the wiring. By the way all the default speed settings of the terminal program are correct for talking to the motor as the RS-485 bus runs at 9600 Baud. You don't have to change any of those settings.

If you received a response from the motor you are ready for the next steps.
  1. Next click on M2 and the motor should respond with 15 64 10 0A 05 00 00 85 FF. The 7th value in the list is 00 indicating that the configuration variable is at it's default of 0.
  2. Then click M3 to reprogram that variable to 1, the motor should respond with 15 64 10 8A 05 00 01 6D FF. Note that the 7th value is now 01 as the motor acknowledged a value of 01 was written.
  3. Next click M4 to save the configuration to flash. The motor should respond with 15 65 10 4A 98.
  4. Now turn off the AC power to the motor for 30 seconds and then turn it back on. No need to press start
  5. After the motor is powered back on click on M5. This sends the motor a speed command (aka demand) in the Jandy protocol. If Dip switch 5 is on the motor should reply to the Jandy command with 10 02 00 1F 44 00 10 27 00 AC 10 03 .
  6. Then click M6 to issue the go command to the motor. It should return 10 02 00 01 41 00 54 10 03 and the motor should start running for a minute. (The motor will stop after 1 minute because the RS-485 interface times out if it doesn't receive a command at least once a minute. You can click M6 again and the motor will run for another minute.) The real Jandy system is constantly talking (polling) the motor so this timeout doesn't ever happen when connected to a real system.
Commands M5 and M6 are commands in the Jandy protocol and you have just confirmed the Jandy protocol is now working.


Switch 5 in the motor's wiring compartment now controls which protocol the motor talks. When SW5 is on it talks Jandy only. When SW5 is off it talks the Modbus protocol only. With Switches 3 and 4 off the pump responses to the pump1 address (0x78). See the switch table from earlier in the post that describes the addresses.

That's it, you are done. Now connect up the four terminals of the motor's RS-485 connector to your Aqualink RS-485 connector and then go into the Aqualink configuration web interface and select the VSP pump setup and select a Jandy EPump1 for the filter pump. Follow the Jandy instructions for configuring all your wanted speeds. After configuring you should see something like this on the Aqualink status screen.

After hooking everything up the process only takes a couple of minutes to do the programming changes. It takes a lot longer to explain it all :)

I'm sure I probably left something out, feel free to ask if you have any questions,

-Mark
 

Attachments

  • regal_macro.tmf.txt
    320 bytes · Views: 77
Last edited:
Here are a couple of python functions to get the CRC16 value for a message. You can find them with a search but I'll post them for convenience.
 

Attachments

  • crc16.txt
    5.1 KB · Views: 42

Enjoying this content?

Support TFP with a donation.

Give Support
I got it working today using V-Green 160 as ePump2 (Pentair Intelliflo is VSP 1). Great instructions. Used Coolterm on the Mac. Only temporary hiccup was finding an old machine with USB port and configuring the serial ports (needed to download driver - one forgets so much of what they once knew...).
 
  • Like
Reactions: MSchutzer
I attempted this today and no luck. I have the connections made but there is no response from the motor. Do I need to add a 12V power to the connector on the board? I only have the a and b wires hooked up. The adapter and com ports worked fine and displayed ok on my pc
 
What version of Vgreen motor do you have, the 165, or the 270 motor?

In either case you should be able to at least read the status of the motor successfully. What terminal program are you using, are you using the same terminal program that I used?

Make sure you correctly identify the com port that is assigned to the USB to RS-485 adapter in your computers control panel. Then make sure you have selected that com port in the terminal program, and then click on the connect button in the top left of the terminal screen.

You should only need the A and B wires hooked up, no ground is needed.

What have you tried to send to the motor? Make sure you rename and load up that list of Macro's that I included in the post, and then click on M1 to send the hex string to the motor. If hooked up correctly the motor should reply back.

If you have a Vgreen 270 this configuration change may not work as another TFP member tried and found that the configuration variable location returned and error on the Vgreen 270 motor. There's an alternate configuration variable on the Vgreen 270 that has the potential to work, but I don't have Vgreen 270 hardware to try.

Please post a screen shot capture showing your computer's screen with the Macro window also open so that I can take a look at it.
 
Hi MSchutzer, thanks for responding.

I have the com port assigned as com3 in device manager and I believe that is what I selected
1656105039191.png
when i press M1 this shows
1656105133715.png

and this is the macro box
1656105196081.png

I have the 165 Motor. Thanks for taking a look
 
I am a Mac guy so I am not going to comment on PC/com port interface (I had my own issues getting the driver loaded on my mac). But once I got the com port connection established, I did have no issue getting a response from th V-green motor - and I just had the A and B wires connected. One thought, do you have teh A and B reversed? Not sure if that would make a difference, but it might?

On the Mac side, I did not have macros but I just typed in the hex codes one by one - they were all short enough that this was easier than figuring out how to load macros (and I only needed to do it once).

Been working all week with no issues. Jandy AquaLink speeds motor to 2500 for heating and runs at 1600 otherwise. I might be able to run slower.
 
I checked that the wires were plugged in correctly a couple of times matching the a and b because I used the same colour wire I was paranoid about it. I haven't tried typing the codes manually though
 
Thanks for showing your screen display. Try checking the hex box in the receive window settings. I see that you have the ascii box checked (that‘s probably the default setting)

The motor will respond with hex values and these are probably not ascii displayable characters. When you check the hex box it won’t try and convert the motors response to ascii character’s, and will just display the hex values instead.

I see that’s something I left out of my instructions.

Hopefully thats all that’s going on.

Mark
 

Enjoying this content?

Support TFP with a donation.

Give Support