Bot Board 2 Continuous Proportional Servo

Hi,

I have been playing with the SSC-32 and Just Basic for a while now. A few of you have helped me along the way and I appreciate that. I have now come to a point where its time to start on my final project. I want to use the bot board 2 to control a continuous rotation servo based on the output of a continuous rotation POT. In other words I want to build a proportional continuous rotation servo.

My theory is that the computer will send a numeric value to the Bot Board that will represent the angle/voltage the pot should be at, and then the Bot Board will figure out where the POT is already and decide the shortest route to the new position and tell the servo to rotate as CW or CCW as required. As the servo rotates the voltage from the POT will be read by the Bot Board and as the value gets closer to the required value it will slow down a bit (within the last 5 degrees I think) and then when it reaches the required voltage it will stop. I’m thinking it will receive a new position at a rate of 30 commands per second so the system will be constantly updating and refiguring out where it is and where to go and at what speed.

I think that is about it.

The Requirements are as follows:
-I’m going to use an Ethernet to Serial host and a wireless router to connect the computer to the Bot Board
-It has to be able to set everything including the motors to neutral in the event of signal loss.
-I want to be able to get the voltage in my main battery (12v) to display on my screen as well as the voltage from the continuous POT which I can convert to an angle.
-I have to be able to send auxiliary servo commands to the Bot Board at any time to control things like motor speeds and lights without disrupting the rotational servo sequence.

My questions:
-Can the Bot Board receive serial signals while in operation?
-Can the Bot Board read POT inputs?
-What chip would someone suggest I be using in the Bot Board?

I’m not asking for someone to do the work, I’m asking for some opinions as to the feasibility and complexity of this project and of course some advice.

Cheers, and thanks a lot.

Brett Williams

if you use the hardware serial pins on an atom pro module you can receive characters in the background and get an interrupt when they are available.

the atom pro module in a bot board can read up to 8 analog inputs (from sensors like the pot).

atom pro is probably a good option if you want to write code in basic and use a bot board.

depending on what you are using as a continuous rotation “pot” the largest challenge will be writing a position routine that deals well the discontinuity in analog voltage a pot outputs as it passes 0 / 360 degrees.

Hi,

Im using these as POTs
usdigital.com/products/encoders/absolute/rotary/shaft/ma3/

So, the bot board can receive continuous serial data from the computer while it is in operation. It will just pause the other routine send the new command to the servo and then go back tot he original routine.

I think I understand. I’ve been thinking about this for a while and am slowly figuring things out. And yes the 0/360 degree discontinuity has been one of my concerns, but I have a couple of idea in my head that might lead to solutions.

Cheers,

ideally you would not do computations in the interrupt routine since you have no idea what it has interrupted when it occurs. the only thing the interrupt needs to do is take the newly received byte out of the hardware buffer and put it into a queue that the foreground routine processes. also keep in mind that the atom pro has a hardware servo (hservo) output feature that relieves you of having to generate servo pulses in software. so what you foreground loop does is read the analog value, compute a new power level to send to the servo, and poll the serial receive queue for new position commands.

Well I am quite confused, but I don’t know much about this yet. I mostly concerned about physical data transfer and making sure that it will work before I purchase the hardware, then it is learning time.
But you think this is possible? And it isn’t overly complex right.

Cheers,

Cadmunkey, have you thought about what you want to use to drive the motor. It can be done with an H-bridge circuit. It can be made from scratch using discrete 5vdc turn on FET’s, and receive control signals using the hpwm (hardware PWM) command on the Atom Pro. This also runs in the background and can be set up to follow a variable in the program. Another way to drive the motor would be with a SyRen motor controller. They can be set up to receive servo pulses, and as EddieB mentioned there is a hservo (hardware servo) command that runs in the background. We have them in 10amp and 25amp. Either method should be relatively easy to implement. The Atom Pro has more than enough speed and functionality to work for making a large servo from scratch. So your program could actually be very simple. I would think this should be relatively easy to get working.

