10-14-2009
11:17 AM
- last edited on
04-24-2024
10:08 AM
by
Content Cleaner
The bottleneck in my current app is the serial writes at 115200, to a custom device. The program dramatically improves in speed as the baud rate is increases. If i remove the serial write and read, the program loop time improves from 100 to 2000htz
The device also has a CAN interface. Im debating trying to use the NI CAN interaface card to see if there are improvments in speed but want to get an opinoin first since this will require considerable reprogramming. The can card appears to be just two serial ports but yet, accoring to specs, appears faster.
Its difficult to try to compare serial and can speeds. CAN is up to 1mbits a sec while 115200 is measuring baud. After considerable reserach to compare the two, i still am having difficulty. Im not sure these comparisions are even valid as Im more instrested in in sending one charcter and then recieving it rather than contual streaming of data whch is what these rates measure.
10-15-2009 03:02 AM
Hi,
could you please explain a bit more in detail what you are trying to accomplish and why the serial communication speed is a bottleneck for you? Is your device a motion control system?
In general a CAN interface differs significantly from an RS232 port - not only by the baud rate. A CAN interface has an onboard µ-processor and provides deterministic communication. The way how to program your device might also differ significantly when switching from RS232 to CAN. E. g. with RS232 it's probably only possible to send high-level commands to the motion control unit, while CAN might allow to send a stream of setpoints, that get interpolated on the motion controller before they are passed to the control loop.
These are just some guesses, but I can't give you better advice, before I know some details of your application.
Thanks,
Jochen
10-15-2009 07:46 AM - edited 10-15-2009 07:47 AM
This is a custom servotube powered by an amplifier. The servo has a renishaw encoder for 1um resolution. The application requires reading the position of the renishaw encoder every iteration. This positional information is then logged into the data. The position is independent of the feedback loop but it is important for the research. The feedback loop itself is determined by a strain gauge and 9237 module which compute loading forces of the servotube, and this is converted to analog output value via pid and then sent via an ni analog output module to the differential input on the amplifier. The differential inputs on the amplifier will create a current (I) for the servotube value based on the voltage it receives.
The bottleneck only has to do with the serial port. Reading the serial port can be accomplished with the serial or can interface. Using the serial port, the commands to get the position and then read receive it back, can occur at a rate of around 350 iterations a second at the highest baud, 115200. This 350 iterations is if there is nothing else in the loop other than visa read and write of the serial port with no delays. Its the best case scenario and when the additional code is in place, we are getting more like 100 iterations a second.
So the baud rate speed dosent seem to apply? It is really a delay in the send and receive each time the communication is initiated? That is why the can interface might be better? Programming the NI can card seems a little tricky and i want to be sure it will offer improvement before jumping into this task.
Maybe there is a chip or something NI has to read the position of the reinshaw on the available NI AD cards we have on the system.? It would then reduce the bottneck?
10-15-2009
08:45 AM
- last edited on
04-24-2024
10:08 AM
by
Content Cleaner
also, will these cards run on 64 bit vista?
https://www.ni.com/en-us/shop/category/vehicle-communication-buses.html?productId=118158
10-15-2009
09:44 AM
- last edited on
04-24-2024
10:09 AM
by
Content Cleaner
Thank you for posting these details. To answer your last question first: Yes, NI-CAN supports Vista x64. Now to your other questions:
Of course the baud rate difference is a significant difference between the CAN interface and RS232. If your Renishaw encoder supports sending data via CAN in a timed mode, your application could leverage the DMA feature of a board like the NI 8513. This feature does not only provide better throughput, but also deterministic timing, as no software jitter is involved. An NI CAN board also allows synchronization with other NI hardware.
Please let me know if these features are relevant for your application. Could you please provide a link to your encoder's datasheet? This will allow me to answer the rest of your questions.
Thanks,
Jochen
10-15-2009 09:53 AM
You can use a 9411 with quadrature decoding FPGA code (or any counter board that accepts differential singnals) to read differential quadrature pulses directly from a Renishaw encoder. If the encoder only has 1V p-p output, Renishaw sells an interpolater that will convert this to differential signals. This would allow you to almost instantly (MHz range) get your position.
Beware of using the 9237 for closing a control loop. The module uses a sigma-delta ADC which has a 37 cycle delay (sigma-delta ADC's process a signal many times to get higher accuracy - but this adds delay). If your control loop gets significanly faster - to the point where the ADC delay is greater than the control loop rate - this delay will cause significant problems and may make it near impossible to tune the system. For example: if the 9237 is set to 50kHz (max rate) - the delay of 37 cycles limits your control loop to approx 1350Hz . . perhaps a little bit more if your loop isnt' too sensitive to feedback delay. Really sigma delta ADC's are ment for streaming waveform data acquisition and not control loops - but if you keep your control loop rate slow enough it should work.
10-15-2009
01:11 PM
- last edited on
04-24-2024
10:09 AM
by
Content Cleaner
Jochen
this is the renishaw encoder data sheet.
we have the 1um encoder option
http://resources.renishaw.com/download/(800d63d2512149808b77e6ceed491822)?lang=en&inline=true
thanks
Which CAN card to you recommend?
https://www.ni.com/en-us/shop/model/pci-8512.html
10-15-2009 01:16 PM - edited 10-15-2009 01:17 PM
Marco,
We have a 5v peak to peak encoder.
Reinshaw does have an option for a usb output converter for this type of converter although analog you mention would have been better.
The position can then be read in through a comm port into labview.
We are going to evaluate this in addition to the NI can card and whatever options are available.
Great call on the 9237.
I did have the app running without the serial calls at a very good rate.
I was notching a huge difference in the responce to the load cell and this would have to be it. Kudos.
10-16-2009
02:58 AM
- last edited on
04-24-2024
10:11 AM
by
Content Cleaner
Thank you for the datasheet. According to the datasheet there are encoder options with 1 Vpp output signals or with quadrature encoder signals (two 90° phase shifted digital output signals, 5V). Which version do you have?
If you had the quadrature encoder version, you could use an M-Series, X-Series or a counter/timer board to connect the AB signal directly to a counter input. Are you using cDAQ? In this case you could add a digital input module to slot 5 or 6 and you are done.
Using a counter for reading position data is the fastest and most direct way to get these data into your PC.
If you are using the 1 Vpp version of the encoder, you could replace your existing converter to a device, that accepts 1 Vpp and outputs an AB signal. I think this is a more reasonable choice than using a CAN board for this single purpose.
Regards,
Jochen
10-16-2009 10:01 AM
Jochen
I believe we have the quadature encoder.
the model number is : rgh24x30a00a
We did already order the high speed CAN board yesaterday.
I want to explore all options.
So which of the model do you recommend?
Speed is the primary goal.
Is there programming we have to do for these boards?
Or does it decode position automatically?
thanks
Jim