Viewing and editing remotely

 So how do i add objects on a webpage so as to animate those objects and represent a house or a building or a complicated object in real-time 3d, animated to represent those objects. Like a window opening or closing.

The basic idea is to have a local small computer like a Raspberry Pi that can do the work of both talking to a local set of sensors like temperature, pressure, flow, window or door contacts or whatever. Or maybe a set of drapes.

There are a few things to keep in mind. First, schematics are the way I manipulate a sensor's value before sending it off or receiving from a remote viewer.

 Next, the viewer that remotely communicates  to these local schematics works entirely within a browser using three.js, a 3d interface that presents real time viewing of those sensors.  

The browser viewer can do several things. It can remotely edit the 3d scene within the browser where the local computer gets the browser instructions to copy a schematic when a new 3d object is added which then begins to send real time data that now can be viewed from anywhere in an animated object on the browser's screen.

That data now updates the 3d scene in real time so that changes in the local computer can  now be immediately reflected to that remote browser. Both editing and visualizing is done remotely. 

To accomplish that I need a rock solid set of instructions that will not crash. That's where Hal comes in. Hal was a program I created that presented both 3d object viewing and also  viewing of the logic in 3d using animated logical blocks.

I do that with block control, a scada system I've spent 35 years creating. Viewing had its issues. Running a 3d viewer 24 hours a day would eventually fail. So the personel learned to reboot the system every shift.

That created its own problems. If you're controlling a large piece of equipment and you suddenly stop and restart, then who wants large machine to suddenly stop and then restart because the controller, Hal, stopped and restarted. 

So over the years, I developed a way to save all the important control blocks so that when the system restarted, it would restart just like when it was shut down or stopped working.

I dont worry about the controlling schematic though as I removed bugs in the logic blocks decades ago. The problem was the 3d side. It just wasn't able to do 24 hours a day. Now that the 3d side is in the browser separated from the controlling block controlled schematics, that is no longer an issue.

At this point, when a user adds a 3d object to a scene, that 3d object creates a schematic on that local machine and begins to communicate to that remote 3d object so as to animate it.

This separation of duties removes my issues with the local controlling computer. If the 3d engine hiccups, it doesnt affect the local controlling computer. Just restart the browser and you're up again. Not that this will become much of an issue anyway. But the separation makes it so much more stable.

Since I used to view the thinking of the logic of the controller schematics in 3d, i plan on sending the logical positions of the local schematics over to the 3d browser viewer.

This makes it so that an installer can easily find any logical problems by simply viewing the logic directly. No hidden language problems. The blocks will be viewed remotely in an animated logical way. 

Anyway I could go on with what I've done over the 35 years of programming the system but suffice it to say. Ive learned how to present the logic and the 3d animated objects representing the real world. Its like having an xray machine of real life. AI and Zigbee and Zwave have given me the power I need to implement this system. Before these protocols.

 I used Modbus TCP and other protocols that could communicate over fiber optics to local wired sensor systems like Wago that could send me sensor data.

Also, being as i used inputting type of blocks, I could use a way of controlling the system in a powerful efficient way. One that wouldn't keep sending data through the system when that data didn't change. 

At first, i was pegging my CPU at 100%. After I added stuff like deadbands, it dropped below 1%. Effectively, the system worked like a human brain and only sent data through the schematic when an event took place. The only problem was on restart and resetting the blocks to what they were at the last run was solved. 

So thats it. I can't relay 35 years of programming in one blog but at least you get the gist of what im doing. And my videos prove that I made it work.

Pierre




Comments

Popular posts from this blog

Wow. Really ?

From home to internet and born again

so big one today. talking to my 3d objects