I’m building Right Angle Drives for a model ship. Mechanically I have them working right know. So I’m using a Hitec continuous rotation servos for the rotation of the RAD’s and a Sabertooth 2 x 10 to control the propellers. At the moment it uses standard r/c tx and rx, but I want them to operate like real RADs.

You can see them operating in this video.
i214.photobucket.com/albums/cc278/queenofchilliwack/Rads/th_Movie_0002.jpg
This is a picture of the rotational setup. The servo is int eh bottom on a small gear, the two outer gears have the RADs attached to them and the big center gear has the MA# censor on it.
http://i214.photobucket.com/albums/cc278/queenofchilliwack/Rads/IMG_0478.jpg

Cheers,

cadmunkey the two end pulleys are for steering control or are they some sort of thrust?

There are is a shafts inside of a sleeve inside of another sleeve in the hull. The shaft turns the propellers which are driven by the sabertooth and then the sleeve around that shaft turns the rad which the pulley’s are attached two and then that all fits inside a second sleeve that is fiber glassed into the hull.

http://i214.photobucket.com/albums/cc278/queenofchilliwack/SCAN3003_001.jpg

Cheers,

hmm, ok, well here is why I ask… if the pulley on the “pot” didn’t need to turn the full 360 degrees then you could actually use a standard servo with it’s internal pot removed and the external one wired in… effectively you just made the gear train longer and the servo controller pcb inside the servo would not have a clue.

to allow it to go the full 360 though you will need to write some code for a atom pro or what have you that is aware of the discontinuity and deals with it. a simpler solution in software would be to have 2 "pot"s that were 180 degrees out from each other and just use for your movement which ever had the destination position closest a midpoint. I don’t see how you would do that on this arangement though.

it might almost be easier, or more straight forward at least, to do this with a quadrature shaft encoder that includes an index pulse. in that way you could think strictly in terms of position and use the index pulse to associate position with some absolute angle.

So you want to do something like use the large motors to drive the prop at variable speeds and in both directions, and use a servo to rotate the prop housing 360 deg.?

yes Zoomcat you are correct. Its a fairly simple concept, but is hard to explain in text.

I think I have to stay with my current idea. The idea of RADs is that their is no end point, you can turn the rads clockwise for years and it doesn’t matter, but when you want it to point in a certain direction it will. The system is supposed to be completely proportional and completely rotational so that the propellers can thrust in any direction.

Cheers,

I’d think it would be easier to be able to rotate the drive 180 deg and reverse the prop to achieve 360 deg thrust capability. If the drive has to be able to continously rotate, the you migh get away with using two pots, the one inside the the continous rotation servo and another mounted externally. Put the pots 90 deg out of sync to overlap the pot dead zones and then compare the pot output voltages to determine the current position.

Hi

I already have the MA3 pots installed in the drive system. I have had it completely operational with a SSC-32. It worked great. The problem with that is that if I loose the connection with the computer the brain is gone and the boat will just continue doing what it was last doing before the signal failed. This is a NO NO. It has to be able to go into neutral if the connection is lost. Thats why I wanted the Bot Board, cause if I loose the connection it still thinks and can set everything to neutral and use an on board alarm to warn of the signal loss.

Also, this project is not about taking the easy road, there have been a million steps I could have simplified, but then it wouldn’t be like the real ship. I’m a scale modeler I like it when everything is perfectly scaled down, there is no easy way there is only the right way.

Cheers,

Ok, I’m currently sick and haven’t been working this week at the job or on any projects, But Ive been thinking. I’m wondering if there isn’t a product out there that will easily do this without the programing, boards, computer, routers and extra baggage that goes along with it. So I’m guessing there isn’t or else someone would have suggested it by now. So I was thinking again while spending my third day on the couch watching movies. I was thinking that a Single H-Bridge - HS-5745 Servo Amp could be reprogrammed to do exactly what I want. I could then use the MA3 pot as the pot one the board as well as modify my transmitter with them. This way I can still use standard R/C tx and rx and it would be quite simple to implement and maintain, as well it would have the reliability of the FASST system link, which I am very happy with.

Any comments? Am I crazy? I would have no idea how to modify a Single H-Bridge - HS-5745 Servo Amp. Does anyone have an ideas or suggestions?

Any help would be greatly appreciated.

Thanks,

You could do what you want using two 2.4k resistors and a second small servo type pot mounted external to the servo. You would need to defeat the internal pot stops to allow them to rotate continously and you would have to monitor the voltage outputs of the two pots to determine the current position of the servo. You may want to look at what I’ve posted about servo feedback to start getting the idea.

The 5745 servo amp to the best of my knowledge can’t be reprogrammed to do different stuff. It may be able to have some speed, endstops, or similar things adjusted but don’t think they would help you.

I just looked at your video and hey that’s pretty cool!

I assume you don’t want or are unable to operate the boat as is. Even though it’s basically functional you don’t know if the stick is centered properly, stopping the servo. Would it be possible to add a flag staff onto the idler hub with a 90° elbow. Allowing you to see what position the props are pointing?

I remain confident the microcontroller method would easily handle this task. It could read a pulse from a channel on your radio receiver and send it’s own pulse to the servo that’s already there. The Atom Pro can directly read the 360° pot’s 0 to 5vdc output. The code would be simple straight line code with no need for interrupts or hardware based commands. So it’s really a matter of defining what exactly you want to have happen. You can use one axis of a joystick on the transmitter to accurately position the props through 360°. But there would be no way to make them rotate continuously, as the transition from 0° to 359° would cause the servo to go at full speed the opposite direction. This isn’t a limitation to the process, it’s really a limitation of how things work.

I will leave this for food for thought.

I looked at your video for the first time today and now have a better understanding of your mechanical setup. If the large vertical pully is just functioning as a belt tensioning idler, and it is the same diameter as the pullys on the drives, you may be in luck. If so, you can use it as an analog encoder wheel using two pots. You should be able to open up two pots like below and remove the mechanical stops so they can rotate continously. Cut the 1/4" shafts off shorter so that they can be inserted into opposite sides of the center hole of the idler pully and secured. Rotate the pots such that they are 180 deg out of sync (when one pot is in the center of the dead zone, the other pot is in the center of its normal operating range. A bracket to hold the pots and pully can be made from thin material and the nuts on the pots used to hold them to the bracket. Wire the pots so they both output the same increasing/decreasing voltage when the idler pully is rotated. Chose one pot as primary. Using 5v as a reference voltage, write the control program to monitor both pot’s output voltages such that when voltage from the primary pot goes below .7v or above 4.3v, the program uses the output voltage of the standby pot to determine position while the primary pot is near the dead zone. The idler pully could then be put back in its origional position riding on the belt (some of the motor well wall might need to be removed to accomidate the pot on that side). Just an idea to think about.

radioshack.com/product/index … Id=2102789

Sorry its been so long, but other projects, vacation and work called for my attention.

I have had the mechanical system running, with an SSC-32 reading the voltage of of my Continuous Rotation Pot via the VA command. The computer then displays a vector that rotates to show the angle on my screen. The one pot covers 360* and is attached to the idler pulley which is the exact same as the drive pulley’s. It works and I am able to get a 5v signal from the pot that tells we where the drives are pointing.

So, I am happy with the mechanical part of the project.

My friend is a mechanical engineering student and he is helping design a solution to the issue I have. He suggests we pursue the HS-5745 Servo Amp a little more. It would pretty much replicate any device we would build ourselves. He is hoping that if it is the right microcontroller on it he can either reprogram it or replace it with a new customized one.

This is more for the Lynxmotion employees, but does anyone know the model of the gray microcontroller unit on the HS-5745 Servo Amp? Also is the original code that was used to program the unit available, so that we could us it as reference when we write our own for continuous rotation? Both my friend and I think this is the simplest solution assuming that we can hack the unit.

Again thanks for the help, and hopefully you guys can help.

Cheers,

It’s an Atmel ATMega8L. The source code is not available. The chip would likely need to be replaced in order to reprogram it with different code.